If you're making changes to a service that is deployed to Kubernetes, it sure is annoying to have to update the helm deployment-chart values with the newest image version before you deploy. At least, that's how I felt when developing on our dockerfile-generating service, blubber.
Over the last two months we've added
- A script to update the image versions (https://gerrit.wikimedia.org/r/plugins/gitiles/operations/deployment-charts/+/refs/heads/master/update_version/)
- A new 'promote' step to PipelineLib (https://wikitech.wikimedia.org/wiki/PipelineLib) to run the script and create the patchset on merge
- Various infrastructure pieces to ensure necessary packages are available
And I'm excited to say that CI can now handle updating image versions for you (after your change has merged), in the form of a change to deployment-charts that you'll need to +2 in Gerrit. Here's what you need to do to get this working in your repo:
Add the following to your .pipeline/config.yaml file's publish stage:
promote: true
The above assumes the defaults, which are the same as if you had added:
promote: - chart: "${setup.projectShortName}" # The project name environments: [] # All environments version: '${.imageTag}' # The image published in this stage
You can specify any of these values, and you can promote to multiple charts, for example:
promote: - chart: "echostore" environments: ["staging", "codfw"] - chart: "sessionstore"
The above values would promote the production image published after merging to all environments for the sessionstore service, and only the staging and codfw environments for the echostore service. You can see more examples at https://wikitech.wikimedia.org/wiki/PipelineLib/Reference#Promote
If your containerized service doesn't yet have a .pipeline/config.yaml, now is a great time to migrate it! This tutorial can help you with the basics: https://wikitech.wikimedia.org/wiki/Deployment_pipeline/Migration/Tutorial#Publishing_Docker_Images
This is just one step closer to achieving continuous delivery of our containerized services! I'm looking forward to continuing to make improvements in that area.
- Projects
- None
- Subscribers
- Maha_maker_cmd
- Tokens