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

[enhancement] Modify the key word #41

Closed
andyli029 opened this issue Apr 21, 2021 · 1 comment
Closed

[enhancement] Modify the key word #41

andyli029 opened this issue Apr 21, 2021 · 1 comment
Assignees

Comments

@andyli029
Copy link
Contributor

andyli029 commented Apr 21, 2021

Summary

master->leader
slave->follower

tt-krypton-master           NodePort    10.96.42.194    <none>        3306:32370/TCP      102m
tt-krypton-metrics          ClusterIP   None            <none>        9104/TCP            102m
tt-krypton-slave            NodePort    10.96.21.243    <none>        3306:30545/TCP      102m
@runkecheng
Copy link
Collaborator

The chart name should be xenondb.

https://github.com/andyli029/krypton-helm/blob/master/charts/Chart.yaml#L2
To connect to master service in the Ubuntu pod:

    mysql -h {{ template "fullname" . }}-master -u {{ .Values.mysql.mysqlUser }} -p

{{- if lt 1 (.Values.replicaCount | int64) }}

To connect to slave service (read-only) in the Ubuntu pod:

    mysql -h {{ template "fullname" . }}-slave -u {{ .Values.mysql.mysqlUser }} -p

The definition of fullname in templates/_helpers.tpl.

{{/*
Create a default fully qualified app name.
The format of host is "fullname"-0."fullname"."namespace" (podname.servicename.namespace), 
and the MySQL limits the total length of master_host to 60 byte, 
so the length of "fullname" must be limited to '(60-4-len(namespace))/2'.
*/}}
{{- define "fullname" -}}
{{- $length := div (sub 56 (len .Release.Namespace )) 2 | int }}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc $length | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc $length | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc $length | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

andyli029 added a commit that referenced this issue Apr 22, 2021
andyli029 added a commit to andyli029/radondb-mysql-kubernetes that referenced this issue Apr 27, 2021
andyli029 added a commit that referenced this issue Apr 27, 2021
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants