Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm install, Kubernetes - how to wait for the pods to be ready?

I am creating a CI/CD pipeline.

I run helm install --wait --timeout 300 .... But that doesn't really wait, just returns when the "release" status is DEPLOYED.

So then I see a few things in kubectl get pods --namespace default -l 'release=${TAG}' -o yaml that could be used:

- kind: Pod
  status:
    conditions:
    - lastProbeTime: null
      lastTransitionTime: 2018-05-11T00:30:46Z
      status: "True"
      type: Initialized
    - lastProbeTime: null
      lastTransitionTime: 2018-05-11T00:30:48Z
      status: "True"
      type: Ready

So I guess I will look at when Ready condition becomes "True".

  1. It feels a bit wrong thing to do... Everyone solves this so I assume there is some feature of kubectl for that, is there?

  2. Is this the right thing to query? (See Kubernetes JSONPath reference)

    kubectl get pods --namespace default -l 'release=sc8757070' -o jsonpath='{.items[*].status.conditions[?(@.type=="Ready")].status}'

like image 816
Ondra Žižka Avatar asked May 11 '18 00:05

Ondra Žižka


People also ask

Why my deployment is not ready in Kubernetes?

If a Pod is Running but not Ready it means that the Readiness probe is failing. When the Readiness probe is failing, the Pod isn't attached to the Service, and no traffic is forwarded to that instance.

How do I know if Tiller is installed?

After helm init , you should be able to run kubectl get pods --namespace kube-system and see Tiller running. Once Tiller is installed, running helm version should show you both the client and server version. (If it shows only the client version, helm cannot yet connect to the server.

What happens during Helm upgrade?

When a new version of a chart is released, or when you want to change the configuration of your release, you can use the helm upgrade command. An upgrade takes an existing release and upgrades it according to the information you provide.

How do you check Helm is installed or not?

After the helm chart installation is complete, you can verify the installation. Note: Add --cleanup to the command to delete the testing pods after the command is run. You can also check the deployed Kubernetes resources by running one of the following commands: oc get all -n {namespace}


1 Answers

You could use kubectl rollout status

$ kubectl rollout status -h
Show the status of the rollout.

By default 'rollout status' will watch the status of the latest rollout until
it's done...
like image 187
Amit Kumar Gupta Avatar answered Sep 28 '22 09:09

Amit Kumar Gupta