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.
Features
- 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
workflow.yml
on: [push]
jobs:
test:
runs-on: ubuntu-latest
name: Testing
steps:
- name: Test our action
uses: andrioid/gh-action-k8s-set-image
with:
namespace: "default"
images: |
deployment.example.backend=gcr.io/example/backend:latest
deployment.example.frontend=gcr.io/example/frontend:latest
Runs:
kubectl --namespace default set image deployment/example backend=gcr.io/example/backend:latest frontend=gcr.io/example/frontend:latest
kubectl --namespace default rollout status deployment/example
Additional Resources / Info
Special thanks to:
- TypeScript
- NCC (from Vercel)
- ts-jest
- Venue POS (my employer)
Top comments (0)