From 5bd2d326812826f328a9298d2e44b1b30ce6f208 Mon Sep 17 00:00:00 2001 From: Hal Lesesne Date: Fri, 11 Aug 2023 14:24:17 -0400 Subject: [PATCH 1/6] Update Notes.txt to correct secret name In this PR: https://github.com/percona/percona-helm-charts/pull/194/commits/fdcb6fbf2da6cf5f2ee92c66f15b9566bcbef03a a change was made to allow the variable "clusterSecretName" to be configured. Additionally, if the clusterSecretName wasn't specified, the suffix "-secret" was added to the fullname of the database. The NOTES.txt was emitting on the fullname and not the fullname-secrets so the instructions would be incorrect in every case. --- charts/pxc-db/templates/NOTES.txt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/charts/pxc-db/templates/NOTES.txt b/charts/pxc-db/templates/NOTES.txt index 93458389..9fe6b6b6 100644 --- a/charts/pxc-db/templates/NOTES.txt +++ b/charts/pxc-db/templates/NOTES.txt @@ -20,15 +20,30 @@ Join Percona Squad! Get early access to new product features, invite-only ”ask >>> https://percona.com/k8s <<< +*** Note: if you set customSecretName, replace {{ include "pxc-database.fullname" . }}-secret with the secret name you supplied. *** + 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 {{ include "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" . }}-secret -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 {{ include "pxc.clusterSecretName" . }} -o jsonpath="{.data.root}" | base64 --decode` + {{- else }} + ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc-database.fullname" . }}-secret -o jsonpath="{.data.root}" | base64 --decode` + {{- end }} + + {{- if .Values.proxysql.enabled }} kubectl run -i --tty --rm percona-client --image=percona --restart=Never \ From 721a6e5684ea88e46ee7efd67cfe3d9db248dc51 Mon Sep 17 00:00:00 2001 From: Hal Lesesne Date: Fri, 11 Aug 2023 14:25:51 -0400 Subject: [PATCH 2/6] Removed an unnessary note --- charts/pxc-db/templates/NOTES.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/pxc-db/templates/NOTES.txt b/charts/pxc-db/templates/NOTES.txt index 9fe6b6b6..812a7782 100644 --- a/charts/pxc-db/templates/NOTES.txt +++ b/charts/pxc-db/templates/NOTES.txt @@ -20,8 +20,6 @@ Join Percona Squad! Get early access to new product features, invite-only ”ask >>> https://percona.com/k8s <<< -*** Note: if you set customSecretName, replace {{ include "pxc-database.fullname" . }}-secret with the secret name you supplied. *** - 1. To get a MySQL prompt inside your new cluster you can run: {{- if hasKey .Values.pxc "clusterSecretName" }} From cf5276d0adbb80c2288d797cf6e404b97866dec4 Mon Sep 17 00:00:00 2001 From: Hal Lesesne Date: Fri, 11 Aug 2023 14:31:32 -0400 Subject: [PATCH 3/6] Bumped version --- charts/pxc-db/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pxc-db/Chart.yaml b/charts/pxc-db/Chart.yaml index 8d408d39..49c80745 100644 --- a/charts/pxc-db/Chart.yaml +++ b/charts/pxc-db/Chart.yaml @@ -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: tomislav.plavcic@percona.com From 73d9ec11e32e2d7aa03316bcea51fded9a066550 Mon Sep 17 00:00:00 2001 From: Hal Lesesne Date: Fri, 11 Aug 2023 14:49:35 -0400 Subject: [PATCH 4/6] secret should have been plural. --- charts/pxc-db/templates/NOTES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/pxc-db/templates/NOTES.txt b/charts/pxc-db/templates/NOTES.txt index 812a7782..fd6cd876 100644 --- a/charts/pxc-db/templates/NOTES.txt +++ b/charts/pxc-db/templates/NOTES.txt @@ -27,7 +27,7 @@ Join Percona Squad! Get early access to new product features, invite-only ”ask 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" . }}-secret -o jsonpath="{.data.root}" | base64 --decode` + 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 }} @@ -38,7 +38,7 @@ Join Percona Squad! Get early access to new product features, invite-only ”ask {{- if hasKey .Values.pxc "clusterSecretName" }} ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc.clusterSecretName" . }} -o jsonpath="{.data.root}" | base64 --decode` {{- else }} - ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc-database.fullname" . }}-secret -o jsonpath="{.data.root}" | base64 --decode` + ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc-database.fullname" . }}-secrets -o jsonpath="{.data.root}" | base64 --decode` {{- end }} From efafdfbe6a2b70fb525c8b61be341bf48cde65f8 Mon Sep 17 00:00:00 2001 From: Tomislav Plavcic Date: Thu, 17 Aug 2023 09:19:15 +0200 Subject: [PATCH 5/6] Update charts/pxc-db/templates/NOTES.txt --- charts/pxc-db/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pxc-db/templates/NOTES.txt b/charts/pxc-db/templates/NOTES.txt index fd6cd876..391e24a5 100644 --- a/charts/pxc-db/templates/NOTES.txt +++ b/charts/pxc-db/templates/NOTES.txt @@ -23,7 +23,7 @@ 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: {{- if hasKey .Values.pxc "clusterSecretName" }} - ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc.clusterSecretName" . }} -o jsonpath="{.data.root}" | base64 --decode` + 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 }} From a35f089b69e476fafa587e717953e48e424f9d2e Mon Sep 17 00:00:00 2001 From: Tomislav Plavcic Date: Thu, 17 Aug 2023 09:19:29 +0200 Subject: [PATCH 6/6] Update charts/pxc-db/templates/NOTES.txt --- charts/pxc-db/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pxc-db/templates/NOTES.txt b/charts/pxc-db/templates/NOTES.txt index 391e24a5..58d5564d 100644 --- a/charts/pxc-db/templates/NOTES.txt +++ b/charts/pxc-db/templates/NOTES.txt @@ -36,7 +36,7 @@ Join Percona Squad! Get early access to new product features, invite-only ”ask 2. To connect an Application running in the same Kubernetes cluster you can connect with: {{- if hasKey .Values.pxc "clusterSecretName" }} - ROOT_PASSWORD=`kubectl -n {{ .Release.Namespace }} get secrets {{ include "pxc.clusterSecretName" . }} -o jsonpath="{.data.root}" | base64 --decode` + 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 }}