Jump to content

User:BKing (WMF)/Notes/homedir deploy k8s

From Wikitech

A guide on how to deploy to K8s clusters without merging code to deployment-charts.

Why?

1) Rapid iteration on non-production namespaces 2) Workarounds for bugs 3) 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 with SSH and pull the deployment-charts repo into your homedir using the anonymous HTTP URL as shown in the Gerrit Web UI

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 helmfile.yaml to point to the chart in your homedir, otherwise it 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.