Skip to content

Commit

Permalink
PMM-7353 Remove secrets.yaml (#452)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

Co-authored-by: PaulJacobs-percona <[email protected]>
  • Loading branch information
BupycHuk and PaulJacobs-percona authored Apr 16, 2021
1 parent f338074 commit f4c4176
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 41 deletions.
46 changes: 6 additions & 40 deletions docs/setting-up/server/dbaas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<RANDOM_PASS_GOES_IN_HERE>';
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:
Expand Down Expand Up @@ -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='<RANDOM_PASS_GOES_IN_HERE>';
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 -
```

```
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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`.)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
[STANDALONE_MYSQL_K8S]: https://medium.com/@chrisedrego/setting-up-a-standalone-mysql-instance-on-kubernetes-exposing-it-using-nginx-ingress-controller-262fc7af593a
4 changes: 3 additions & 1 deletion docs/using/platform/dbaas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit f4c4176

Please sign in to comment.