Now let's also deploy Grafana to our Kubernetes cluster, so that we can manage this tool the same way as all the other components of our distributed application. As the tool that allows us to create dashboards for monitoring the application, Grafana can be considered mission-critical and thus warrants this treatment.
Deploying Grafana to the cluster is pretty straightforward. Let's do it as follows:
- Add a new file called grafana.yaml to the ch17/kube folder.
- To this file, add the definition for a Kubernetes Deployment for Grafana:
apiVersion: apps/v1kind: Deploymentmetadata: name: grafana-deployment labels: app: grafana purpose: monitoring-demospec: replicas: 1 selector: matchLabels: app: grafana purpose: ...