VK Cloud logo

Kube Prometheus Stack

Before you begin

  1. Review the system requirements of the add-on to make sure you have enough resources to install it.
  2. (Optional) Perform manual scaling of worker node groups or set up automatic scaling.

Installing add-on

Several installation options are available for the add-on.

  1. Install the add-on:

    1. Go to your VK Cloud management console.

    2. Select the project where the required cluster is located.

    3. Go to Kubernetes Clusters → Kubernetes Clusters.

    4. Click the name of the required cluster.

    5. Go to the Addons tab.

    6. Click the Install button on the kube-prometheus-stack add-on card, then click Install addon.

    7. (Optional) Edit:

      • application name;

      • the name of the namespace where the add-on will be installed;

      • add-on settings code.

    8. Click the Install addon button.

      The installation of the add-on in the cluster will begin. This process can take a long time.

  2. If necessary, change the Prometheus disk size.

  3. If necessary, get the password for Grafana from the Kubernetes secret.

  4. If necessary, in your browser, connect to the Grafana web interface included in the Kube Prometheus Stack addon.

Editing add-on settings code during installation

Setting temporary password for Grafana web interface

When installing an add-on with default parameters, a Kubernetes secret will be created containing a permanent password to sign in to the Grafana web interface.

Also, when installing the add-on, you can specify a temporary user password. In this case, the first authorization to the Grafana web interface is performed with this password, then you will be prompted to change it. To do this, change the value of the field in the add-on settings code:

grafana:  adminPassword: "<temporary user password>"

Once done with editing the add-on code, continue with the installation process.

Changing Prometheus disk size

This operation is available if the monitoring add-on kube-prometheus-stack is installed in the cluster.

The Prometheus disk stores cluster monitoring data. If there is not enough space for them, or you want to increase the performance of the Prometheus disk, increase the disk size.

  1. Go to your VK Cloud management console.
  2. Select the project where the required cluster is located.
  3. Go to Kubernetes Clusters → Kubernetes Clusters.
  4. Click the name of the required cluster.
  5. Go to the Addons tab.
  6. Click  for the kube-prometheus-stack add-on and select Change Prometheus disk size.
  7. Set the required disk size. The operation works only in the direction of increase.
  8. Click the Confirm button.

Getting Grafana password from Kubernetes secret

If the add-on was installed without specifying a temporary password, the password value for entering the Grafana web interface can be obtained from the Kubernetes secret.

{tab(kubectl)}

  1. Make sure that you can connect to the cluster using kubectl.

  2. Get the password to sign in to Grafana from the Kubernetes secret:

    $ENCODED = kubectl -n prometheus-monitoring get secret kube-prometheus-stack-grafana -o jsonpath='{.data.admin-password}'; `[System.Text.Encoding]::Utf8.GetString([System.Convert]::FromBase64String($ENCODED)) | Write-Output

Resetting Grafana password

If the add-on was installed without specifying a temporary password, the password value for entering the Grafana web interface can be obtained from the Kubernetes secret. If this secret has been lost, you can reset the password to access Grafana again.

  1. Get the name of the Grafana pod:

    kubectl -n prometheus-monitoring get pod -l app.kubernetes.io/name=grafana

    The format of the pod name from the command output:

    kube-prometheus-stack-grafana-XXXXXXXXX-XXXXX
  2. Reset the password by executing the command inside the Grafana pod:

    kubectl -n prometheus-monitoring exec <Grafana pod name> -- sh -c "grafana cli --debug admin reset-admin-password <new password>"

    If the password is successfully reset, the command output will contain the following message: Admin password changed successfully ✔.

Was this article helpful?