Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use release name as default clusterName #354

Merged
merged 6 commits into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/tidb-cluster/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Cluster Startup

Cluster access
* Access tidb-cluster using the MySQL client
kubectl port-forward -n {{ .Release.Namespace }} svc/{{ .Values.clusterName }}-tidb 4000:4000 &
kubectl port-forward -n {{ .Release.Namespace }} svc/{{ template "cluster.name" . }}-tidb 4000:4000 &
{{- if .Values.tidb.passwordSecretName }}
mysql -h 127.0.0.1 -P 4000 -u root -D test -p
{{- else -}}
Expand All @@ -22,6 +22,6 @@ Cluster access
{{- end -}}
{{- if .Values.monitor.create }}
* View monitor dashboard for TiDB cluster
kubectl port-forward -n {{ .Release.Namespace }} svc/{{ .Values.clusterName }}-grafana 3000:3000
kubectl port-forward -n {{ .Release.Namespace }} svc/{{ template "cluster.name" . }}-grafana 3000:3000
Open browser at http://localhost:3000. The default username and password is admin/admin.
{{- end -}}
4 changes: 4 additions & 0 deletions charts/tidb-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- $wtf := $context.Template.Name | replace $last $name -}}
{{ include $wtf $context }}
{{- end -}}

{{- define "cluster.name" -}}
{{- default .Release.Name .Values.clusterName }}
{{- end -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No newline at the end of file

Loading