Helm Chart Grafana Bitnami
Login to the Master Node/Server
ssh nickm@10.154.2.90
sudo su -
cd /root/k3s/k3s-helm-charts/grafana/
If you have not installed Helm 3.11 yet do this:
Installing Helm 3.11 on a Linux Server
1. When working with K3S you need to run this command
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
1.1 You can edit the .bashrc file put this on the top
nano ~/.bashrc
Reboot the server
sudo reboot
2. Find the Helm Chart in the Repository
You can search for Helm Charts here:
https://artifacthub.io/
3. Search for Grafana (prefer a Bitnami Repository if found)
Searching for grafana brings you here:
This one uses the Bitnami Repository Maintained by (Novel) VMware
https://artifacthub.io/packages/helm/bitnami/grafana \
4. Adding the Repiository locally (Bitnami)
- Click on the Install Button
- Copy the command under “Add Repository” section Expect to get
helm repo add bitnami https://charts.bitnami.com/bitnami
run the above command on the server
- close the Pop Up that was launched when you pressed the Install Button
5. Creating the Values Yaml file
- Click on the Default Values Button
- Click on the button with a icon of a Cloud It will try to download the folowing file:
values-grafana.yaml
- copy this file name and create a file on the server with that file name
nano values-grafana.yaml
- close the download Pop Up by pressing the Cancel Button
- Click on the button with an icon with two squares
- this will copy the content of the Yaml file to your clipboard
- paste this content into your text editor and save it
- In the browser click the close Button
6. Create the namespace
run these commands
kubectl get namespaces
kubectl create namespace nico-grafana
kubectl get namespaces
7. Get the Helm Chart Install command
- Click on the Install Button
- Copy the command under “Install chart” section Expect to get
helm install my-grafana bitnami/grafana --version 8.2.33
7. Testing the Helm Chart
Test 1
- Take the above command and change the word install to template you should now have
helm template my-grafana-release bitnami/grafana --version 8.2.33
Now run the above command and expect to not have errors
Test 2
- add the following to the end of the above command: -f values-grafana.yaml
- you should now have
helm template my-grafana-release bitnami/grafana --version 8.2.33 -f values-grafana.yaml
run the above command and expect to not have errors
8. Installing the Helm Chart (Deploying)
- take the above command change the word template to install and add the folowing to the end : –namespace nico-grafana
- you should nw have:
helm install my-grafana-release bitnami/grafana --version 8.2.33 -f values-grafana.yaml --namespace nico-grafana
- run the above command
9. Verifying the deployment
- run this command:
helm list -n nico-grafana
helm list --all-namespaces
- run this command
kubectl get all -o wide -n nico-grafana
10. Updating the values yaml file
Whenever you need to make changes to your deployment
- run this command and make your changes
nano values-grafana.yaml
10.1 Test your changes
- Run this command:
helm template my-grafana-release bitnami/grafana --version 8.2.33 -f values-grafana.yaml
10.2 Upgrade your Helm Chart to implement these Updates
- Run this command:
helm upgrade my-grafana-release bitnami/grafana --version 8.2.33 -f values-grafana.yaml --namespace nico-grafana
10.3 Verifying the deployment
- run this command:
helm list -n nico-grafana
# display the history for release = nginx-release
helm history my-grafana-release -n nico-grafana
- run this command
kubectl get all -o wide -n nico-grafana
11. Rollong back a failed change
# display the history for release = nginx-release
helm history my-grafana-release -n nico-grafana
# Rollback to Revision 1
helm rollback my-grafana-release 1 -n nico-grafana
helm history my-grafana-release -n nico-grafana
12. The Cleanup
run these commands
helm delete my-grafana-release -n nico-grafana
helm list --all-namespaces
kubectl delete namespace nico-grafana
helm list --all-namespaces
kubectl get all --all-namespaces