-
Notifications
You must be signed in to change notification settings - Fork 4
Making Grafana Changes
- Building and running grafana
- Upgrading the grafana version
- Pushing an image
- Deploying in a test environment
Yes, but I don't need to know the details. Use our own grafana build script. This build process clones a fresh grafana repo, checks out the configured branch (subject to change), symlinks the gopath, and builds a new docker image.
Yes, and I want to know more. At the top there is a link to a blog post that expands on this guide as well.
If you're updating the version of Grafana we're using, it's best to fork off of a stable grafana release rather than off of master. Pick a release by looking at the tags on the repo; do not use a beta tag.
Assume you're forking off of grafana version x.y.z.
- Clone Psiphon-Inc/grafana.
- Create a new branch tagged with the grafana version you'll be working off of (i.e. "x.y.z-psiphon").
- Set the remote upstream repo to the grafana version from grafana/grafana.
- Sync your fork with upstream grafana. Make sure you're synching with version x.y.z.
- Build and run your grafana fork to make sure you have a known-to-work version on the repo.
- Make changes while continuing to ensure your fork is in sync with upstream.
Running make build-docker-full
will create a new docker image for the grafana built on your machine (either manually or from the build script). Run the following to view your available images:
docker images
Your fresh grafana image should be in the repo "grafana/grafana" with the tag "dev". Tag and push the image:
docker tag grafana/grafana:dev ${DOCKER_REGISTRY_URL}/${IMAGE_PATH}:${BRANCH}
docker push ${DOCKER_REGISTRY_URL}/${IMAGE_PATH}:${BRANCH}
- Get your kubeconfig from ciphershare
- Put it somewhere local, the usual spot is
~/.kube/config
but anywhere is fine - Run
export KUBECONFIG=/config/file/location
- Clone pde
- Copy https://github.com/Psiphon-Inc/pde/blob/master/grafana/deploy/04-grafana-psix.yml
to a new file (i.e.
xx-grafana-test.yml
) - Edit that new file to point at the image you want to test (~L62) and drop the first init container block (~L24-30) (that is just there for super safety so I don’t accidentally delete the grafana database when restarting pods, in this case the DB will not exist yet because it’s a new deployment, so that init container will throw an error and stop the deployment)
- Edit the “Ingress” spec in that same file to use your test environment instead of
psix.psiphon.io
- Run
kubectl config use-context ${CONTEXT}
- Run
kubectl apply -f xx-grafana-test.yml
- check out your test environment's host, you should be able to login with whatever credentials you use for psix.ca