|
| 1 | +# Operations: The `chime-bus` Pre-Produciton Cluster |
| 2 | + |
| 3 | +## Connecting with `kubectl` |
| 4 | + |
| 5 | +1. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) |
| 6 | +2. [Install Krew](https://krew.sigs.k8s.io/docs/user-guide/setup/install/): |
| 7 | +3. [Install konfig](https://github.com/corneliusweig/konfig#via-krew): |
| 8 | + |
| 9 | + ```bash |
| 10 | + kubectl krew install konfig |
| 11 | + ``` |
| 12 | + |
| 13 | +4. Obtain `chime-live-kubeconfig.yaml` file from Code for Philly ops team |
| 14 | + - This file contains connection details and credentials for managing the cluster, treat its contents as top-secret! |
| 15 | +5. Merge `chime-live-kubeconfig.yaml` into your local configuration: |
| 16 | + |
| 17 | + ```bash |
| 18 | + kubectl konfig import --save ~/Downloads/chime-bus-kubeconfig.yaml |
| 19 | + ``` |
| 20 | + |
| 21 | +6. Switch to `lke_chime-live` context: |
| 22 | + |
| 23 | + ```bash |
| 24 | + kubectl config use-context lke-admin-ctx-chime-bus |
| 25 | + ``` |
| 26 | + |
| 27 | +7. Verify connection: |
| 28 | + |
| 29 | + ```bash |
| 30 | + kubectl get pod --all-namespaces |
| 31 | + ``` |
| 32 | + |
| 33 | +## Deploying a New CHIME Version |
| 34 | + |
| 35 | +1. [MaCreateke 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. Run: |
| 39 | + |
| 40 | + ```bash |
| 41 | + VERSION=1.2.3 |
| 42 | + kubectl set image --record deployment/chime chime="docker.pkg.github.com/codeforphilly/chime/penn-chime:${VERSION}" |
| 43 | + ``` |
| 44 | + |
| 45 | +5. Watch rollout status: |
| 46 | + |
| 47 | + ```bash |
| 48 | + kubectl rollout status deployment.v1.apps/chime |
| 49 | + ``` |
| 50 | + |
| 51 | +## Applying Changes to `k8s/` Manifests |
| 52 | + |
| 53 | +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: |
| 54 | +
|
| 55 | +```bash |
| 56 | +kubectl diff -Rf k8s/ | code - |
| 57 | +``` |
| 58 | +
|
| 59 | +*Ignore any instances of `generation` being incremented* |
| 60 | +
|
| 61 | +Once you're satisfied with the results of the diff, you can apply a single manifest: |
| 62 | + |
| 63 | +```bash |
| 64 | +kubectl apply -f k8s/infra/ingress-nginx.yaml |
| 65 | +``` |
| 66 | + |
| 67 | +Or the entire directory: |
| 68 | + |
| 69 | +```bash |
| 70 | +kubectl apply -Rf k8s/ |
| 71 | +``` |
0 commit comments