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
718 views
in Technique[技术] by (71.8m points)

yaml - Error in creating backend containers in Azure Kubernetes

While trying to deploy my web application in the Kubernetes cluster (AKS) I see that my back end pods are not coming up , they keep on going into RESTART details below :

C:Workk8> kubectl get pods

NAME                                                            READY   STATUS             RESTARTS   AGE
backend-mypod-backend-766b54f6dd-85v6v                         0/1     CrashLoopBackOff    549        35h
backend-mypod-backend-766b54f6dd-j4fm9                         0/1     CrashLoopBackOff    551        35h
backend-mypod-backend-766b54f6dd-vckbn                              0/1     CrashLoopBackOff    549        35h 

when I do a describe Pod I see below Error for all the backend Pods:

Warning  Unhealthy  26m (x5 over 28m)     kubelet, aks-agentpool-33316079-vmss000000  Liveness probe failed: Get http://10.39.67.9:8800/api/healthtest: dial tcp 10.39.67.9:8800: connect: connection refused
  Warning  Unhealthy  8m10s (x65 over 28m)  kubelet, aks-agentpool-33316079-vmss000000  Readiness probe failed: Get http://10.39.67.9:8800/api/healthtest: dial tcp 10.39.67.9:8800: connect: connection refused
  Warning  BackOff    3m10s (x59 over 19m)  kubelet, aks-agentpool-33316079-vmss000000  Back-off restarting failed container

Below is the section in the deployment yaml where we set the livnessProbe and readinessProbe :

    readinessProbe:
      httpGet:
        path: /api/healthtest
        port: {{ .Values.deployment.internalPort }}
    livenessProbe:
      httpGet:
        path: /api/healthtest
        port: {{ .Values.deployment.internalPort }}
      failureThreshold: 3
      periodSeconds: 20

10.39.67.97 - This is the IP for the Load Balancer 8800 - This is the internal Port for the deployment

Can some one pls help me of what I am missing here , I presume this to a configuration issue which I am struggling to figure out.

Thanks

question from:https://stackoverflow.com/questions/65913128/error-in-creating-backend-containers-in-azure-kubernetes

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

1 Reply

0 votes
by (71.8m points)

Can you just try startupProbe instead of readinessProbe? it's seems like the readinessProbe is failing before the server start. it happens when a server took more time than usual to start.

startupProbe: Startup probes are useful for Pods that have containers that take a long time to come into service. Rather than set a long liveness interval, you can configure a separate configuration for probing the container as it starts up, allowing a time longer than the liveness interval would allow. ref

The benefit of use startupProbe is that other two readinessProbe and livenessProbe will not execute until startupProbe succeed.

startupProbe:
  httpGet:
    path: /api/healthtest
    port: {{ .Values.deployment.internalPort }}
  failureThreshold: 30
  periodSeconds: 10
livenessProbe:
  httpGet:
    path: /api/healthtest
    port: {{ .Values.deployment.internalPort }}
  failureThreshold: 3
  periodSeconds: 20


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

...