bh90210 / dron8s

Yet another Kubernetes plugin for Drone using dynamic Server Side Apply to achieve --server-side parity for your CI-CD pipelines
http://plugins.drone.io/bh90210/dron8s
The Unlicense
20 stars 5 forks source link

Restart rollout or update tags of container images #12

Closed stv0g closed 3 years ago

stv0g commented 3 years ago

How can we restart a rollout of a particular worklload? I am building Docker images in a previous of our pipeline. But it seems that we dont have a possibility to update running pods with new images?

bh90210 commented 3 years ago

Hey Steffen,

the plugin doesn't provide a way to trigger re-deployment with new image. There exists another drone plugin that does just that but the way I do it is by simply including an env in the config (ie kubernetes-config.yaml)

        env:
          - name: change
            value: valuevaluevalue

and have a step in the pipeline (.drone.yaml) to change it so a re-deployment gets triggered.

- name: trigger new deployment
  image: golang
  commands: 
  - sed -ie "s/valuevaluevalue/$(date)/g" kubernetes-config.yaml

this is a "feature" of kubernetes, please check https://stackoverflow.com/questions/40366192/kubernetes-how-to-make-deployment-to-update-image for more info

stv0g commented 3 years ago

Thanks :) This works for me!