oneuptime/Devops/docs/helm-ops.md

118 lines
2.6 KiB
Markdown
Raw Normal View History

2021-06-28 19:19:56 +00:00
# Important helm commands.
Please run these commands from `root`
2021-09-01 09:59:12 +00:00
Make sure to use the right kubernetes context before making any changes
```
kubectl config get-contexts
# replace NAME with the context name
kubectl config use-context NAME
```
2021-06-28 19:19:56 +00:00
### Lint chart
```
2022-04-11 13:11:16 +00:00
helm lint ./HelmChart/public/oneuptime
2021-06-28 19:19:56 +00:00
```
### Install as an Enterprise Cluster with default values
```
2022-04-11 13:11:16 +00:00
helm install fi ./HelmChart/public/oneuptime --namespace default
2021-06-28 19:19:56 +00:00
```
### Install on staging
```
2022-04-11 13:11:16 +00:00
helm install -f ./HelmChart/public/oneuptime/values.yaml -f ./kubernetes/values-saas-staging.yaml fi ./HelmChart/public/oneuptime --namespace default
2021-06-28 19:19:56 +00:00
```
### Install on production
```
2022-12-31 08:39:55 +00:00
helm install -f ./HelmChart/public/oneuptime/values.yaml -f ./Kubernetes/values-saas-production.yaml fi ./HelmChart/public/oneuptime --namespace default
2021-06-28 19:19:56 +00:00
```
### Update Cluster
Staging:
```
2022-01-28 22:34:06 +00:00
kubectl config use-context arn:aws:eks:us-east-2:972164494713:cluster/oneuptime-staging
2022-04-11 13:11:16 +00:00
helm upgrade -f ./HelmChart/public/oneuptime/values.yaml -f ./kubernetes/values-saas-staging.yaml fi ./HelmChart/public/oneuptime
2021-06-28 19:19:56 +00:00
```
Use default values first and then use staging values.
Production:
```
kubectl config use-context arn:aws:eks:us-east-2:972164494713:cluster/oneuptime-production
2022-12-31 09:13:30 +00:00
helm upgrade -f ./HelmChart/public/oneuptime/values.yaml -f ./Kubernetes/values-saas-production.yaml fi ./HelmChart/public/oneuptime
2021-06-28 19:19:56 +00:00
```
Use default values first and then use production values.
If you introduce values, you can set
```
2022-04-11 13:11:16 +00:00
helm upgrade --reuse-values --set key=value fi ./HelmChart/public/oneuptime
2021-06-28 19:19:56 +00:00
```
### Uninstall
```
helm uninstall fi --namespace=default
```
### Docker build and push to docker repo with `:test` tag
Build and deploy all (with master tag, you can use any other tag):
```
2021-08-08 12:24:38 +00:00
chmod +x ./ci/scripts/docker-build-all-and-push.sh
sudo ./ci/scripts/docker-build-all-and-push.sh latest
2021-06-28 19:19:56 +00:00
```
Build and deploy one:
```
2021-08-08 12:24:38 +00:00
chmod +x ./ci/scripts/docker-build-and-push.sh
sudo ./ci/scripts/docker-build-and-push.sh $repo $tag
2021-06-28 19:19:56 +00:00
```
### Package and deploy helm chart
```
2022-04-11 13:11:16 +00:00
cd ./HelmChart/public
helm repo index ./oneuptime
helm package ./oneuptime
2021-06-28 19:19:56 +00:00
helm repo index .
cd ..
cd ..
```
### Update a chart dependency
```
2022-04-11 13:11:16 +00:00
cd ./HelmChart/public
#IMPORTANT: change the version of the dependent chart at `/HelmChart/public/oneuptime/Chart.yaml`. This should be the version field (and NOT appVersion) in Chart.yaml of the dependency.
2021-06-28 19:19:56 +00:00
# Run this command.
helm dependency update oneuptime
2021-06-28 19:19:56 +00:00
# Go back to root.
cd ..
cd..
```
### Docker Images
2021-11-24 11:37:45 +00:00
Docker Images are hosted at: https://hub.docker.com/orgs/oneuptime/repositories and are public.
2021-06-28 19:19:56 +00:00
### More info
Read readme at [./public/oneuptime/Readme.md](./public/oneuptime/Readme.md)