Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

feat: MariaDB operator and shared cluster #30

Merged
merged 102 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
831f2b5
feat: MariaDB operator
lholota Nov 10, 2023
fbb8974
CRD fix
lholota Nov 10, 2023
2a4bed9
Version fix
lholota Nov 10, 2023
34e0037
Version fix 2
lholota Nov 10, 2023
d11ffb0
Basic netpols
lholota Nov 10, 2023
9df2781
feat: Shared cluster
lholota Nov 13, 2023
f8fd27c
feat: Shared cluster 2
lholota Nov 13, 2023
07db9fa
feat: Shared cluster 3
lholota Nov 13, 2023
421fc9b
feat: Shared cluster 4
lholota Nov 13, 2023
c87fb8f
feat: Shared cluster 5
lholota Nov 13, 2023
4aab18d
feat: Shared cluster 6
lholota Nov 13, 2023
61043a9
feat: Shared cluster 7
lholota Nov 13, 2023
ccaece7
feat: Shared cluster 8 - cert manager
lholota Nov 13, 2023
fdd23ca
feat: Shared cluster 9
lholota Nov 13, 2023
4acbddd
feat: Shared cluster 10
lholota Nov 13, 2023
1e8d02d
feat: Shared cluster 11
lholota Nov 13, 2023
9a8e6ff
feat: Shared cluster 12
lholota Nov 13, 2023
2a4d55b
feat: Shared cluster 13 - test
lholota Nov 13, 2023
18df509
feat: Shared cluster 14
lholota Nov 13, 2023
591746e
feat: Shared cluster 15
lholota Nov 13, 2023
9d7e9ff
feat: Shared cluster 16
lholota Nov 13, 2023
425d64a
feat: Shared cluster 17 - tmp removal
lholota Nov 13, 2023
eba0e79
feat: Shared cluster 18
lholota Nov 13, 2023
51dbbfd
feat: Pomerium PG backup
lholota Nov 13, 2023
0a02837
feat: PG netpol test
lholota Nov 13, 2023
9e4aa7c
Webhook debug 1
lholota Nov 13, 2023
e315e93
Webhook debug 2
lholota Nov 13, 2023
92048ed
Webhook debug 3
lholota Nov 13, 2023
1b2827d
Webhook debug 4
lholota Nov 13, 2023
6a611c2
Webhook debug 5
lholota Nov 13, 2023
adf752b
Webhook debug 6
lholota Nov 13, 2023
8954163
Webhook debug 7
lholota Nov 13, 2023
c6df2a3
Webhook debug 8
lholota Nov 13, 2023
572ba23
Webhook debug 9
lholota Nov 13, 2023
0f5e53c
Webhook debug 10
lholota Nov 13, 2023
9d3af33
Webhook debug 11
lholota Nov 13, 2023
33c8144
Webhook debug 12
lholota Nov 13, 2023
6644bba
Webhook debug 13
lholota Nov 13, 2023
6351953
Webhook debug 14
lholota Nov 13, 2023
3f0d640
Webhook debug 15
lholota Nov 13, 2023
a6a944d
Webhook debug 16
lholota Nov 13, 2023
1a579dc
Webhook debug 17
lholota Nov 13, 2023
b7bbcd4
Webhook debug 18
lholota Nov 13, 2023
d031825
Webhook debug 19
lholota Nov 13, 2023
ecfd5e5
Webhook debug 20
lholota Nov 13, 2023
2ba3cfb
Webhook debug 21
lholota Nov 13, 2023
42e5941
Webhook debug 22
lholota Nov 13, 2023
f76bf20
Webhook debug 23
lholota Nov 13, 2023
e9443b1
Webhook debug 24
lholota Nov 13, 2023
5772d22
Webhook debug 25
lholota Nov 13, 2023
a012dbe
Webhook debug 26
lholota Nov 13, 2023
468903b
Webhook debug 27
lholota Nov 13, 2023
d4f6aa9
Webhook debug 28
lholota Nov 13, 2023
9b912fd
Webhook debug 29
lholota Nov 14, 2023
9eef6a3
Webhook debug 29
lholota Nov 14, 2023
6a893cf
Webhook debug 31
lholota Nov 14, 2023
9fbbb48
Webhook debug removed
lholota Nov 14, 2023
c592057
Webhook via template
lholota Nov 14, 2023
40aa023
Webhook via template - mariadb
lholota Nov 14, 2023
203e80e
Webhook via template - mariadb 2
lholota Nov 14, 2023
a0f706b
Mariadb 1
lholota Nov 14, 2023
4999fc0
Mariadb 2 - cluster removed
lholota Nov 14, 2023
ea16419
Mariadb 3 - cluster is back
lholota Nov 14, 2023
b0b9c6c
Mariadb 4 - cluster removed
lholota Nov 15, 2023
db31086
Mariadb 5 - master/slave replication
lholota Nov 15, 2023
b145b3a
Mariadb 6 - master/slave replication fixed
lholota Nov 15, 2023
b483322
Mariadb 7
lholota Nov 15, 2023
92e6ed0
Mariadb 8
lholota Nov 16, 2023
6e67dd2
Mariadb 9
lholota Nov 16, 2023
d826491
Mariadb 10
lholota Nov 16, 2023
3a0894d
Mariadb 11
lholota Nov 16, 2023
3e8bd42
Mariadb 1
lholota Nov 16, 2023
3546005
Mariadb 13
lholota Nov 16, 2023
62de1d5
Mariadb 14
lholota Nov 16, 2023
2d3566c
Mariadb 15
lholota Nov 16, 2023
98bb1c6
Mariadb 16
lholota Nov 16, 2023
a504565
Mariadb 17
lholota Nov 16, 2023
0e5604e
Mariadb 18
lholota Nov 16, 2023
aade473
Mariadb 19
lholota Nov 16, 2023
4c8b70f
Mariadb 19
lholota Nov 16, 2023
ba3a064
Mariadb 20
lholota Nov 16, 2023
17c82f0
Mariadb 21
lholota Nov 16, 2023
3a8347b
Mariadb 22
lholota Nov 16, 2023
2d6e16d
Mariadb 23
lholota Nov 16, 2023
3bf2e4c
Mariadb 24
lholota Nov 16, 2023
e2858b3
Mariadb 25
lholota Nov 16, 2023
3963ced
Mariadb 26
lholota Nov 16, 2023
579e653
Mariadb 27
lholota Nov 16, 2023
3110251
Mariadb 28
lholota Nov 16, 2023
c09d477
Mariadb 29
lholota Nov 16, 2023
aeb5518
Mariadb 30
lholota Nov 16, 2023
8d536cd
Mariadb 31
lholota Nov 16, 2023
c70e467
Mariadb 32
lholota Nov 16, 2023
c60fbed
Mariadb 33
lholota Nov 16, 2023
6d82f29
Mariadb 34
lholota Nov 16, 2023
6fe19a3
Mariadb 35
lholota Nov 16, 2023
32ef454
Mariadb 36
lholota Nov 16, 2023
bbd10f2
Mariadb 37
lholota Nov 16, 2023
1fa4431
Mariadb 38
lholota Nov 16, 2023
622c3b7
Mariadb 39
lholota Nov 16, 2023
3cd07a7
Webhook debug removed
lholota Nov 16, 2023
c384fc1
Values fixed
lholota Nov 16, 2023
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
32 changes: 32 additions & 0 deletions apps/_index/values.apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ applications:
syncWave: -100
deleteProtection: false

