Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
549 views
in Technique[技术] by (71.8m points)

azure - Kubernetes windows pods cannot reach exposed service

I am working on an azure kubernetes cluster, and am experiencing some wierd behavior from my windows nodes.

If i run a command to any of my services, the windows pods cannot connect.

I use the following wget command to test:

wget http://elsearch.default.svc.cluster.local:9200/ 

Running on a busybox image (linux) i get status 200.

Running on mcr.microsoft.com/windows image (windows node) i get this error:

wget : Unable to connect to the remote server
At line:1 char:1
+ wget http://elsearch.default.svc.cluster.local:9200/
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

I discovered this issue when investiagting some wierd behavior with regard to exposing the services. The main pod is running on windows, and does health checks to the rest of the pods. This checks suceeds until i expose a service like this:

apiVersion: v1
kind: Service
metadata:
  name: elasticsearch-service
  annotations:
    service.beta.kubernetes.io/azure-load-balancer-internal: "true"
    service.beta.kubernetes.io/azure-load-balancer-internal-subnet: "AKS-services"
spec:
  type: LoadBalancer
  loadBalancerIP: 10.10.0.102
  ports:
  - port: 9200
  selector:
   app: elasticsearch

When i apply this config, the health check fails but the linux pods seem unaffected.

My cluster is running azure-cni network configuration

Any suggestions as to why windows behaves differently, or how i am supposed to adress linux pods from windows pods?

question from:https://stackoverflow.com/questions/65844120/kubernetes-windows-pods-cannot-reach-exposed-service

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...