Using Percona Kubernetes Operators with Percona Monitoring and Management
Percona Monitoring and Management (PMM) provides an excellent solution to monitor both Percona XtraDB Cluster and Percona Server for MongoDB. Currently, there is no Percona-supported deployment model to deploy PMM by Percona Kubernetes Operators. Still, you can try the following experimental approach to use PMM in Kubernetes or OpenShift environment together with the operators for Percona XtraDB Cluster or Percona Server for MongoDB.
Installing the PMM Server
This first thing to do is to install the PMM Server to monitor Percona Server for MongoDB or Percona XtraDB Cluster on Kubernetes or OpenShift. The following three steps are optional if you already have installed the PMM Server. The PMM Server available on your network does not require another installation in Kubernetes!
1. The recommended installation approach is based on using helm – the package manager for Kubernetes, which will substantially simplify further steps. Install helm following its official installation instructions.
2. Using helm, add the Percona chart repository and update the information for the available charts as follows:
$ helm repo add percona https://percona-charts.storage.googleapis.com $ helm repo update
3. Use helm to install PMM Server:
OpenShift command:
$ helm install monitoring percona/pmm-server --set platform=openshift --version 1.17.3 --set "credentials.password=supa|^|pazz"
Kubernetes command:
$ helm install monitoring percona/pmm-server --set platform=kubernetes --version 2.7.0 --set "credentials.password=supa|^|pazz"
Installing the PMM Client
The following steps are needed for the PMM client installation:
1. The PMM client installation is initiated by updating the pmm
section in the deploy/cr.yaml file.
- Set
pmm.enabled=true
. - Ensure the
serverHost
(the PMM service name ismonitoring-service
by default) is the same as the value specified for thename
parameter on the previous step, but with an additional-service
suffix. - Make sure that PMM user name and password are correct.
In case of the Operator for Percona Server for MongoDB:
PMM_SERVER_USER
key in the deploy/secrets.yaml secrets file should be a based64 encoded equivalent of the PMM Server user name (pmm
by default for PMM 1.x andadmin
for PMM 2.x).PMM_SERVER_PASSWORD
key in the deploy/secrets.yaml secrets file should be a base64 encoded equivalent of the value specified for thecredentials.password
parameter on the last PMM Server installation step.
In case of the Operator for Percona XtraDB Cluster:
-
serverUser
key in the deploy/cr.yaml configuration file should match the PMM Server user name (pmm
by default for PMM 1.x andadmin
for PMM 2.x).pmmserver
key in the deploy/secrets.yaml secrets file is a base64 encoded equivalent of the value specified for thecredentials.password
parameter on the last PMM Server installation step.
Apply changes with the kubectl apply -f deploy/secrets.yaml
command, if needed.
When done, apply the edited deploy/cr.yaml
file:
$ kubectl apply -f deploy/cr.yaml
2. Check that correspondent Pods are not in a cycle of stopping and restarting. This cycle occurs if there are errors in the previous steps:
$ kubectl get pods
$ kubectl logs my-cluster-name-rs0-0 -c pmm-client
3. Run the following command:
$ kubectl get service/monitoring-service -o wide
In the results, locate the the EXTERNAL-IP
field. This external IP address can be used to access PMM via https in a web browser, with the login/password authentication, and the PMM Server is already configured to show either Percona Server for MongoDB metrics or Percona XtraDB Cluster metrics, depending on the Operator with which these steps were applied.
by Dmitriy Kostiuk via Percona Database Performance Blog
Comments
Post a Comment