DEV Community

Cover image for Kubernetes: Set Image Action

Posted on

Kubernetes: Set Image Action

My Workflow

I have a workflow for work (private repo) that required setting images on Kubernetes clusters and the workflow file was getting harder and harder to read.

So I decided to create Kubernetes: Set Image that generates kubectl commands to help with changing images on deployments, and wait until the changes take effect.

I'll be using this for automatic environments, manual dispatch for more stable environments.


  • Supports multiple deployments
  • Supports multiple containers per deployment
  • Groups deployment commands, so if you have two changes to one deployment, it will only run one kubectl line.
  • Wait until the cluster reports that the changes have been applied.

Submission Category:

DIY Deployments

Yaml File or Link to Code

The README has examples of how to use this action.

Example workflow


on: [push]

    runs-on: ubuntu-latest
    name: Testing
      - name: Test our action
        uses: andrioid/gh-action-k8s-set-image
          namespace: "default"
          images: |
Enter fullscreen mode Exit fullscreen mode


kubectl --namespace default set image deployment/example
kubectl --namespace default rollout status deployment/example
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

Special thanks to:

Top comments (0)