|
28 | 28 |
|
29 | 29 | ```bash
|
30 | 30 | kubectl get pod --all-namespaces
|
31 |
| - ``` |
32 |
| - |
33 |
| -## Deploying a New CHIME Version |
34 |
| - |
35 |
| -1. [Create a new release](release-process.md) |
36 |
| -2. Wait for the `Docker` GitHub Actions workflow to complete |
37 |
| -3. Verify the new version shows up at the top as "Latest version" here: https://github.com/CodeForPhilly/chime/packages/155340 |
38 |
| -4. Open a new issue on GitHub titled "Deploy chime $VERSION" (ex: https://github.com/CodeForPhilly/chime/issues/98) |
39 |
| - * Note the PR in which the release was approved |
40 |
| - * Confirm that the tag for the version was created |
41 |
| -5. Create a local branch (based on "develop") to perform deploy time changed on, named "deploy/$VERSION" |
42 |
| - |
43 |
| - ```bash |
44 |
| - VERSION=1.2.3 |
45 |
| - git rev-parse --abbrev-ref HEAD |
46 |
| - # develop |
47 |
| - git pull |
48 |
| - git checkout -b deploy/$VERSION |
49 |
| - ``` |
50 |
| - |
51 |
| -6. Update the app.yaml manifest file |
52 |
| - |
53 |
| - ```bash |
54 |
| - VERSION=1.2.3 |
55 |
| - sed -Ei "s/(- image: .*):(.*)/\1:$VERSION/" k8s/app.yaml |
56 |
| - git add -A |
57 |
| - # verify changes are as expected |
58 |
| - git diff --staged |
59 |
| - git commit -m "Deploy chime $VERSION" |
60 |
| - ``` |
61 |
| - |
62 |
| -7. Push changes |
63 |
| - |
64 |
| - ```bash |
65 |
| - VERSION=1.2.3 |
66 |
| - git push -u origin deploy/$VERSION |
67 |
| - ``` |
68 |
| - |
69 |
| -8. Open PR on GitHub to merge changes back into develop, ideally with |
70 |
| - the review of another DevOps admin whenever possible. Ensure to link |
71 |
| - to the PR in the deployment issue previously opened on GitHub. |
72 |
| - |
73 |
| -9. Run: |
74 |
| - |
75 |
| - ```bash |
76 |
| - kubectl apply -f k8s/app.yaml |
77 |
| - ``` |
78 |
| - |
79 |
| -10. Watch rollout status: |
80 |
| - |
81 |
| - ```bash |
82 |
| - kubectl -n chime rollout status deployment.v1.apps/chime |
83 |
| - ``` |
84 |
| - |
85 |
| -11. Confirm the expected version is running |
86 |
| - |
87 |
| - ```bash |
88 |
| - kubectl -n chime get deployment chime -o yaml | grep image: |
89 |
| - # - image: docker.pkg.github.com/codeforphilly/chime/penn-chime:$VERSION |
90 |
| - ``` |
91 |
| - |
92 |
| -12. Paste the output from steps 11 & 12 into the previously opened deployment issue |
93 |
| - to document the successful deployment and close the issue |
94 |
| -13. $$$ PROFIT $$$ |
95 |
| - |
96 |
| -## Applying Changes to `k8s/` Manifests |
97 |
| - |
98 |
| -After making changes to the manifests in `k8s/` that you want to apply, first review the diff for what you're about to change using an editor that wil color-code the output and make it easy to review: |
99 |
| -
|
100 |
| -```bash |
101 |
| -kubectl diff -Rf k8s/ | code - |
102 |
| -``` |
103 |
| -
|
104 |
| -*Ignore any instances of `generation` being incremented* |
105 |
| -
|
106 |
| -Once you're satisfied with the results of the diff, you can apply a single manifest: |
107 |
| - |
108 |
| -```bash |
109 |
| -kubectl apply -f k8s/infra/ingress-nginx.yaml |
110 |
| -``` |
111 |
| - |
112 |
| -Or the entire directory: |
113 |
| - |
114 |
| -```bash |
115 |
| -kubectl apply -Rf k8s/ |
116 |
| -``` |
| 31 | + ``` |
0 commit comments