Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deploy readme and users-chis-{ke,ug} values #1

Merged
merged 6 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions scripts/deploy/medic-deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
## Medic Deployment

mrjones-plip marked this conversation as resolved.
Show resolved Hide resolved
| Key | Value |
|-----------|---------------------------------------------------------|
| context | arn:aws:eks:eu-west-2:720541322708:cluster/prod-cht-eks |
| namespace | users-chis-prod |

### Requirements:
1. Applications:
- [Helm](https://helm.sh/)
- [Kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/)

2. [Add medic helm chart repository](https://github.com/medic/helm-charts/tree/main#usage)

3. [Authenticate to Medic kubernetes cluster (EKS)](https://github.com/medic/medic-infrastructure/blob/master/terraform/aws/dev/eks/access/README.md)
mrjones-plip marked this conversation as resolved.
Show resolved Hide resolved


### Deploy new version

mrjones-plip marked this conversation as resolved.
Show resolved Hide resolved
#### KE
```shell
# Edit tag in users-chis-ke.yaml and then run:

helm upgrade \
--kube-context arn:aws:eks:eu-west-2:720541322708:cluster/prod-cht-eks \
--namespace users-chis-prod \
--values values/users-chis-ke.yaml \
users-chis-ke medic/cht-user-management
mrjones-plip marked this conversation as resolved.
Show resolved Hide resolved
```
#### UG
```shell
# Edit tag in users-chis-ug.yaml and then run:

helm upgrade \
--kube-context arn:aws:eks:eu-west-2:720541322708:cluster/prod-cht-eks \
--namespace users-chis-prod \
--values values/users-chis-ug.yaml \
users-chis-ug medic/cht-user-management
```
### How to

#### List all helm deployments
```shell
helm --kube-context $context --namespace $namespace list --all
```

#### Check history of a deployment
```shell
helm --kube-context $context --namespace $namespace history $deployment_name
```
_You can get `deployment_name` from the helm list command above_

#### Get current configuration of a deployment
```shell
helm --kube-context $context --namespace $namespace get values $deployment_name
```

#### List all resources in a namespace
```shell
kubectl --context $context --namespace $namespace get all
```

#### View logs of a deployment
```shell
kubectl --context $context --namespace $namespace logs deploy/users-chis-ke-cht-user-management
# or
kubectl --context $context --namespace $namespace logs deploy/users-chis-ug-cht-user-management
```
_You can replace `deploy/x` with for example `pods/y` from the get all command above_

#### Get more details of a deployment
```shell
kubectl --context $context --namespace $namespace describe deploy/users-chis-ke-cht-user-management
# or
kubectl --context $context --namespace $namespace describe deploy/users-chis-ug-cht-user-management
```
25 changes: 25 additions & 0 deletions scripts/deploy/values/users-chis-ke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cht-user-management:
image:
tag: 0.0.1
mrjones-plip marked this conversation as resolved.
Show resolved Hide resolved
env:
CONFIG_NAME: chis-ke

# EKS prod ELB
ingress:
enabled: true
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=prod,Team=SRE
alb.ingress.kubernetes.io/group.name: prod-cht-alb
alb.ingress.kubernetes.io/ssl-redirect: '443'
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-port: traffic-port
alb.ingress.kubernetes.io/certificate-arn: arn:aws:iam::720541322708:server-certificate/2023-wildcard-app-medicmobile-org-chain
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'

className: alb
hosts:
- host: users-chis-ke.app.medicmobile.org
paths:
- path: /
pathType: Prefix
25 changes: 25 additions & 0 deletions scripts/deploy/values/users-chis-ug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cht-user-management:
image:
tag: 0.0.1
mrjones-plip marked this conversation as resolved.
Show resolved Hide resolved
env:
CONFIG_NAME: chis-ug

# EKS prod ELB
ingress:
enabled: true
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=prod,Team=SRE
alb.ingress.kubernetes.io/group.name: prod-cht-alb
alb.ingress.kubernetes.io/ssl-redirect: '443'
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-port: traffic-port
alb.ingress.kubernetes.io/certificate-arn: arn:aws:iam::720541322708:server-certificate/2023-wildcard-app-medicmobile-org-chain
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'

className: alb
hosts:
- host: users-chis-ug.app.medicmobile.org
paths:
- path: /
pathType: Prefix