Skip to content

Commit

Permalink
Merge pull request percona#160 from percona/K8SPSMDB-726-notes-fix
Browse files Browse the repository at this point in the history
K8SPSMDB-726 Update NOTES.txt
  • Loading branch information
hors authored Sep 2, 2022
2 parents e6d8869 + 81e8ddb commit edd20de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/psmdb-db/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: "1.12.0"
description: A Helm chart for installing Percona Server MongoDB Cluster Databases using the PSMDB Operator.
name: psmdb-db
home: https://www.percona.com/doc/kubernetes-operator-for-psmongodb/index.html
version: 1.12.3
version: 1.12.4
maintainers:
- name: cap1984
email: [email protected]
Expand Down
18 changes: 12 additions & 6 deletions charts/psmdb-db/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
To get a MongoDB prompt inside your new cluster you can run:
Percona Server for MongoDB cluster is deployed now. Get the username and password:

ADMIN_USER=$(kubectl -n {{ .Release.Namespace }} get secrets {{ include "psmdb-database.fullname" . }}-secrets -o jsonpath="{.data.MONGODB_USER_ADMIN_USER}" | base64 --decode)
ADMIN_PASSWORD=$(kubectl -n {{ .Release.Namespace }} get secrets {{ include "psmdb-database.fullname" . }}-secrets -o jsonpath="{.data.MONGODB_USER_ADMIN_PASSWORD}" | base64 --decode)

And then for replica set:
$ kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:4.4 --restart=Never \
-- mongo "mongodb+srv://${ADMIN_USER}:${ADMIN_PASSWORD}@{{ include "psmdb-database.fullname" . }}-{{ (index .Values.replsets 0).name }}.{{ .Release.Namespace }}.svc.cluster.local/admin?replicaSet=rs0&ssl=false"
Connect to the cluster:
{{- if .Values.sharding.enabled }}

Or for sharding setup:
$ kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:4.4 --restart=Never \
kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:5.0 --restart=Never \
-- mongo "mongodb://${ADMIN_USER}:${ADMIN_PASSWORD}@{{ include "psmdb-database.fullname" . }}-mongos.{{ .Release.Namespace }}.svc.cluster.local/admin?ssl=false"

{{- else }}

kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:5.0 --restart=Never \
-- mongo "mongodb+srv://${ADMIN_USER}:${ADMIN_PASSWORD}@{{ include "psmdb-database.fullname" . }}-{{ (index .Values.replsets 0).name }}.{{ .Release.Namespace }}.svc.cluster.local/admin?replicaSet=rs0&ssl=false"

{{- end }}

0 comments on commit edd20de

Please sign in to comment.