rancher-partner-charts/charts/percona/pxc-db/templates/NOTES.txt

22 lines
1.1 KiB
Plaintext
Raw Normal View History

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`
kubectl -n {{ .Release.Namespace }} exec -ti \
{{ include "pxc-database.fullname" . }}-pxc-0 -c pxc -- mysql -uroot -p"$ROOT_PASSWORD"
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 .Values.proxysql.enabled }}
kubectl run -i --tty --rm percona-client --image=percona --restart=Never \
-- mysql -h {{ template "pxc-database.fullname" . }}-proxysql.{{ .Release.Namespace }}.svc.cluster.local -uroot -p"$ROOT_PASSWORD"
{{- else }}
kubectl run -i --tty --rm percona-client --image=percona --restart=Never \
-- mysql -h {{ template "pxc-database.fullname" . }}-haproxy.{{ .Release.Namespace }}.svc.cluster.local -uroot -p"$ROOT_PASSWORD"
{{- end }}