Kube Prometheus Stack
- Review the system requirements of the add-on to make sure you have enough resources to install it.
- (Optional) Perform manual scaling of worker node groups or set up automatic scaling.
Several installation options are available for the add-on.
-
Install the add-on:
Management console-
Go to your VK Cloud management console.
-
Select the project where the required cluster is located.
-
Go to Kubernetes Clusters → Kubernetes Clusters.
-
Click the name of the required cluster.
-
Go to the Addons tab.
-
Click the Install button on the
kube-prometheus-stackadd-on card, then click Install addon. -
(Optional) Edit:
-
the application name
-
the namespace where to install the add-on
-
the add-on settings code (for example, to set a temporary password for the Grafana web interface)
-
-
Click the Install addon button.
The installation of the add-on in the cluster begins. This process can take a long time.
-
-
(Optional) Change the Prometheus disk size.
-
(Optional) Retrieve the Grafana password from a Kubernetes secret.
-
(Optional) Connect to the Grafana web interface included in the Kube Prometheus Stack addon.
Editing the addon configuration applies to both standard installation and installation on dedicated worker nodes. The full addon configuration along with field descriptions is available on GitHub.
When installing an add-on with default parameters, a Kubernetes secret is 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 are prompted to change it. To do this, change the value of the field in the add-on settings code:
grafana:adminPassword: "<TEMPORARY_PASSWORD>"
This field's value takes effect only during addon installation. If you change it for an already installed addon, the Kubernetes secret is updated, but the Grafana login password does not change: the admin user is stored in Grafana's database on PVC and isn't overwritten during updates. In this case, the password from the secret might not work for login.
To change the password on an already installed addon, set a new password using the reset command or reinstall the addon after deleting the Grafana PVC.
Once done with editing the add-on code, continue with the installation process.
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.
- Go to your VK Cloud management console.
- Select the project where the required cluster is located.
- Go to Kubernetes Clusters → Kubernetes Clusters.
- Click the name of the required cluster.
- Go to the Addons tab.
- Click
for the
kube-prometheus-stackadd-on and select Change Prometheus disk size. - Set the required disk size. The operation works only in the direction of increase.
- Click the Confirm button.
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 the grafana.adminPassword value was changed after installation, the password in the secret might not match the actual login password.
-
Make sure that you can connect to the cluster using
kubectl. -
Find the Grafana secret name:
kubectl -n <NAMESPACE> get secret -l app.kubernetes.io/name=grafanaHere
<NAMESPACE>is the namespace where the addon is installed. By default, it isprometheus-monitoring.The command output contains the Grafana secret name. It is based on the app name, for example
myapp-grafana. If the app name was auto-generated when the addon was installed via the management console, the name looks likeaddon-a0b1c2d3f4-grafana. -
Get the password to sign in to Grafana from the Kubernetes secret using this name:
Windows (PowerShell)Linux (bash)/macOS (zsh)$ENCODED = kubectl -n <NAMESPACE> get secret <GRAFANA_SECRET_NAME> -o jsonpath='{.data.admin-password}'; `[System.Text.Encoding]::Utf8.GetString([System.Convert]::FromBase64String($ENCODED)) | Write-OutputHere:
<NAMESPACE>is the namespace where the addon is installed.<GRAFANA_SECRET_NAME>is the secret name from the output of the previous command.
If the password for the Grafana web interface has been lost or doesn't work (for example, the password in the Kubernetes secret doesn't match the actual password), you can set a new one.
-
Find the Grafana pod name:
kubectl -n <NAMESPACE> get pod -l app.kubernetes.io/name=grafanaHere
<NAMESPACE>is the namespace where the addon is installed. By default, it isprometheus-monitoring. -
Reset the password by running the command inside the Grafana pod:
kubectl -n <NAMESPACE> exec <GRAFANA_POD_NAME> -- sh -c "grafana cli --debug admin reset-admin-password <NEW_PASSWORD>"Here:
<NAMESPACE>is the namespace where the addon is installed.<GRAFANA_POD_NAME>is the pod name from the output of the previous command.<NEW_PASSWORD>is the new password to sign in to Grafana.
If the password is successfully reset, the command output contains the message
Admin password changed successfully ✔.
This method allows setting the Grafana password via the grafana.adminPassword field in the addon configuration.
-
Delete the
kube-prometheus-stackaddon. -
Check if the Grafana PVC still exists:
kubectl -n <NAMESPACE> get pvc -l app.kubernetes.io/name=grafanaHere
<NAMESPACE>is the namespace where the addon was installed. By default, it isprometheus-monitoring. -
If the PVC remains, delete it:
kubectl -n <NAMESPACE> delete pvc <GRAFANA_PVC_NAME>Here:
<NAMESPACE>is the namespace where the addon was installed.<GRAFANA_PVC_NAME>is the PVC name from the output of the previous command.
-
Reinstall the addon and set the desired password in the configuration.