11.5 Adding the NodePort for Grafana
- Edit the grafana service to add the
NodePort:
For example:kubectl edit service/<deployment_name>-grafana -n <namespace>kubectl edit service/monitoring-grafana -n monitoringNote:
This opens an edit session for the domain where parameters can be changed using standard vi commands. - Change the ports entry and add
nodePort: 30091andtype: NodePort:ports: - name: http-web nodePort: 30091 port: 80 protocol: TCP targetPort: 3000 selector: app.kubernetes.io/instance: monitoring app.kubernetes.io/name: grafana sessionAffinity: None type: NodePort - Save the file and exit (
:wq).