Skip to content

Commit c706fa5

Browse files
committed
chore(mysql-cluster):add mysql-cluster 8.4
1 parent b2e1d44 commit c706fa5

102 files changed

Lines changed: 7846 additions & 55 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
credential:
2-
{{- if (eq .Values.router.service.type "LoadBalancer") }}
2+
{{- if (eq .Values.primary.service.type "LoadBalancer") }}
33
- name: EXTRANET_HOST
44
valueFrom:
55
serviceRef:
6-
name: {{ include "common.names.fullname" . }}-router
6+
name: {{ include "common.names.fullname" . }}
77
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
88
{{- end }}
99
- name: DOMAIN
10-
value: {{ template "common.names.fullname" . }}-router.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
10+
value: {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
1111
- name: HOST
1212
valueFrom:
1313
serviceRef:
14-
name: {{ include "common.names.fullname" . }}-router
14+
name: {{ include "common.names.fullname" . }}
1515
jsonpath: '{ .spec.clusterIP }'
1616
- name: PASSWORD
1717
valueFrom:
@@ -23,13 +23,8 @@ credential:
2323
secretKeyRef:
2424
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
2525
jsonpath: '{ .data.username }'
26-
- name: READONLY_PORT
26+
- name: PORT
2727
valueFrom:
2828
secretKeyRef:
2929
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
30-
jsonpath: '{ .data.portro }'
31-
- name: READWRITE_PORT
32-
valueFrom:
33-
secretKeyRef:
34-
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
35-
jsonpath: '{ .data.portrw }'
30+
jsonpath: '{ .data.port }'
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
credential:
2-
{{- if (eq .Values.router.service.type "LoadBalancer") }}
2+
{{- if (eq .Values.primary.service.type "LoadBalancer") }}
33
- name: EXTRANET_HOST
44
valueFrom:
55
serviceRef:
6-
name: {{ include "common.names.fullname" . }}-router
6+
name: {{ include "common.names.fullname" . }}
77
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
88
{{- end }}
99
- name: DOMAIN
10-
value: {{ template "common.names.fullname" . }}-router.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
10+
value: {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
1111
- name: HOST
1212
valueFrom:
1313
serviceRef:
14-
name: {{ include "common.names.fullname" . }}-router
14+
name: {{ include "common.names.fullname" . }}
1515
jsonpath: '{ .spec.clusterIP }'
1616
- name: PASSWORD
1717
valueFrom:
@@ -23,13 +23,8 @@ credential:
2323
secretKeyRef:
2424
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
2525
jsonpath: '{ .data.username }'
26-
- name: READONLY_PORT
26+
- name: PORT
2727
valueFrom:
2828
secretKeyRef:
2929
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
30-
jsonpath: '{ .data.portro }'
31-
- name: READWRITE_PORT
32-
valueFrom:
33-
secretKeyRef:
34-
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
35-
jsonpath: '{ .data.portrw }'
30+
jsonpath: '{ .data.port }'
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
credential:
2-
{{- if (eq .Values.router.service.type "LoadBalancer") }}
2+
{{- if (eq .Values.primary.service.type "LoadBalancer") }}
33
- name: EXTRANET_HOST
44
valueFrom:
55
serviceRef:
6-
name: {{ include "common.names.fullname" . }}-router
6+
name: {{ include "common.names.fullname" . }}
77
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
88
{{- end }}
99
- name: DOMAIN
10-
value: {{ template "common.names.fullname" . }}-router.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
10+
value: {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
1111
- name: HOST
1212
valueFrom:
1313
serviceRef:
14-
name: {{ include "common.names.fullname" . }}-router
14+
name: {{ include "common.names.fullname" . }}
1515
jsonpath: '{ .spec.clusterIP }'
1616
- name: PASSWORD
1717
valueFrom:
@@ -23,13 +23,8 @@ credential:
2323
secretKeyRef:
2424
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
2525
jsonpath: '{ .data.username }'
26-
- name: READONLY_PORT
26+
- name: PORT
2727
valueFrom:
2828
secretKeyRef:
2929
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
30-
jsonpath: '{ .data.portro }'
31-
- name: READWRITE_PORT
32-
valueFrom:
33-
secretKeyRef:
34-
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
35-
jsonpath: '{ .data.portrw }'
30+
jsonpath: '{ .data.port }'
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
credential:
2-
{{- if (eq .Values.router.service.type "LoadBalancer") }}
2+
{{- if (eq .Values.primary.service.type "LoadBalancer") }}
33
- name: EXTRANET_HOST
44
valueFrom:
55
serviceRef:
6-
name: {{ include "common.names.fullname" . }}-router
6+
name: {{ include "common.names.fullname" . }}
77
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
88
{{- end }}
99
- name: DOMAIN
10-
value: {{ template "common.names.fullname" . }}-router.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
10+
value: {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
1111
- name: HOST
1212
valueFrom:
1313
serviceRef:
14-
name: {{ include "common.names.fullname" . }}-router
14+
name: {{ include "common.names.fullname" . }}
1515
jsonpath: '{ .spec.clusterIP }'
1616
- name: PASSWORD
1717
valueFrom:
@@ -23,13 +23,8 @@ credential:
2323
secretKeyRef:
2424
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
2525
jsonpath: '{ .data.username }'
26-
- name: READONLY_PORT
26+
- name: PORT
2727
valueFrom:
2828
secretKeyRef:
2929
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
30-
jsonpath: '{ .data.portro }'
31-
- name: READWRITE_PORT
32-
valueFrom:
33-
secretKeyRef:
34-
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
35-
jsonpath: '{ .data.portrw }'
30+
jsonpath: '{ .data.port }'
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
credential:
2-
{{- if (eq .Values.router.service.type "LoadBalancer") }}
2+
{{- if (eq .Values.primary.service.type "LoadBalancer") }}
33
- name: EXTRANET_HOST
44
valueFrom:
55
serviceRef:
6-
name: {{ include "common.names.fullname" . }}-router
6+
name: {{ include "common.names.fullname" . }}
77
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
88
{{- end }}
99
- name: DOMAIN
10-
value: {{ template "common.names.fullname" . }}-router.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
10+
value: {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
1111
- name: HOST
1212
valueFrom:
1313
serviceRef:
14-
name: {{ include "common.names.fullname" . }}-router
14+
name: {{ include "common.names.fullname" . }}
1515
jsonpath: '{ .spec.clusterIP }'
1616
- name: PASSWORD
1717
valueFrom:
@@ -23,13 +23,8 @@ credential:
2323
secretKeyRef:
2424
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
2525
jsonpath: '{ .data.username }'
26-
- name: READONLY_PORT
26+
- name: PORT
2727
valueFrom:
2828
secretKeyRef:
2929
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
30-
jsonpath: '{ .data.portro }'
31-
- name: READWRITE_PORT
32-
valueFrom:
33-
secretKeyRef:
34-
name: {{ template "common.names.fullname" . }}-svcbind-administrator-user
35-
jsonpath: '{ .data.portrw }'
30+
jsonpath: '{ .data.port }'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
annotations:
2+
category: Database
3+
apiVersion: v2
4+
appVersion: "8.4.9"
5+
dependencies:
6+
- name: common
7+
repository: oci://registry.drycc.cc/charts
8+
tags:
9+
- drycc-common
10+
version: ~3.x
11+
description: MySQL is a fast, reliable, scalable, and easy to use open source relational database system. Designed to handle mission-critical, heavy-load production applications.
12+
engine: gotpl
13+
home: https://github.com/drycc/charts/tree/master/drycc/mysql
14+
icon: https://drycc.com/assets/stacks/mysql/img/mysql-stack-220x234.png
15+
keywords:
16+
- mysql
17+
- database
18+
- sql
19+
- cluster
20+
- high availability
21+
maintainers:
22+
- name: Drycc
23+
url: https://github.com/drycc/charts
24+
name: mysql
25+
sources:
26+
- https://github.com/drycc/containers/tree/main/drycc/mysql
27+
- https://mysql.com
28+
version: 8.4.9
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
CHART NAME: {{ .Chart.Name }}
2+
CHART VERSION: {{ .Chart.Version }}
3+
APP VERSION: {{ .Chart.AppVersion }}
4+
5+
** Please be patient while the chart is being deployed **
6+
7+
{{- if .Values.diagnosticMode.enabled }}
8+
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
9+
10+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
11+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
12+
13+
Get the list of pods by executing:
14+
15+
kubectl get pods --namespace {{ include "common.names.namespace" . }} -l app.kubernetes.io/instance={{ .Release.Name }}
16+
17+
Access the pod you want to debug by executing
18+
19+
kubectl exec --namespace {{ include "common.names.namespace" . }} -ti <NAME OF THE POD> -- bash
20+
21+
In order to replicate the container startup scripts execute this command:
22+
23+
/opt/drycc/scripts/mysql/entrypoint.sh /opt/drycc/scripts/mysql/run.sh
24+
25+
{{- else }}
26+
27+
Tip:
28+
29+
Watch the deployment status using the command: kubectl get pods -w --namespace {{ include "common.names.namespace" . }}
30+
31+
Services:
32+
33+
echo Primary: {{ include "mysql.primary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.primary.service.ports.mysql }}
34+
{{- if eq .Values.architecture "replication" }}
35+
echo Secondary: {{ include "mysql.secondary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.secondary.service.ports.mysql }}
36+
{{- end }}
37+
38+
Execute the following to get the administrator credentials:
39+
40+
echo Username: root
41+
MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace {{ include "common.names.namespace" . }} {{ template "mysql.secretName" . }} -o jsonpath="{.data.mysql-root-password}" | base64 -d)
42+
43+
To connect to your database:
44+
45+
1. Run a pod that you can use as a client:
46+
47+
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
48+
49+
2. To connect to primary service (read/write):
50+
51+
mysql -h {{ include "mysql.primary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} -uroot -p"$MYSQL_ROOT_PASSWORD"
52+
53+
{{- if eq .Values.architecture "replication" }}
54+
55+
3. To connect to secondary service (read-only):
56+
57+
mysql -h {{ include "mysql.secondary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} -uroot -p"$MYSQL_ROOT_PASSWORD"
58+
{{- end }}
59+
60+
{{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
61+
Note: Since NetworkPolicy is enabled, only pods with label {{ template "common.names.fullname" . }}-client=true" will be able to connect to MySQL.
62+
{{- end }}
63+
64+
{{- if .Values.metrics.enabled }}
65+
66+
To access the MySQL Prometheus metrics from outside the cluster execute the following commands:
67+
68+
kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ printf "%s-metrics" (include "common.names.fullname" .) }} {{ .Values.metrics.service.port }}:{{ .Values.metrics.service.port }} &
69+
curl http://127.0.0.1:{{ .Values.metrics.service.port }}/metrics
70+
71+
{{- end }}
72+
73+
{{ include "mysql.validateValues" . }}
74+
{{ include "mysql.checkRollingTags" . }}
75+
{{- end }}

0 commit comments

Comments
 (0)