Kubernets with Prometheus and Grafana on HetznerCloud

Table of Contents

Let’s get started

First, you will need an account at https://www.hetzner.com/cloud. Thereafter you have to create a Project via “Add Project” inside the CloudConsole we will name it demo. Then you need to create an API-Token through “Access” > “API-Tokens” > “Generate API Token”, store it somewhere safe, as it’s only displayed once.

hetzner-cube configuration

Now let’s configure the hetzner-cube cli (currently you need go installed to use it).

  • demo-master-01
  • demo-worker-01

deploying the dashboard

Since the cluster is up and running and our local kubectl is running we can deploy the kubernets-dashboard to see what's going on. If you don’t need the dashboard you can skip to the next step. (Based on this GitHub issue, thanks to radutopala)

deploying rook for storage

To deploy the rook storage we can use hetzner-cube again:

deploying prometheus

Of course, kubernetes has its own package-manager called helm. So it’s pretty straight forward to deploy prometheus. First, install the helm-addon:

deploying grafana

To our luck, there is also a chart for grafana. And again we are going to edit the “values.yaml” file:

configuring grafana

In the dashboard go to “Add data source” and enter the following:

importing the default prometheus dashboard

Select the freshly created Kubernetes Datasource and go to the “Dashboard”-Tab. Click on Import on the desired dashboards (ex. “Prometheus 2.0 Stats”). If you go back to the Dashboards-Site and click on the dropdown labeled “Home” you can now select “Prometheus 2.0 Stats”. This dashboard shows stats about prometheus itself, we want to see the kubernetes metrics.

finally

While I was writing this the cluster costs me about 0,03 EUR. Thanks for reading and till next time!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Philipp Haidenbauer

Philipp Haidenbauer

WebDev & DevOp, Paramedic, Cryptocurrency Enthusiast and YouTuber