NOTES.txt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. CHART NAME: {{ .Chart.Name }}
  2. CHART VERSION: {{ .Chart.Version }}
  3. APP VERSION: {{ .Chart.AppVersion }}
  4. ** Please be patient while the chart is being deployed **
  5. {{- if .Values.diagnosticMode.enabled }}
  6. The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
  7. command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
  8. args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
  9. Get the list of pods by executing:
  10. kubectl get pods --namespace {{ include "common.names.namespace" . }} -l app.kubernetes.io/instance={{ .Release.Name }}
  11. Access the pod you want to debug by executing
  12. kubectl exec --namespace {{ include "common.names.namespace" . }} -ti <NAME OF THE POD> -- bash
  13. In order to replicate the container startup scripts execute this command:
  14. /opt/bitnami/scripts/mysql/entrypoint.sh /opt/bitnami/scripts/mysql/run.sh
  15. {{- else }}
  16. Tip:
  17. Watch the deployment status using the command: kubectl get pods -w --namespace {{ include "common.names.namespace" . }}
  18. Services:
  19. echo Primary: {{ include "mysql.primary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.primary.service.ports.mysql }}
  20. {{- if eq .Values.architecture "replication" }}
  21. echo Secondary: {{ include "mysql.secondary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.secondary.service.ports.mysql }}
  22. {{- end }}
  23. Execute the following to get the administrator credentials:
  24. echo Username: root
  25. MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace {{ include "common.names.namespace" . }} {{ template "mysql.secretName" . }} -o jsonpath="{.data.mysql-root-password}" | base64 -d)
  26. To connect to your database:
  27. 1. Run a pod that you can use as a client:
  28. kubectl run {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --image {{ template "mysql.image" . }} --namespace {{ include "common.names.namespace" . }} --env MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD --command -- bash
  29. 2. To connect to primary service (read/write):
  30. mysql -h {{ include "mysql.primary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} -uroot -p"$MYSQL_ROOT_PASSWORD"
  31. {{- if eq .Values.architecture "replication" }}
  32. 3. To connect to secondary service (read-only):
  33. mysql -h {{ include "mysql.secondary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} -uroot -p"$MYSQL_ROOT_PASSWORD"
  34. {{- end }}
  35. {{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
  36. Note: Since NetworkPolicy is enabled, only pods with label {{ template "common.names.fullname" . }}-client=true" will be able to connect to MySQL.
  37. {{- end }}
  38. {{- if .Values.metrics.enabled }}
  39. To access the MySQL Prometheus metrics from outside the cluster execute the following commands:
  40. kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ printf "%s-metrics" (include "common.names.fullname" .) }} {{ .Values.metrics.service.port }}:{{ .Values.metrics.service.port }} &
  41. curl http://127.0.0.1:{{ .Values.metrics.service.port }}/metrics
  42. {{- end }}
  43. {{ include "mysql.validateValues" . }}
  44. {{ include "mysql.checkRollingTags" . }}
  45. {{- end }}