DBaaS¶
Caution
DBaaS functionality is currently in technical preview and is subject to change.
The DBaaS dashboard is where you add, remove, and operate on Kubernetes and database clusters.
Activate DBaaS¶
The DBaaS feature is turned off by default. To turn it on:
-
Go to Configuration → Settings → Advanced Settings.
-
Click the toggle in the Technical preview features section of the page.
Open the DBaaS dashboard¶
From the left menu, select DBaaS.
Kubernetes clusters¶
Add a Kubernetes cluster automatically¶
Availability
Automatic addition of k8s cluster in PMM is available starting with PMM 2.34.0.
In order to simplify DBaaS, k8s clusters can now be automatically added to PMM as follows:
Prerequisites: Helm Chart/Manifest installed
-
Use Helm to install PMM server on Kubernetes clusters. For more information, see documentation.
helm install pmm --set service.type="LoadBalancer" --set image.repository=percona/pmm-server --set image.tag=2.34.0 --set secret.pmm_password=admin percona/pmm
-
Log in to PMM.
-
Enable PMM in DBaaS.
-
You should see the default k8s cluster added in DBaaS.
Add a Kubernetes cluster¶
Caution
Ensure that you set PMM Public Address under Configuration → Settings → Advanced Settings before creating a Kubernetes cluster. Otherwise, PMM would not monitor the Kubernetes cluster along with the associated database clusters.
PXC and PSMDB operators are installed as part of the Kubernetes cluster registration process. It enables you to deploy database clusters into the Kubernetes cluster.
If a public address is set VM Operator is also installed as part of the Kubernetes cluster registration process. It lets you monitor a kubernetes cluster via PMM.
-
Click Register new Kubernetes Cluster.
-
Copy the value of Kubeconfig file and click Paste from clipboard to copy the content of the kubeconfig file in the corresponding field. The value of Kubernetes Cluster Name gets auto-populated from the contents of the kubeconfig file.
Availability
This feature is available starting with PMM 2.30.0.
This feature is available only in secure contexts (HTTPS) and some supporting browsers.
For a Kubernetes cluster, when using Amazon Elastic Kubernetes Service (EKS) and the kubeconfig file does not contain the AWS access key ID and AWS secret access key. Select the Using Amazon Elastic Kubernetes Service (EKS) checkbox and enter the access key ID and secret access key in the respective fields. For information on obtaining these, see the AWS documentation.
-
Click Register.
-
A message will momentarily display telling you whether the registration was successful or not.
Unregister a Kubernetes cluster¶
Important
You can’t unregister a Kubernetes cluster if there DB clusters associated with it.
-
Click Unregister.
-
Confirm the action by clicking Proceed, or abandon by clicking Cancel.
View a Kubernetes cluster’s configuration¶
-
Find the row with the Kubernetes cluster you want to see.
-
In the Actions column, open the menu and click Show configuration.
Manage allowed component versions¶
Administrators can select allowed and default versions of components versions for each cluster.
-
Find the row with the Kubernetes cluster you want to manage.
-
In the Actions column, open the menu and click Manage versions.
-
Select an Operator and Component from the drop-down menus.
-
Activate or deactivate allowed versions, and select a default in the Default menu.
-
Click Save.
Kubernetes operator status¶
The Kubernetes Cluster tab shows the status of operators.
Kubernetes operator update¶
When a new version of the operator is available the Operators column shows a message with this information. Click the message to go to the operator release notes to find out more about the update.
To update the cluster:
-
Find the row with the operator you want to update.
-
Click the Update button in front of the operator.
-
Confirm the action by clicking Update, or abandon by clicking Cancel.
DB clusters¶
Add a DB Cluster¶
You must create at least one Kubernetes cluster to create a DB cluster.
To monitor a DB cluster, set up a public address for PMM Server first.
You can create a DB cluster literally at the click of a button. All the fields will be automatically populated with the default values.
To create a DB cluster, do the following:
-
Select the DB Cluster tab.
-
Click Create DB Cluster.
-
From the drop-down menu, select the values for the following:
- Kubernetes Cluster
- Database Type
- Database Version
-
Expand Advanced Settings panel.
-
Select the number of nodes. (The lower limit is 1.)
-
Select a preset Resources per Node.
Small, Medium and Large are fixed preset values for Memory, CPU, and Disk.
Values for the Custom preset can be edited.
Beside each resource type is an estimate of the required and available resources represented numerically in absolute and percentage values, and graphically as a colored, segmented bar showing the projected ratio of used to available resources. A red warning triangle is shown if the requested resources exceed those available.
-
Enter the following on the Database Configurations panel:
-
Storage Class - Select the storage class from the drop-down. Storage classes allow dynamic provisioning of persistent storage for PMM. Using storage classes, you can create and attach volumes on-demand without manually managing the underlying storage infrastructure.
-
Database configuration- Enter the config string into the Configuration text box to configure the database engine.
-
Enter the following on the Network and Security panel:
-
Expose - Select this checkbox to make this DB cluster available outside of the kubernetes cluster.
- Internet Facing - Select this checkbox if you want the cluster to be accessible on the Internet.
- Source Range - For security, you can control the exposure level by providing the IP address in the Source Range field. This allows you to choose the IP addresses that can access your DB cluster. To add more than one source range, click Add New.
-
-
Click Create Cluster to create your cluster.
-
A row appears with information on your cluster:
- Name: The cluster name.
- Database: The cluster database type and version.
- Connection:
- Host: The hostname.
- Port: The port number.
- Username: The connection username.
- Password: The connection password (click the eye icon to reveal).
- DB Cluster Parameters:
- K8s cluster name: The Kubernetes cluster name.
- CPU: The number of CPUs allocated to the cluster.
- Memory: The amount of memory allocated to the cluster.
- Disk: The amount of disk space allocated to the cluster.
- Cluster Status:
- PENDING: The cluster is being created.
- ACTIVE: The cluster is active.
- FAILED: The cluster could not be created.
- DELETING: The cluster is being deleted.
- UPDATING: The cluster is being updated.
Delete a DB Cluster¶
-
Find the row with the database cluster you want to delete.
-
In the Actions column, open the menu and click Delete.
-
Confirm the action by clicking Proceed, or abandon by clicking Cancel.
Danger
Deleting a cluster in this way also deletes any attached volumes.
Edit a DB Cluster¶
-
Select the DB Cluster tab.
-
Find the row with the database cluster you want to change.
-
In the Actions column, open the menu and click Edit.
A paused cluster can’t be edited.
Restart a DB Cluster¶
-
Select the DB Cluster tab.
-
Identify the database cluster to be changed.
-
In the Actions column, open the menu and click Restart.
Suspend or resume a DB Cluster¶
-
Select the DB Cluster tab.
-
Identify the DB cluster to suspend or resume.
-
In the Actions column, open the menu and click the required action:
-
For active clusters, click Suspend.
-
For paused clusters, click Resume.
-
Update a DB Cluster¶
-
Select the DB Cluster tab.
-
Identify the DB cluster to update.
-
In the Actions column, open the menu and click Update:
-
Confirm the update by clicking on Update, or abandon by clicking Cancel.