top of page

Adding SSL to Grafana and Accessing It from Anywhere - Kubernetes

Because of Grafana's dashboard tool, it will be useful to access from anywhere. If you access it locally, it is easy to do a port forwarding to localhost and then access it locally. However, what if you want to access it from outside the firewall? In this case, you may want to add SSL certificate to the Grafana's external address so that the connection is secure. I will explain how do add SSL to Grafana. Basically, you will need to create a secret and add it to the ingress controller so that the controller can securely implement SSL.

 

Prerequisites


- Kubernetes environment

- Install kubernetes-helm

- SSL Certificate files

  • .crt & .key files

  • If you only have .pfx file and its password, you can easily find tools on the internet to generate .crt & .key files

- DNS URL address for Grafana to use

- Have the following installed already

  • nginx ingress controller

  • Prometheus

  • Grafana

 

1. Create SSL Secret

You will generate an SSL secret using .crt & .key files. Also it will create the secret in the namespace called "default".


2. Change Configuration of nginx ingress controller

Open deployment yaml file for nginx ingress controller. Every eco-system has different ways to open the yaml file so you must find a way to do it on your system. The screen below shows an example in Azure AKS.


image
Locating ingress-nginx-controller in Azure AKS
image
Locating YAML file for the ingress-nginx-controller in AKS


In the YAML file, you will add two lines of codes below on the section, spec > template > spec > containers > arg. This will add the secret you created earlier to the ingress-nginx-controller.


image
Locating the correct section to add SSL secret


3. Create an Ingress

Ingress assumes role in managing the rules of the ingress controller. Below is a YAML code to generate a new ingress.


 

Once all done, you will be able to access Grafana using the DNS URL address you specified in the YAML file, with SSL.

Comments


pngegg (11)_result.webp

<Raank:랑크 /> 구독 하기 : Subscribe

감사합니다! : Thanks for submitting!

bottom of page