- name: network-policies-mariadb-system
namespace: mariadb-system
path: apps/network-policies
type: helm
syncWave: -100
deleteProtection: false

- name: network-policies-apps
namespace: apps
path: apps/network-policies
Expand Down Expand Up @@ -120,6 +127,13 @@ applications:
namespace: postgresql-system
deleteProtection: false

- name: mariadb-operator-crd
type: raw
syncWave: -85
namespace: mariadb-system
deleteProtection: false
serverSideApply: true

- name: postgresql-operator
type: helm
syncWave: -84
Expand All @@ -128,6 +142,14 @@ applications:
valueFiles:
- values.$env.yml

- name: mariadb-operator
type: helm
syncWave: -84
namespace: mariadb-system
deleteProtection: false
valueFiles:
- values.$env.yml

- name: cert-manager-crd
type: raw
syncWave: -84
Expand Down Expand Up @@ -160,6 +182,16 @@ applications:
secretValueFiles:
- secrets.$env.yml

- name: mariadb-shared-cluster
type: helm
syncWave: -58
namespace: apps
deleteProtection: false
valueFiles:
- values.$env.yml
secretValueFiles:
- secrets.$env.yml

- name: dns-primary
type: helm
path: apps/dns
Expand Down
35 changes: 35 additions & 0 deletions apps/common/templates/_network-policies-mariadb.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- define "common.network-policy-mariadb-cluster" }}
{{- $port := (.Port | default 3306 ) }}
{{- with .Root }}
{{- $clusterName := (.ClusterName | default .Release.Name) }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ $clusterName }}
labels:
{{- include "common.resource-labels" . | indent 4 }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: mariadb
app.kubernetes.io/instance: {{ $clusterName }}
policyTypes:
- Ingress
ingress:
- from:
# Accept traffic from other cluster instances
- podSelector:
matchLabels:
app.kubernetes.io/name: mariadb
app.kubernetes.io/instance: {{ $clusterName }}
- from:
# Accept traffic from operator
- podSelector:
matchLabels:
app.kubernetes.io/name: mariadb-operator
app.kubernetes.io/instance: mariadb-operator
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: mariadb-system
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions apps/common/templates/_network-policies.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@
port: {{ .port }}
{{- end }}

{{- define "common.ingress-kubeapi-webhook" }}
- from:
{{- range untilStep 0 255 1 }}
- ipBlock:
cidr: {{ $.Values.networkPolicy.kubeApiWebhookSubnetPrefix }}.{{ . }}.0/32
{{- end }}
ports:
- protocol: {{ .protocol | default "TCP" }}
port: {{ .port }}
{{- end }}


{{- define "common.egress-kubeapi" }}
- to:
{{- range $node := .Values.networkPolicy.kubeApiNodes }}
Expand Down
1 change: 1 addition & 0 deletions apps/common/values.lab.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
networkPolicy:
kubeApiWebhookSubnetPrefix: 172.16
kubeApiService: 172.17.0.1
kubeApiNodes:
- 10.1.8.21
Expand Down
1 change: 1 addition & 0 deletions apps/common/values.prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
networkPolicy:
kubeApiWebhookSubnetPrefix: 172.16
kubeApiService: 172.17.0.1
kubeApiNodes:
- 10.1.2.21
Expand Down
16,592 changes: 16,592 additions & 0 deletions apps/mariadb-operator-crd/crds.yml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions apps/mariadb-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: mariadb-operator
version: 1.0.0

dependencies:
- name: common
version: 1.0.0
repository: file://../common

- name: mariadb-operator
repository: https://mariadb-operator.github.io/mariadb-operator
version: 0.22.0
16 changes: 16 additions & 0 deletions apps/mariadb-operator/templates/network-policy-operator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ $.Release.Name }}-operator
namespace: {{ $.Release.Namespace }}
labels:
{{- include "common.resource-labels" . | indent 4 }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: mariadb-operator
app.kubernetes.io/instance: {{ $.Release.Name }}
egress:
{{- include "common.egress-kubeapi" . | nindent 4 }}
policyTypes:
- Egress
33 changes: 33 additions & 0 deletions apps/mariadb-operator/templates/network-policy-webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ $.Release.Name }}-webhook
namespace: {{ $.Release.Namespace }}
labels:
{{- include "common.resource-labels" . | indent 4 }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: mariadb-operator-webhook
app.kubernetes.io/instance: {{ $.Release.Name }}
ingress:
# Accept webhooks from Kube API
{{- include "common.ingress-kubeapi" (dict "port" 10250 "Values" $.Values) | nindent 4 }}
{{- include "common.ingress-kubeapi-webhook" (dict "port" 10250 "Values" $.Values) | nindent 4 }}

# Accept calls from operator
- ports:
- protocol: TCP
port: 10250
- protocol: TCP
port: 443
from:
- podSelector:
matchLabels:
app.kubernetes.io/name: mariadb-operator
app.kubernetes.io/instance: {{ .Release.Name }}
egress:
{{- include "common.egress-kubeapi" . | nindent 4 }}
policyTypes:
- Ingress
- Egress
12 changes: 12 additions & 0 deletions apps/mariadb-operator/values.lab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mariadb-operator:
tolerations:
- key: homecentr.one/critical-only
operator: Exists
effect: NoSchedule
webhook:
certificate:
certManager: true
tolerations:
- key: homecentr.one/critical-only
operator: Exists
effect: NoSchedule
12 changes: 12 additions & 0 deletions apps/mariadb-operator/values.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mariadb-operator:
tolerations:
- key: homecentr.one/critical-only
operator: Exists
effect: NoSchedule
webhook:
certificate:
certManager: true
tolerations:
- key: homecentr.one/critical-only
operator: Exists
effect: NoSchedule
8 changes: 8 additions & 0 deletions apps/mariadb-shared-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v2
name: mariadb-shared-cluster
version: 1.0.0

dependencies:
- name: common
version: 1.0.0
repository: file://../common
34 changes: 34 additions & 0 deletions apps/mariadb-shared-cluster/secrets.lab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
rootUser:
password: ENC[AES256_GCM,data:kgQkZpbw1qc/6eOVbvG/D7LL5oJ+fJHhQOtW6oZlr9WGYHsTfiEK/x/oW7/9WI6Wmuh4501GSA==,iv:7adcPUUC8B8+Oo2XWFmJJ97hpJ60OmQfOJ+lZjLpQbA=,tag:uTTXJul/cbZQ7u+ubW6LCg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1zw6c356patclh7q8cq5a99cghpzmnufgtwfaa0tmcg87a038d9ms4xpytn
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBOV2J0Mks5YjBQWUFzSEJr
NE1ac2NzcDZZRFlsb1F6QkhHR2I2SCtHbmdJCmlVOFBQMDlDRXVpSUZaVUNwcmRV
V0VzNWd0dVhrTU9PRlFjemMzMUhjL2cKLS0tIGpla2tvMnVVWGZZNk5tb0x4L0hT
bjVqNG5zUXgrdlhmMDZVTEZZRFhFeTAKQ3so+dPaucHcOQwFxqxhMfCPwlCdMRUY
tEgGT8q3FjKyR6jYXuDin86DfVZ6ZFcJnCaLq5K/y7KJRTRzy+kE2A==
-----END AGE ENCRYPTED FILE-----
- recipient: age1thhmcq56csqrrd07eymtau54xl620yw6qkjykc8tvpyr975v03zqhq5uz4
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBwVUhoUE1WL3g2ZUNxd0Qz
cWNYc081ekVBRVlVRGwyL3JzU2FPK1psQ2k0CmM0NWhheThCZGt5NXl4R1g0YnJN
T2N1aHRWM1dMWlk0Z0NPcmk3Z2hna00KLS0tIGZ4THhtWU9taEx5SXU3UjFKam5x
REZCSXV3NW9LcUZ1cHBld2dZakhCOU0KHy2yGjgHeOEmDaPUML4LsFqLyRulFc6D
CYvNfcatZExHDosTj7WQbj3GtiXqV9kGj6HpfEDN38LzJdBMQceEVA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-11-13T12:37:47Z"
mac: ENC[AES256_GCM,data:A7mGWsKaA34LMLjK7RsNl9oZPYxbD2QW0BR5V8+cDmW2paqb0o6Lzf2KdUcSFIacBlvcyEe3FCQZUtaBjEpYbBjdl21wRJsbgKrKIPix9/+3k5kiRj7BecV4o9nsaRLmrw0pcJRPQV4K49xJep/3Psx1AwAXVCmktI2xuPGG9zw=,iv:iMaE+PLGubVELd/K1nNc03Xs+vDpjuy6OQ0qyYAA/Ug=,tag:ZmzwoZM/t2Y4DSnPCpyZzQ==,type:str]
pgp:
- created_at: "2023-11-13T12:28:45Z"
enc: "-----BEGIN PGP MESSAGE-----\r\n\r\nhQIMA7Pg+ndCcR5CAQ//d7ZDPRVcUloWJPFKupVu0SlimhQyqpHLG/kFfTV2GdsU\r\n07jKobK/3td7MCGNA4RsKk4txIuG7H5b/35F9zC7Sw9u/l9xQHdmMyA/5n6NANHn\r\n09nVxdW+FyQF5WWsc7YE8KVebQaAukHgUvtV2LVreJlbwJHr3eej54SJO56M9K9R\r\nI6DRZ1SELuxpyROEa9WyYXQ2awHPHJIaqRIBLVFAEsRH/4oZ6rbK6t9f4pXGfJD6\r\nZhVqMm/p+9sPaTxa0zFVl0QjIIKgK+jPv6O5kJeUFPBZ0Fr+Nqak1/OGNjS5jBPH\r\nbzD/+nqzZKve0E94exCL3EFIkwIsScwt+PJmKvguLiZqD7+vB4RBtaEut/SpvdIA\r\nFWYcYJO/MUkAtIuBLJBHcaplAI5tiYcqkfo0WA+xPUKuQEAPC4uMkScU7+CIVvVm\r\ngfsuk/wMnp/JyAOuF259iVXKtzZrUqpibTXqegyalyKD4Py+jCxFKQzpZ+aHLiur\r\nAQF8r/NjDhMqu+zv/+5jawqubkvo7UyGWGVjJBurPMmlizMs6Wc0COpjNBw9e7lo\r\nRoFuiVsv1JcsHepWcnVYtuc7szeFbtNWm0i2UBYaPHmrKFZjQTEoqNdz0Qp2mECp\r\njyid9M0s7v1I4bdtgFv2WxicPsjwTLVVbNoFE4abIZG4sR73Z7cyqzIVopyuKUXS\r\nXgFsx7zAMqKlJ3cO0l9AX7FSkOhnNYt+eZj31A13pTvDZnUsYpbRp1iI8R2xWCJX\r\nlIlYAVpZJejqf+YnkbsSdrMGGrBL4OFgo3K2C79zopI1qd13z9aZfIjqw5mBnc0=\r\n=nsh/\r\n-----END PGP MESSAGE-----\r\n"
fp: 2D1D9C803F35BBC24014C3906601E1EB2454827F
unencrypted_suffix: _unencrypted
version: 3.7.3
34 changes: 34 additions & 0 deletions apps/mariadb-shared-cluster/secrets.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
rootUser:
password: ENC[AES256_GCM,data:pDcLydZxrZe0ALXMCAnTLOIvnGwbRF991p5wCrl5zqXbSR8vdAChwBa3fs+J5vrdqr1WXY4xag==,iv:wPspVqUZvI0+cGwC7J8PII+4xcPg1a50Sb1lpfO4HJA=,tag:XuFqEylZR2XSDh+wnBFiUQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1zw6c356patclh7q8cq5a99cghpzmnufgtwfaa0tmcg87a038d9ms4xpytn
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsbE8rQzQwN1RKbHI4eDN2
K3ZxVTlZSWtqSmxEei8rQTQ3Rm9YQXVRWG1BCnQxQ1kvWVlkVnlIOFBPSWJPdDQ2
Uyt1Lyt0a2dOY3lxSTdCbkhMSzBhN2MKLS0tIFhTckxlR0ZjdXViSXZrdDBOZTlt
NmFQeEFmSit2OXphSm93RXNNVGdacFEK6Iv6Kdydcy4eEhQ6HXj3PIykXpgNzHTw
Bp/HuZufWmuzT4GhW9CfccSH5bfMbIjlJTsln7cfsy6Q0ysV4Yp1XA==
-----END AGE ENCRYPTED FILE-----
- recipient: age1jaxd6qpsycvekhveuvqs6v80hn235zye2s0uj0rlm4nety646ahsfp2u6e
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4dk1UTy9sZjRaN2kzUUdN
cm1pL0hCSGhMNFpjcDV3ZFIrdlRlWGdNcnlVClBQaVplcnpSYzZHTkNKQTFFMWFn
dEJEb0FFK0tpYUlPd1ZzbkJjL1hvR28KLS0tIE5DQVN5QnNXcTY2KzUxa0JQRWZp
NklFTUFyNklRRlVWa1BMU3JPOFZHMTAKc/LeYA7TtseQD9qNsQ5lQHyJMeIMLlR3
wk6qViY8xjr6AsMKOUrxhRlaykMAVp7NNCgHWXDradyUZtrFkmenng==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-11-13T20:41:42Z"
mac: ENC[AES256_GCM,data:E05g9vHeBNC9oSLdGlOdrAIHguDchxXBE3MLz9r+RuFYhB5D9X3+16LuBgmzWAHSKXjhZpW3owKrczcaN4iOMWQ3MnYzNhHCderfyO79fSbVb30GrdHsuTLCWsiOktSjH0Rp58ul64CszK5NAszqnKHudXhaGRaD835R4qlCxfM=,iv:QLf3gjzzdr5evoceFV30PQLuttb0gvq53CV84SnpDGQ=,tag:+vy6D+Wi6uptx4gbY+w7sA==,type:str]
pgp:
- created_at: "2023-11-13T20:41:27Z"
enc: "-----BEGIN PGP MESSAGE-----\r\n\r\nhQIMA7Pg+ndCcR5CARAAonzfQHOFdsD7U4XimCAwdbELoZbxSgMPD1zjgcpaAlnf\r\nfIgCjcLHuc/B8HjydsGbSqM7VMxfONXv+tRSRQmpK7R7NHIiQfOui6NQuH0twrA4\r\nFRlLgcg3pjwD4oitcu9x4bRThTUrHdkSbnQCnjIRSysZ2sMJuTFSfNzmxOc1ZIK7\r\nOtPY2OrUydGKRzlJJnJVhAZgspw1nu9gOYLxqsRWg1l7Kxg+GMPZSHXIvTYp2jYv\r\nHFzz/gESpb2EBWB/8WZPdAiU2c/DsMUfoG9EhRqtpDNZ9bQ0RNXSV+fPzy747FD8\r\nEiigjBVlkvBhJe4PVB6UWUxMSSzwVRGKEuSzuGFF5NFSF3b02gbgepEQl8HJTGWL\r\nJhs9gLoYUqDy4+fjMQ2BWH99KsgsbYJAYmwa6KbgxzNDs0Hv78OnDMBUakyV/A+D\r\n+oiKMaL80mQQvvoifFGRoJoy9PlTwrycE+GKbgixvus707h4Zzi+rlXBvn8Fv2O0\r\n0E++xNn9bSJp/Ltp4PHmuh9nbPpUwanYFwRlrM6kocUMQr0Zg/ZrJ9f3w+IRdadL\r\nlQ3kgYUdOu/WY3Z9A8uI+wk01wy3T1QuasQVcqgQIGwS5qDRWFkC7MUvxMN1w8WE\r\niwEE44A9pIrJ6zds0tVqMMefMNtF7fo/fKvILyUj17rwPhBWSwUbWNhmg/9GsTbS\r\nXgHGHhkFq8PidcnxFICUJJTdv1qCf1kUftRsGPt6HINTLp9+/hv9LobNmWDcB2+F\r\nyQhpNr2HqZ4R4JWENwD26GtbQpgEhuWsPhprmjWH9r+qVuGjP9Bgz2PDhfkXPs0=\r\n=gqIh\r\n-----END PGP MESSAGE-----\r\n"
fp: 2D1D9C803F35BBC24014C3906601E1EB2454827F
unencrypted_suffix: _unencrypted
version: 3.7.3
19 changes: 19 additions & 0 deletions apps/mariadb-shared-cluster/templates/backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: mariadb.mmontes.io/v1alpha1
kind: Backup
metadata:
name: {{ .Release.Name }}
spec:
mariaDbRef:
name: {{ .Release.Name }}
schedule:
cron: "0 23 * * *"
suspend: false
maxRetentionDays: 30
storage:
persistentVolumeClaim:
storageClassName: {{ .Values.persistence.backup.storageClassName }}
resources:
requests:
storage: {{ .Values.persistence.backup.requestSize }}
accessModes: {{ .Values.persistence.backup.accessModes | toYaml | nindent 6 }}
resources: {{ .Values.backupResources | toYaml | nindent 4 }}
75 changes: 75 additions & 0 deletions apps/mariadb-shared-cluster/templates/mariadb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
apiVersion: mariadb.mmontes.io/v1alpha1
kind: MariaDB
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "common.resource-labels" . | indent 4 }}
spec:
rootPasswordSecretKeyRef:
name: {{ .Release.Name }}
key: root-user-password

image: mariadb:11.0.3

port: 3306

replicas: 2

replication:
enabled: true
primary:
automaticFailover: true
replica:
connectionTimeout: 10s
connectionRetries: 10
syncTimeout: 10s

connection:
secretName: {{ .Release.Name }}-repl
secretTemplate:
key: dsn

primaryConnection:
secretName: {{ .Release.Name }}-repl-primary
secretTemplate:
key: dsn

secondaryConnection:
secretName: {{ .Release.Name }}-repl-secondary
secretTemplate:
key: dsn

affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"

tolerations:
- key: "mariadb.mmontes.io/ha"
operator: "Exists"
effect: "NoSchedule"

podDisruptionBudget:
maxUnavailable: 66%

updateStrategy:
type: RollingUpdate

myCnf: |
[mariadb]
bind-address=*
default_storage_engine=InnoDB
binlog_format=row
innodb_autoinc_lock_mode=2
max_allowed_packet=256M

resources: {{ .Values.resources | toYaml | nindent 4 }}

# Volume for database data
volumeClaimTemplate:
storageClassName: {{ .Values.persistence.data.storageClassName }}
resources:
requests:
storage: {{ .Values.persistence.data.requestSize }}
accessModes: {{ .Values.persistence.data.accessModes | toYaml | nindent 6 }}
Loading