Kubernetes Pod Deployment

We are deploying container images on Kubernetes which would ultimately run as a pod.

Within octopus deploy the kubenetes deployment resource using below steps.

Step (Kubernetes) → Step Templates (Deploy raw Kubernetes YAML)

How can I ensure that the Octopus shows the deployment successful only when pod comes into the running state on the Kubernetes cluster and not before that?


Hi @rahul.bhoyar,

Thanks for posting your question!

First, I’m not sure if you’ve seen it, but our Deploy Kubernetes Container built-in step should do this natively. If that looks like it might work, then it might be the easiest way to accomplish what you’re after.

If your scenario requires using the Deploy raw Kubernetes YAML step, then a way you could accomplish this is by adding a Run a Script step to your deployment process that runs on your deployment target (the K8s cluster) with something like one of the following kubectl commands:

kubectl rollout status deployment/YOURDEPLOYMENT

This should return a status on that deployment that you can act on.

kubectl get deployments

Would return the deployments and their statuses, which you could parse to determine if they’re successful.

These in combination with some error handling as shown in our documentation in the following area should get you close to what you’re hoping to do: Error handling - Octopus Deploy

Note that if this feels like it’s a lot to configure, we have some improvements coming in this area that you can read about here: https://roadmap.octopus.com/c/44-show-kubernetes-objects-status-during-deployment

I hope that’s helpful, and let me know if you have other questions.


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.