Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. Start by locating the Grafana pod within the kube-prometheus-stack namespace:
kubectl get pods -n kube-prometheus-stack | grep grafana
  1. Once you have the name of the Grafana pod (it should start with grafana-xxxxxx-xxxxx), use the following command to enter the pod:
kubectl exec -it <pod-name> -n kube-prometheus-stack sh

Replace <pod-name> with the name of the Grafana pod you found in step 1.

  1. Once you're inside the Grafana pod, navigate to the /etc/grafana directory where the grafana.ini file is located:
cd /etc/grafana
  1. You can now use any text editor (e.g. vi or nano) to modify the grafana.ini file:
vi grafana.ini
  1. Make the necessary modifications to the file and save your changes.

  2. Exit the Grafana pod:

exit
  1. Finally, restart the Grafana pod to apply the changes you made to the grafana.ini configuration file:
kubectl delete pod <pod-name> -n kube-prometheus-stack

Replace <pod-name> with the name of the Grafana pod you found in step 1.

The pod will automatically be restarted with the new configuration settings applied.