<p>I try to deploy Matabase on my GKE cluster but I got  Readiness probe failed.</p>
<p>I build on my local and get localhost:3000/api/health i got status 200 but on k8s it's not works.</p>
<p>Dockerfile. I create my own for push and build to my GitLab registry</p>
<pre><code>FROM metabase/metabase:v0.41.6
EXPOSE 3000
CMD [&quot;/app/run_metabase.sh&quot; ]
</code></pre>
<p>my deployment.yaml</p>
<pre><code># apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: metaba-dev
spec:
  selector:
    matchLabels:
      app: metaba-dev
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 50%
      maxSurge: 100%
  template:
    metadata:
      labels:
        app: metaba-dev
    spec:
      restartPolicy: Always
      imagePullSecrets:
        - name: gitlab-login
      containers:
        - name: metaba-dev
          image: registry.gitlab.com/team/metabase:dev-{{BUILD_NUMBER}}
          command: [&quot;/app/run_metabase.sh&quot; ]
          livenessProbe:
            httpGet:
              path: /api/health
              port: 3000
            initialDelaySeconds: 60
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /api/health
              port: 3000
            initialDelaySeconds: 60
            periodSeconds: 10

          imagePullPolicy: Always
          ports:
            - name: metaba-dev-port
              containerPort: 3000



      terminationGracePeriodSeconds: 90
</code></pre>
<p>I got this error from</p>
<p>kubectl describe pod metaba-dev</p>
<pre><code>  Warning  Unhealthy                61s (x3 over 81s)      kubelet                                Readiness probe failed: Get &quot;http://10.207.128.197:3000/api/health&quot;: dial tcp 10.207.128.197:3000: connect: connection refused
  Warning  Unhealthy                61s (x3 over 81s)      kubelet                                Liveness probe failed: Get &quot;http://10.207.128.197:3000/api/health&quot;: dial tcp 10.207.128.197:3000: connect: connection refused
</code></pre>
<p>kubectl logs</p>
<pre><code>Picked up JAVA_TOOL_OPTIONS: -Xmx1g -Xms1g -Xmx1g
Warning: environ value jdk-11.0.13+8 for key :java-version has been overwritten with 11.0.13
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2022-01-28 15:32:23,966 INFO metabase.util :: Maximum memory available to JVM: 989.9 MB
2022-01-28 15:33:09,703 INFO util.encryption :: Saved credentials encryption is ENABLED for this Metabase instance. 🔐
 For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
</code></pre>
<hr />
<p>Here Solution</p>
<p>I add initialDelaySeconds: to 1200 and check logging it's cause about network mypod cannot connect to database and when i checking log i did not see that cause i has been restart and it's was a new log</p>

Thotsaphon Sirikutta
<p>Try to change your  <code>initialDelaySeconds:</code> 60 to  <code>100</code>
And you should always set the resource request and limit in your container to avoid the probe failure, this is because when your app starts hitting the resource limit the kubernetes starts throttling your container.</p>
<pre><code>containers:


- name: app
    image: images.my-company.example/app:v4
    resources:
      requests:
        memory: &quot;128Mi&quot;
        cpu: &quot;250m&quot;
      limits:
        memory: &quot;100Mi&quot;
        cpu: &quot;500m&quot;
</code></pre>
