From f4c41768281eec62d3a478350ee43668cdd603cc Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Fri, 16 Apr 2021 08:34:58 +0300 Subject: [PATCH] PMM-7353 Remove secrets.yaml (#452) * PMM-7353 Remove secrets.yaml * PMM-7353 Mention that PMM creates API keys. * Update dbaas.md * Update docs/setting-up/server/dbaas.md Co-authored-by: PaulJacobs-percona <63049452+PaulJacobs-percona@users.noreply.github.com> Co-authored-by: PaulJacobs-percona <63049452+PaulJacobs-percona@users.noreply.github.com> --- docs/setting-up/server/dbaas.md | 46 +++++---------------------------- docs/using/platform/dbaas.md | 4 ++- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/docs/setting-up/server/dbaas.md b/docs/setting-up/server/dbaas.md index e8cf4c230c..51a2db5b3a 100644 --- a/docs/setting-up/server/dbaas.md +++ b/docs/setting-up/server/dbaas.md @@ -80,26 +80,13 @@ alias kubectl='minikube kubectl --' 2. Deploy the Percona operators configuration for PXC and PSMDB in minikube: ```sh - # Prepare a set of base64 encoded values and non encoded for user and pass with administrator privileges to pmm-server (DBaaS) - PMM_USER='admin'; - PMM_PASS=''; - - PMM_USER_B64="$(echo -n "${PMM_USER}" | base64)"; - PMM_PASS_B64="$(echo -n "${PMM_PASS}" | base64)"; - # Install the PXC operator curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-xtradb-cluster-operator/{{op.pxc_vers}}/deploy/bundle.yaml \ | kubectl apply -f - - curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-xtradb-cluster-operator/{{op.pxc_vers}}/deploy/secrets.yaml \ - | sed "s/pmmserver:.*/pmmserver: ${PMM_PASS}/g" \ - | kubectl apply -f - # Install the PSMDB operator curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/{{op.psmdb_vers}}/deploy/bundle.yaml \ | kubectl apply -f - - curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/{{op.psmdb_vers}}/deploy/secrets.yaml \ - | sed "s/PMM_SERVER_USER:.*$/PMM_SERVER_USER: ${PMM_USER}/g;s/PMM_SERVER_PASSWORD:.*$/PMM_SERVER_PASSWORD: ${PMM_PASS}/g;" \ - | kubectl apply -f - ``` 3. Check the operators are deployed: @@ -129,26 +116,13 @@ alias kubectl='minikube kubectl --' 2. When your EKS cluster is running, install the PXC and PSMDB operators: ```sh - # Prepare a set of base64 encoded values and non encoded for user and pass with administrator privileges to pmm-server (DBaaS) - PMM_USER='admin'; - PMM_PASS=''; - - PMM_USER_B64="$(echo -n "${PMM_USER}" | base64)"; - PMM_PASS_B64="$(echo -n "${PMM_PASS}" | base64)"; - # Install the PXC operator curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-xtradb-cluster-operator/{{op.pxc_vers}}/deploy/bundle.yaml \ | kubectl apply -f - - curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-xtradb-cluster-operator/{{op.pxc_vers}}/deploy/secrets.yaml \ - | sed "s/pmmserver:.*/pmmserver: ${PMM_PASS}/g" \ - | kubectl apply -f - # Install the PSMDB operator curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/{{op.psmdb_vers}}/deploy/bundle.yaml \ | kubectl apply -f - - curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/{{op.psmdb_vers}}/deploy/secrets.yaml \ - | sed "s/PMM_SERVER_USER:.*$/PMM_SERVER_USER: ${PMM_USER}/g;s/PMM_SERVER_PASSWORD:.*$/PMM_SERVER_PASSWORD: ${PMM_PASS}/g;" \ - | kubectl apply -f - ``` ``` @@ -269,10 +243,8 @@ You should have an account on GCP [https://cloud.google.com/](https://cloud.goog 9. Set up PXC and PSMDB operators: ``` - curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-xtradb-cluster-operator/pmm-branch/deploy/bundle.yaml | kubectl apply -f - - curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-xtradb-cluster-operator/pmm-branch/deploy/secrets.yaml | kubectl apply -f - - curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/pmm-branch/deploy/bundle.yaml | kubectl apply -f - - curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/pmm-branch/deploy/secrets.yaml | kubectl apply -f - + curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-xtradb-cluster-operator/{{op.pxc_vers}}/deploy/bundle.yaml | kubectl apply -f - + curl -sSf -m 30 https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/{{op.psmdb_vers}}/deploy/bundle.yaml | kubectl apply -f - ``` ![](../../_images/PMM_DBaaS_GKE_11.png) @@ -395,17 +367,13 @@ The install script: #!/bin/bash TOP_DIR=$(git rev-parse --show-toplevel) -PMM_USER="$(echo -n 'admin' | base64)"; -PMM_PASS="$(echo -n 'admin_password' | base64)"; KUBECTL_CMD="kubectl --kubeconfig ${HOME}/.kube/config_eks" # Install the PXC operator cat ${TOP_DIR}/deploy/pxc_operator.yaml | ${KUBECTL_CMD} apply -f - -cat ${TOP_DIR}/deploy/secrets.yaml | sed "s/pmmserver:.*=/pmmserver: ${PMM_PASS}/g" | ${KUBECTL_CMD} apply -f - # Install the PSMDB operator cat ${TOP_DIR}/deploy/psmdb_operator.yaml | ${KUBECTL_CMD} apply -f - -cat ${TOP_DIR}/deploy/secrets.yaml | sed "s/PMM_SERVER_USER:.*$/PMM_SERVER_USER: ${PMM_USER}/g;s/PMM_SERVER_PASSWORD:.*=$/PMM_SERVER_PASSWORD: ${PMM_PASS}/g;" | ${KUBECTL_CMD} apply -f - ``` The delete script: @@ -414,17 +382,15 @@ The delete script: #!/bin/bash TOP_DIR=$(git rev-parse --show-toplevel) -PMM_USER="$(echo -n 'admin' | base64)"; -PMM_PASS="$(echo -n 'admin_password' | base64)"; KUBECTL_CMD="kubectl --kubeconfig ${HOME}/.kube/config_eks" # Delete the PXC operator cat ${TOP_DIR}/deploy/pxc_operator.yaml | ${KUBECTL_CMD} delete -f - -cat ${TOP_DIR}/deploy/secrets.yaml | sed "s/pmmserver:.*=/pmmserver: ${PMM_PASS}/g" | ${KUBECTL_CMD} delete -f - +kubectl delete secret my-cluster-secrets # Delete the PSMDB operator cat ${TOP_DIR}/deploy/psmdb_operator.yaml | ${KUBECTL_CMD} delete -f - -cat ${TOP_DIR}/deploy/secrets.yaml | sed "s/PMM_SERVER_USER:.*$/PMM_SERVER_USER: ${PMM_USER}/g;s/PMM_SERVER_PASSWORD:.*=$/PMM_SERVER_PASSWORD: ${PMM_PASS}/g;" | ${KUBECTL_CMD} delete -f - +kubectl delete secret my-cluster-name-secrets ``` (Both scripts are similar except the install script command is `apply` while in the delete script it is `delete`.) @@ -453,7 +419,7 @@ eksctl delete cluster --name=your-cluster-name ## Run PMM Server as a Docker container for DBaaS -1. Start PMM server from a feature branch: +1. Start PMM Server with DBaaS enabled: ```sh docker run --detach --name pmm-server --publish 80:80 --publish 443:443 --env PERCONA_TEST_DBAAS=1 percona/pmm-server:2; @@ -509,4 +475,4 @@ kubectl expose deployment hello-world --type=NodePort. [ALPHA]: https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha [GOOGLE_EXPOSING_APPS]: https://cloud.google.com/kubernetes-engine/docs/how-to/exposing-apps [KUBERNETES_ACCESS_APP]: https://kubernetes.io/docs/tasks/access-application-cluster/service-access-application-cluster/ -[STANDALONE_MYSQL_K8S]: https://medium.com/@chrisedrego/setting-up-a-standalone-mysql-instance-on-kubernetes-exposing-it-using-nginx-ingress-controller-262fc7af593a \ No newline at end of file +[STANDALONE_MYSQL_K8S]: https://medium.com/@chrisedrego/setting-up-a-standalone-mysql-instance-on-kubernetes-exposing-it-using-nginx-ingress-controller-262fc7af593a diff --git a/docs/using/platform/dbaas.md b/docs/using/platform/dbaas.md index 006cb1d0a2..8c2f88b0f8 100644 --- a/docs/using/platform/dbaas.md +++ b/docs/using/platform/dbaas.md @@ -75,7 +75,9 @@ The Kubernetes Cluster tab shows the status of operators. You must create at least one Kubernetes cluster to create a DB cluster. -To monitor a DB cluster, set up a [public address](../../how-to/configure.md#public-address) for PMM Server first. +To monitor a DB cluster, set up a [public address](../../how-to/configure.md#public-address) for PMM Server first. + +PMM will create a separate API Key for each DB Cluster to monitor it. 1. Select the *DB Cluster* tab.