<p>I am facing an weird issue in kubernetes yaml file with initContainers. It shows that my initContainer is successfully running but it is in not ready state and it remains forever. There are no errors in initcontainer logs and logs shows success result .Am i missing anything ?</p>
<p><a href="https://i.stack.imgur.com/YvOT5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YvOT5.png" alt="Describe pod" /></a></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: graphql-engine
  name: graphql-engine
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: graphql-engine
  strategy: {}
  
  template:
    metadata:
      labels:
        io.kompose.service: graphql-engine
    spec:
 
      initContainers:
      # GraphQl
        - env:
            - name: HASURA_GRAPHQL_ADMIN_SECRET
              value: devsecret
            - name: HASURA_GRAPHQL_DATABASE_URL
              value: postgres://postgres:postgres@10.192.250.55:5432/zbt_mlcraft
            - name: HASURA_GRAPHQL_ENABLE_CONSOLE
              value: &quot;true&quot;
            - name: HASURA_GRAPHQL_JWT_SECRET
              value: '{&quot;type&quot;: &quot;HS256&quot;, &quot;key&quot;: &quot;LGB6j3RkoVuOuqKzjgnCeq7vwfqBYJDw&quot;, &quot;claims_namespace&quot;: &quot;hasura&quot;}'
            - name: HASURA_GRAPHQL_LOG_LEVEL
              value: debug
            - name: HASURA_GRAPHQL_UNAUTHORIZED_ROLE
              value: public
            - name: PVX_MLCRAFT_ACTIONS_URL
              value: http://pvx-mlcraft-actions:3010
          image: hasura/graphql-engine:v2.10.1
          name: graphql-engine
          ports:
            - containerPort: 8080
          resources: {}
      restartPolicy: Always
      containers:
        - env:
            - name: AUTH_CLIENT_URL
              value: http://localhost:3000
            - name: AUTH_EMAIL_PASSWORDLESS_ENABLED
              value: &quot;true&quot;
            - name: AUTH_HOST
              value: 0.0.0.0
            - name: AUTH_LOG_LEVEL
              value: debug
            - name: AUTH_PORT
              value: &quot;4000&quot;
            - name: AUTH_SMTP_HOST
              value: smtp.gmail.com
            - name: AUTH_SMTP_PASS
              value: fahkbhcedmwolqzp
            - name: AUTH_SMTP_PORT
              value: &quot;587&quot;
            - name: AUTH_SMTP_SENDER
              value: noreplaypivoxnotifications@gmail.com
            - name: AUTH_SMTP_USER
              value: noreplaypivoxnotifications@gmail.com
            - name: AUTH_WEBAUTHN_RP_NAME
              value: Nhost App
            - name: HASURA_GRAPHQL_ADMIN_SECRET
              value: devsecret
            - name: HASURA_GRAPHQL_DATABASE_URL
              value: postgres://postgres:postgres@10.192.250.55:5432/zbt_mlcraft
            - name: HASURA_GRAPHQL_GRAPHQL_URL
              value: http://graphql-engine:8080/v1/graphql
            - name: HASURA_GRAPHQL_JWT_SECRET
              value: '{&quot;type&quot;: &quot;HS256&quot;, &quot;key&quot;: &quot;LGB6j3RkoVuOuqKzjgnCeq7vwfqBYJDw&quot;, &quot;claims_namespace&quot;: &quot;hasura&quot;}'
            - name: POSTGRES_PASSWORD
              value: postgres
          image: nhost/hasura-auth:latest
          name: auth
          ports:
            - containerPort: 4000
          resources: {}
---

apiVersion: v1
kind: Service
metadata:
  labels:
    io.kompose.service: graphql-engine
  name: graphql-engine
spec:
  type: LoadBalancer
  ports:
    - name: &quot;8080&quot;
      port: 8080
      targetPort: 8080
  selector:
    io.kompose.service: graphql-engine
status:
  loadBalancer: {}


---

apiVersion: v1
kind: Service
metadata:
  labels:
    io.kompose.service: graphql-engine
  name: auth
spec:
  ports:
   - name: &quot;4000&quot;
     port: 4000
     targetPort: 4000  
  selector:
    io.kompose.service: graphql-engine
status:
  loadBalancer: {}

</code></pre>
<p>Init Container expected to be in ready state</p>

Prashanth
<p>The Status field of the initContainer is not relevant here. What you need is that your initContainer is deterministic. Currently your initContainer is running, because the used image is built to run indefinite.
Initcontainers need to built that they run their process and then exit with an exitcode 0. Graphql-engine on the other hand is a container that will run indefinite and provide an API.</p>
<p>What are you trying to accomplish with this graphql-engine pod?</p>
