Skip to content

Commit 145b6b5

Browse files
authored
chore(mysql-cluster): add plans (#11)
1 parent bac149f commit 145b6b5

29 files changed

Lines changed: 706 additions & 12 deletions

addons/mysql-cluster/8.0/chart/mysql-cluster/templates/primary/statefulset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ spec:
156156
- name: MYSQL_DATABASE
157157
value: {{ .Values.auth.database | quote }}
158158
{{- end }}
159+
{{- if .Values.primary.maxConnectionLimit }}
160+
- name: MAX_CONNECTION_LIMIT
161+
value: {{ .Values.primary.maxConnectionLimit | quote }}
162+
{{- end }}
159163
{{- if or (eq .Values.architecture "replication") (eq .Values.architecture "mgr") }}
160164
- name: MYSQL_REPLICATION_MODE
161165
value: "master"
@@ -393,3 +397,4 @@ spec:
393397
selector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.persistence.selector "context" $) | nindent 10 }}
394398
{{- end -}}
395399
{{- end }}
400+

addons/mysql-cluster/8.0/chart/mysql-cluster/values.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ auth:
149149
## initdbScripts:
150150
## my_init_script.sh: |
151151
## #!/bin/bash
152-
## echo "Do something."
152+
## echo "Do something."
153153
##
154154
initdbScripts:
155155
int-mysql.sh: |
@@ -181,6 +181,8 @@ initdbScripts:
181181
echo loose-group_replication_group_seeds="$svc_mgr_host-0.$svc_mgr_host:24901,$svc_mgr_host-1.$svc_mgr_host:24901,$svc_mgr_host-2.$svc_mgr_host:24901" >> $base_conf_file
182182
183183
echo plugin_load_add='group_replication.so' >> $base_conf_file
184+
185+
echo max_connections=$MAX_CONNECTION_LIMIT >> $base_conf_file
184186
185187
## @param initdbScriptsConfigMap ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`)
186188
##
@@ -211,10 +213,12 @@ primary:
211213
## @param primary.configuration [string] Configure MySQL Primary with a custom my.cnf file
212214
## ref: https://mysql.com/kb/en/mysql/configuring-mysql-with-mycnf/#example-of-configuration-file
213215
##
216+
maxConnectionLimit: 2000
217+
214218
configuration: |-
215219
[mysqld]
216220
# server
217-
max_connections=500
221+
max_connections=10000
218222
default_authentication_plugin=caching_sha2_password
219223
skip-name-resolve
220224
relay-log=relay-log

addons/mysql-cluster/8.0/plans/standard-10/bind.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ credential:
2020
secretKeyRef:
2121
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
2222
jsonpath: '{ .data.username }'
23-
- name: port
23+
- name: portro
2424
valueFrom:
2525
secretKeyRef:
2626
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
27-
jsonpath: '{ .data.port }'
27+
jsonpath: '{ .data.portro }'
28+
- name: portrw
29+
valueFrom:
30+
secretKeyRef:
31+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
32+
jsonpath: '{ .data.portrw }'
2833
{{- end }}
2934

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "standard-10"
22
id: 2b455154-8725-482a-95b2-a193c180d9b5
3-
description: "Mysql Cluster standard-10 plan which limit persistence size 10Gi."
3+
description: "Mysql Cluster standard-10 plan: Disk 10Gi ,vCPUs 1 , RAM 2G , DB MAX Connection 600"
44
displayName: "standard-10"
55
bindable: true
66
maximum_polling_duration: 1800

addons/mysql-cluster/8.0/plans/standard-10/values.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ fullnameOverride: hb-mysql-cluster-standard-10
1111
## @param resources.limits The resources limits for the MinIO® container
1212
## @param resources.requests The requested resources for the MinIO® container
1313
##
14-
resources:
15-
limits:
16-
cpu: 1000m
17-
memory: 1024Mi
18-
requests:
19-
cpu: 100m
20-
memory: 512Mi
14+
primary:
15+
maxConnectionLimit: 600
16+
resources:
17+
limits:
18+
cpu: 1000m
19+
memory: 1024Mi
20+
requests:
21+
cpu: 1000m
22+
memory: 1024Mi
23+
2124

