question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Readiness probe failed: Error: Got HTTP code 503 but expected a 200

See original GitHub issue

Chart version: 7.7.1 Kubernetes version: 1.16 Kubernetes provider: E.g. GKE (Google Kubernetes Engine) EKS Helm Version: 2.16.10

helm get release output

e.g. helm get elasticsearch (replace elasticsearch with the name of your helm release)

Be careful to obfuscate every secrets (credentials, token, public IP, …) that could be visible in the output before copy-pasting.

If you find some secrets in plain text in helm get release output you should use Kubernetes Secrets to managed them is a secure way (see Security Example).

Output of helm get release
helm get kibana

REVISION: 1
RELEASED: Thu Aug 13 20:14:45 2020
CHART: kibana-7.7.1
USER-SUPPLIED VALUES:
{}

COMPUTED VALUES:
affinity: {}
elasticsearchHosts: http://elasticsearch-master:9200
elasticsearchURL: ""
envFrom: []
extraContainers: ""
extraEnvs:
- name: NODE_OPTIONS
  value: --max-old-space-size=1800
extraInitContainers: ""
fullnameOverride: ""
healthCheckPath: /app/kibana
httpPort: 5601
image: docker.elastic.co/kibana/kibana
imagePullPolicy: IfNotPresent
imagePullSecrets: []
imageTag: 7.7.1
ingress:
  annotations: {}
  enabled: false
  hosts:
  - chart-example.local
  path: /
  tls: []
kibanaConfig: {}
labels: {}
lifecycle: {}
nameOverride: ""
nodeSelector: {}
podAnnotations: {}
podSecurityContext:
  fsGroup: 1000
priorityClassName: ""
protocol: http
readinessProbe:
  failureThreshold: 3
  initialDelaySeconds: 10
  periodSeconds: 10
  successThreshold: 3
  timeoutSeconds: 5
replicas: 1
resources:
  limits:
    cpu: 800m
    memory: 1Gi
  requests:
    cpu: 800m
    memory: 1Gi
secretMounts: []
securityContext:
  capabilities:
    drop:
    - ALL
  runAsNonRoot: true
  runAsUser: 1000
serverHost: 0.0.0.0
service:
  annotations: {}
  labels: {}
  loadBalancerSourceRanges: []
  nodePort: ""
  port: 5601
  type: ClusterIP
serviceAccount: ""
tolerations: []
updateStrategy:
  type: Recreate

HOOKS:
MANIFEST:

---
# Source: kibana/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: kibana-kibana
  labels: 
    app: kibana
    release: "kibana"
    heritage: Tiller
spec:
  type: ClusterIP
  ports:
    - port: 5601
      protocol: TCP
      name: http
      targetPort: 5601
  selector:
    app: kibana
    release: "kibana"
---
# Source: kibana/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kibana-kibana
  labels: 
    app: kibana
    release: "kibana"
    heritage: Tiller
spec:
  replicas: 1
  strategy:
    type: Recreate
    
  selector:
    matchLabels:
      app: kibana
      release: "kibana"
  template:
    metadata:
      labels:
        app: kibana
        release: "kibana"
      annotations:
        
    spec:
      securityContext:
        fsGroup: 1000
        
      volumes:
      containers:
      - name: kibana
        securityContext:
          capabilities:
            drop:
            - ALL
          runAsNonRoot: true
          runAsUser: 1000
          
        image: "docker.elastic.co/kibana/kibana:7.7.1"
        imagePullPolicy: "IfNotPresent"
        env:
          - name: ELASTICSEARCH_HOSTS
            value: "http://elasticsearch-master:9200"
          - name: SERVER_HOST
            value: "0.0.0.0"
          - name: NODE_OPTIONS
            value: --max-old-space-size=1800
          
        readinessProbe:
          failureThreshold: 3
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 3
          timeoutSeconds: 5
          
          exec:
            command:
              - sh
              - -c
              - |
                #!/usr/bin/env bash -e
                http () {
                    local path="${1}"
                    set -- -XGET -s --fail -L

                    if [ -n "${ELASTICSEARCH_USERNAME}" ] && [ -n "${ELASTICSEARCH_PASSWORD}" ]; then
                      set -- "$@" -u "${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}"
                    fi

                    STATUS=$(curl --output /dev/null --write-out "%{http_code}" -k "$@" "http://localhost:5601${path}")
                    if [[ "${STATUS}" -eq 200 ]]; then
                      exit 0
                    fi

                    echo "Error: Got HTTP code ${STATUS} but expected a 200"
                    exit 1
                }

                http "/app/kibana"
        ports:
        - containerPort: 5601
        resources:
          limits:
            cpu: 800m
            memory: 1Gi
          requests:
            cpu: 800m
            memory: 1Gi
          
        volumeMounts:

Describe the bug:

kubectl describe pod kibana-kibana-7458222222-2222

  Warning  Unhealthy  26m (x5 over 27m)  kubelet, ip-101-10-161-126.us-west-2.compute.internal  Readiness probe failed: Error: Got HTTP code 000 but expected a 200
  Warning  Unhealthy  26m                kubelet, ip-101-10-161-126.us-west-2.compute.internal  Readiness probe failed: Error: Got HTTP code 503 but expected a 200

Steps to reproduce:

helm install --name elasticsearch ./elasticsearch --namespace elk 2. helm install --name kibana ./kibana --namespace elk 3.

Expected behavior:

Provide logs and/or server output (if relevant):

Be careful to obfuscate every secrets (credentials, token, public IP, …) that could be visible in the output before copy-pasting

Any additional context:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:13

github_iconTop GitHub Comments

11reactions
Ankitchandrecommented, Sep 11, 2020

you can change the value of healthCheckPath: from “/app/kibana” to “/api/status” in values.yaml . This should pass the readiness probe error .

6reactions
abdennourcommented, Nov 30, 2020

But if i have to change healthCheckPath to a new value , why is not the default value ? Guys, please check best practices implemented in som helm git repos ( e.g: bitnami,… etc) and mimic them. Overall, good job! thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Got HTTP code 503 but expected a 200 - Kibana
Hello, I have an issue where Kibana is not coming up due to a failed status check. I'm using the Helm charts for...
Read more >
How to solve elastic error of "Readiness probe failed: Error ...
yaml , it runs successfully but the pod gives this error Readiness probe failed: Error: Got HTTP code 503 but expected a 200...
Read more >
ELK Kibana Pod Readiness Probe Error : r/kubernetes - Reddit
Warning Unhealthy 22s (x55 over 9m22s) kubelet Readiness probe failed: Error: Got HTTP code 503 but expected a 200.
Read more >
How to tell why Kubernetes liveness probe gets HTTP 503 ...
The GET requests are the configured liveness probes on /, but as you can see Apache is returning 200 OK just fine. Kubernetes...
Read more >
Resolve 503 errors when I access Kubernetes in EKS cluster
HTTP 503 errors are server-side errors. They occur when you connect to a Kubernetes Service pod located in an Amazon EKS cluster that's ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found