Skip to content

Commit

Permalink
Merge pull request #237 from hlesesne/hlesesne-patch-1
Browse files Browse the repository at this point in the history
K8SPXC-1283 - Update NOTES.txt to correct secret name.
  • Loading branch information
tplavcic authored Aug 17, 2023
2 parents 8977938 + a35f089 commit f206b41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/pxc-db/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: 1.13.0
description: A Helm chart for installing Percona XtraDB Cluster Databases using the PXC Operator.
name: pxc-db
home: https://www.percona.com/doc/kubernetes-operator-for-pxc/kubernetes.html
version: 1.13.0
version: 1.13.1
maintainers:
- name: tplavcic
email: [email protected]
Expand Down
17 changes: 15 additions & 2 deletions charts/pxc-db/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,26 @@ Join Percona Squad! Get early access to new product features, invite-only ”ask

1. To get a MySQL prompt inside your new cluster you can run:

ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc-database.fullname" . }} -o jsonpath="{.data.root}" | base64 --decode`
{{- if hasKey .Values.pxc "clusterSecretName" }}
ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ .Values.pxc.clusterSecretName }} -o jsonpath="{.data.root}" | base64 --decode`
kubectl -n {{ .Release.Namespace }} exec -ti \
{{ include "pxc-database.fullname" . }}-pxc-0 -c pxc -- mysql -uroot -p"$ROOT_PASSWORD"
{{- else }}
ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc-database.fullname" . }}-secrets -o jsonpath="{.data.root}" | base64 --decode`
kubectl -n {{ .Release.Namespace }} exec -ti \
{{ include "pxc-database.fullname" . }}-pxc-0 -c pxc -- mysql -uroot -p"$ROOT_PASSWORD"
{{- end }}


2. To connect an Application running in the same Kubernetes cluster you can connect with:

ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc-database.fullname" . }} -o jsonpath="{.data.root}" | base64 --decode`
{{- if hasKey .Values.pxc "clusterSecretName" }}
ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ .Values.pxc.clusterSecretName }} -o jsonpath="{.data.root}" | base64 --decode`
{{- else }}
ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc-database.fullname" . }}-secrets -o jsonpath="{.data.root}" | base64 --decode`
{{- end }}


{{- if .Values.proxysql.enabled }}

kubectl run -i --tty --rm percona-client --image=percona --restart=Never \
Expand Down

0 comments on commit f206b41

Please sign in to comment.