Skip to content

Commit 94d833f

Browse files
Luke OsborneLuke Osborne
authored andcommitted
helm: Output database-specific connection command
When the helm chart finishes installing, it prints out instructions for connecting to the newly created deployment. Previously, these instructions were only provided for mysql, and they were provided regardless of the database type. This commit looks at adapter.type and prints out the appropriate mysql or psql command accordingly. Refs: REA-2744 Change-Id: Iad41b5cfb9271b9c1eb906cdefa878a2849e09a6 Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5533 Tested-by: Buildkite CI Reviewed-by: Jason Camp <[email protected]>
1 parent 9b50ec9 commit 94d833f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

helm/readyset/templates/NOTES.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,22 @@ APP VERSION: {{ .Chart.AppVersion }}
66

77
Give the chart approximately 5 minutes to deploy. When the service is ready, you should see all pods up.
88

9+
{{- if eq .Values.readyset.adapter.type "mysql" }}
910
For connecting to MySQL:
1011

11-
mysql -u $(kubectl get secret readyset-upstream-database -o jsonpath="{.data.username}" | base64 -d) \
12+
mysql \
13+
-u $(kubectl get secret readyset-upstream-database -o jsonpath="{.data.username}" | base64 -d) \
1214
-h $(kubectl get svc readyset-adapter --template {{ "\"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}\"" }}) \
1315
--password=$(kubectl get secret readyset-upstream-database -o jsonpath="{.data.password}" | base64 -d) \
1416
--database=$(kubectl get secret readyset-upstream-database -o jsonpath="{.data.database}" | base64 -d)
17+
18+
{{- else if eq .Values.readyset.adapter.type "postgresql" }}
19+
For connecting to PostgreSQL:
20+
21+
PGPASS=$(kubectl get secret readyset-upstream-database -o jsonpath="{.data.password}" | base64 -d) \
22+
psql \
23+
-U $(kubectl get secret readyset-upstream-database -o jsonpath="{.data.username}" | base64 -d) \
24+
-h $(kubectl get svc readyset-adapter --template {{ "\"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}\"" }}) \
25+
--dbname=$(kubectl get secret readyset-upstream-database -o jsonpath="{.data.database}" | base64 -d)
26+
27+
{{- end }}

0 commit comments

Comments
 (0)