Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
546 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 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...