oncall-engine/helm
Andre Buryndin ab561db8a7
Fixing helm hooks for install stage (#3136)
# What this PR does

## Issue

At the first run (`helm install ...`) the migration job cannot start the
container because cannot find Postgres/Redis/MySQL credentials and
ServiceAccount.

Workaround: set `.migrate.useHook` value to `false` for the `install`
stage, and after you can switch back to `true`.

This PR completely resolves this issue.

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated (doesn't
violate anything)
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
- [x] It is manually tested in the internal environment

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Joey Orlando <joseph.t.orlando@gmail.com>
2023-11-21 12:21:33 -05:00
..
oncall Fixing helm hooks for install stage (#3136) 2023-11-21 12:21:33 -05:00
cr.yaml configure yamllint pre-commit step (#2728) 2023-08-03 02:35:08 -04:00
ct.yaml configure yamllint pre-commit step (#2728) 2023-08-03 02:35:08 -04:00
kind.yml Update helm chart to detach integrations pod (#3204) 2023-11-03 12:34:22 +00:00
local_image.yml Add missing referenced local_image.yml for local helm setup (#3268) 2023-11-03 15:30:51 +00:00
README.md Update helm chart to detach integrations pod (#3204) 2023-11-03 12:34:22 +00:00
simple.yml Update helm chart to detach integrations pod (#3204) 2023-11-03 12:34:22 +00:00

How to run the chart locally

  1. Create the cluster with kind

    Make sure ports 30001, 30002 (Grafana, optional) and 30003 (detached integrations server, optional) are free on your machine

    kind create cluster --image kindest/node:v1.24.7 --config kind.yml
    
  2. (Optional) Build oncall image locally and load it to kind cluster

       docker build ../engine -t oncall/engine:latest --target dev
       kind load docker-image oncall/engine:latest
    

    Also make sure to add the following lines to your simple.yml (you may also need to enable devMode):

    image:
      repository: oncall/engine
      tag: latest
      pullPolicy: IfNotPresent
    oncall:
      devMode: true
    

    Alternatively you can also pass an extra --values ./local_image.yml in the command below.

  3. Install the helm chart

       helm install helm-testing \
       --wait \
       --values ./simple.yml \
       ./oncall
    
  4. Get credentials

    echo "\n\nOpen Grafana on localhost:30002 with credentials - user: admin, password: $(kubectl get secret --namespace default helm-testing-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo)"
    echo "Open Plugins -> Grafana OnCall -> fill form: backend url: http://host.docker.internal:30001"
    
  5. Clean up If you happen to helm uninstall helm-testing be sure to delete all the Persistent Volume Claims, as Postgres stores the auto-generated password on disk, and the next helm install will fail.

    kubectl delete pvc --all
    kubectl delete pv --all
    

    This, of course, will delete all the PVs and PVCs also :-)

    kind delete cluster