Boa noite!
Estou com um problema com deploymet que está apresentando erro com o LivenessProbe, Poderiam me ajudar?
Referente a aula de Health check do curso Kubernetes: prática, Helm e Cloud
Segue a configuguração do arquivo yaml:
apiVersion: apps/v1 kind: Deployment metadata: name: vollmed labels: app: vollmed spec: replicas: 3 selector: matchLabels: app: vollmed template: metadata: labels: app: vollmed spec: containers: - name: vollmed-api image: leonardosartorello/vollmed:v8 ports: - containerPort: 3000 env: # Define the environment variable - name: DB_HOST # Notice that the case is different here # from the key name in the ConfigMap. valueFrom: configMapKeyRef: name: dados # The ConfigMap this value comes from. key: DB_HOST # The key to fetch. - name: DB_DATABASE # Notice that the case is different here # from the key name in the ConfigMap. valueFrom: configMapKeyRef: name: dados # The ConfigMap this value comes from. key: DB_DATABASE # The key to fetch. - name: DB_PASSWORD # Notice that the case is different here # from the key name in the ConfigMap. valueFrom: secretKeyRef: name: senhas # The ConfigMap this value comes from. key: DB_PASSWORD # The key to fetch. livenessProbe: httpGet: path: /paciente port: 3000 initialDelaySeconds: 10 periodSeconds: 3
Segue o erro capturado no Events de um dos pods:
Events: Type Reason Age From Message
Normal Scheduled 9m10s default-scheduler Successfully assigned default/vollmed-865468cdf-xd896 to minikube Normal Killing 8m7s (x3 over 8m52s) kubelet Container vollmed-api failed liveness probe, will be restarted Normal Pulled 8m5s (x4 over 9m9s) kubelet Container image "leonardosartorello/vollmed:v8" already present on machine Normal Created 8m5s (x4 over 9m8s) kubelet Created container vollmed-api Normal Started 8m4s (x4 over 9m8s) kubelet Started container vollmed-api Warning Unhealthy 7m52s (x10 over 8m58s) kubelet Liveness probe failed: Get "http://10.244.0.39:3000/paciente": dial tcp 10.244.0.39:3000: connect: connection refused Warning BackOff 4m6s (x16 over 7m26s) kubelet Back-off restarting failed container vollmed-api in pod vollmed-865468cdf-xd896_default(feaddab5-6587-4253-9d68-43d5b89f69bb)