User:BKing (WMF)/Notes/homedir deploy k8s
A guide on how to deploy to K8s clusters without merging code to deployment-charts.
Why?
- Rapid iteration on non-production namespaces
- Emergencies
For all other circumstances: commit, review, and merge code to deployment-charts before deploying to K8s.
How
1)Create a Gerrit patch, making it clear that it's not intended for merging. Example
2)Login to the deployment server. From your homedir, clone the deployment-charts repo: git clone /srv/deployment-charts
3)From your desktop, navigate to your patch in the Gerrit web UI and click on the "︙" in the upper right-hand corner. Click "Download Patch," then "Anonymous HTTP." Copy the "Reset To" command as shown towards the bottom of the page. Example command: git fetch https://gerrit.wikimedia.org/r/operations/deployment-charts refs/changes/12/1230512/9 && git reset --hard FETCH_HEAD
4)Return to the deployment server and from within your homedir's deployment-charts directory, paste the "Reset To" command and hit enter.
5)With your homedir, navigate to the application's deployment-charts/helmfile.d/services directory. Note that if your change includes changes to the helm chart (not just values files), you will also have to change the "chart" value under releases in helmfile.yaml to point to the chart in your homedir. For example, this value would change from wmf-stable/opensearch-cluster to ../../../charts/opensearch-cluster . If you forget this step, your deploy will use the default path under /srv/deployment-charts.
6)If you're going to deploy to a non-production namespace, suppress the IRC notifications: export SUPPRESS_SAL=1
7)Deploy using typical helmfile commands.