Skip to content

Commit

Permalink
doc(#217): update deployment doc after helm chart changes (#218)
Browse files Browse the repository at this point in the history
Co-authored-by: Kenn Sippell <[email protected]>
  • Loading branch information
paulpascal and kennsippell authored Dec 27, 2024
1 parent 68d771d commit dc263be
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions scripts/deploy/medic-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ As each deployment needs its own configuration directory, DNS entry and deployme
| MoH Uganda | `users-chis-ug`| `users-chis-ug.yaml` | `users-chis-ug-cht-user-management` | users-chis-ug.app.medicmobile.org |
| MoH Mali CIV | `users-chis-civ`| `users-chis-civ.yaml` | `users-chis-civ-cht-user-management` | users-chis-civ.app.medicmobile.org |

### `helm` commands
### Prepare a Deployment

The `helm upgrade` and `helm install` commands should be run in the `./scripts/deploy` directory in this repo.
To prepare a deployment, use the following steps to ensure your environment is properly configured.
The `helm install` and `helm upgrade` commands should be run in the `./scripts/deploy` directory in this repo.

1. Check the image is [published](https://github.com/medic/cht-user-management/tree/main#publishing-new-docker-images) to [ECR](https://gallery.ecr.aws/medic/cht-user-management)
2. Commit a values YAML file in [values folder](https://github.com/medic/cht-user-management/blob/main/scripts/deploy/values/) in `main` branch
3. Switch to the `deploy` branch and ensure the same values file from the prior step is in the [values folder](https://github.com/medic/cht-user-management/blob/deploy/scripts/deploy/values/) in `deploy` branch
4. Edit the version in the `tag:` as the version you want deploy in the `helm` command below. Ensure this version in the `tag:` is commmited to `deploy` branch
5. run either `helm install...` or `helm deploy...` per the full commands below.
2. Update the `tag:` in the respective `values.yaml` file located in the [values folder](https://github.com/medic/cht-user-management/blob/main/scripts/deploy/values/) to match the version you wish to deploy.
3. Ensure your local system has the latest charts by running:
```bash
helm repo update medic
```
4. Run either `helm install...` or `helm upgrade...` per the full commands below. (commands should be run in the `./scripts/deploy` directory in this repo)

#### Install (only once!)

Expand All @@ -61,6 +64,9 @@ helm upgrade \
$CONFIG medic/cht-user-management
```

> [!NOTE]
> If you encounter issues, you may need to first delete existing helm values and then reinstall with the new values, as outlined in this [section](#delete-existing-values-in-order-to-redeploy).
### How to

#### List all helm deployments
Expand Down Expand Up @@ -110,3 +116,19 @@ _You can replace `deploy/x` with for example `pods/y` from the get all command a
kubectl --context arn:aws:eks:eu-west-2:720541322708:cluster/prod-cht-eks \
--namespace users-chis-prod describe deploy/$EKS-DEPLOYMENT
```

#### Delete existing values in order to redeploy

1. Delete existing values if encountering issues
```shell
helm --namespace users-chis-prod users-chis-prod delete $CONFIG
```

2. Reinstall with updated values
```shell
helm install \
--kube-context arn:aws:eks:eu-west-2:720541322708:cluster/prod-cht-eks \
--namespace users-chis-prod \
--values values/$VALUES \
$CONFIG medic/cht-user-management
```

0 comments on commit dc263be

Please sign in to comment.