2225
## @section Persistence parameters
2326

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
credential:
2+
{{- if (eq .Values.router.service.type "LoadBalancer") }}
3+
- name: host
4+
valueFrom:
5+
secretKeyRef:
6+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
7+
jsonpath: '{ .data.host }'
8+
- name: database
9+
valueFrom:
10+
secretKeyRef:
11+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
12+
jsonpath: '{ .data.database }'
13+
- name: password
14+
valueFrom:
15+
secretKeyRef:
16+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
17+
jsonpath: '{ .data.username }'
18+
- name: username
19+
valueFrom:
20+
secretKeyRef:
21+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
22+
jsonpath: '{ .data.username }'
23+
- name: portro
24+
valueFrom:
25+
secretKeyRef:
26+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
27+
jsonpath: '{ .data.portro }'
28+
- name: portrw
29+
valueFrom:
30+
secretKeyRef:
31+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
32+
jsonpath: '{ .data.portrw }'
33+
{{- end }}
34+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"type": "object",
4+
"properties": {
5+
"imagePullPolicy": {
6+
"type": "string",
7+
"enum": ["Always", "IfNotPresent", "Never"],
8+
"default": "IfNotPresent",
9+
"title": "Image pull policy"
10+
}
11+
}
12+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: "standard-100"
2+
id: 8205e5d3-a954-4c68-a570-efa8c607c1d7
3+
description: "Mysql Cluster standard-100 plan: Disk 100Gi ,vCPUs 4 , RAM 16G , DB MAX Connection 4000"
4+
displayName: "standard-100"
5+
bindable: true
6+
maximum_polling_duration: 1800
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## @param fullnameOverride String to fully override common.names.fullname template
2+
##
3+
fullnameOverride: hb-mysql-cluster-standard-100
4+
5+
## MinIO® containers' resource requests and limits
6+
## ref: https://kubernetes.io/docs/user-guide/compute-resources/
7+
## We usually recommend not to specify default resources and to leave this as a conscious
8+
## choice for the user. This also increases chances charts run on environments with little
9+
## resources, such as Minikube. If you do want to specify resources, uncomment the following
10+
## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
11+
## @param resources.limits The resources limits for the MinIO® container
12+
## @param resources.requests The requested resources for the MinIO® container
13+
##
14+
primary:
15+
maxConnectionLimit: 4000
16+
resources:
17+
limits:
18+
cpu: 4000m
19+
memory: 16Gi
20+
requests:
21+
cpu: 4000m
22+
memory: 16Gi
23+
24+
25+
## @section Persistence parameters
26+
27+
## Enable persistence using Persistent Volume Claims
28+
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
29+
##
30+
persistence:
31+
## @param primary.persistence.enabled Enable persistence on MySQL primary replicas using a `PersistentVolumeClaim`. If false, use emptyDir
32+
##
33+
enabled: true
34+
## @param primary.persistence.existingClaim Name of an existing `PersistentVolumeClaim` for MySQL primary replicas
35+
## NOTE: When it's set the rest of persistence parameters are ignored
36+
##
37+
existingClaim: ""
38+
## @param primary.persistence.storageClass MySQL primary persistent volume storage Class
39+
## If defined, storageClassName: <storageClass>
40+
## If set to "-", storageClassName: "", which disables dynamic provisioning
41+
## If undefined (the default) or set to null, no storageClassName spec is
42+
## set, choosing the default provisioner. (gp2 on AWS, standard on
43+
## GKE, AWS & OpenStack)
44+
##
45+
storageClass: ""
46+
## @param primary.persistence.annotations MySQL primary persistent volume claim annotations
47+
##
48+
annotations: {}
49+
## @param primary.persistence.accessModes MySQL primary persistent volume access Modes
50+
##
51+
accessModes:
52+
- ReadWriteOnce
53+
## @param primary.persistence.size MySQL primary persistent volume size
54+
##
55+
size: 100Gi
56+
## @param primary.persistence.selector Selector to match an existing Persistent Volume
57+
## selector:
58+
## matchLabels:
59+
## app: my-app
60+
##
61+
selector: {}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
credential:
2+
{{- if (eq .Values.router.service.type "LoadBalancer") }}
3+
- name: host
4+
valueFrom:
5+
secretKeyRef:
6+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
7+
jsonpath: '{ .data.host }'
8+
- name: database
9+
valueFrom:
10+
secretKeyRef:
11+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
12+
jsonpath: '{ .data.database }'
13+
- name: password
14+
valueFrom:
15+
secretKeyRef:
16+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
17+
jsonpath: '{ .data.username }'
18+
- name: username
19+
valueFrom:
20+
secretKeyRef:
21+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
22+
jsonpath: '{ .data.username }'
23+
- name: portro
24+
valueFrom:
25+
secretKeyRef:
26+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
27+
jsonpath: '{ .data.portro }'
28+
- name: portrw
29+
valueFrom:
30+
secretKeyRef:
31+
name: {{ template "common.names.fullname" . }}-svcbind-custom-user
32+
jsonpath: '{ .data.portrw }'
33+
{{- end }}
34+

0 commit comments

Comments
 (0)