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

Add sql db snapshots #138

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
minikube-start:
# version 1.21.4 is currently used in the production environments
minikube --profile minikube-wbaas start --kubernetes-version=1.21.4
minikube --profile minikube-wbaas addons enable volumesnapshots
minikube --profile minikube-wbaas addons enable csi-hostpath-driver

minikube-stop:
minikube --profile minikube-wbaas stop
Expand Down
2 changes: 1 addition & 1 deletion k8s/helmfile/env/local/private.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
toolWidar: 11

sql:
storageClass: standard
storageClass: csi-hostpath-sc
storageSize: 1Gi
api:
db: apidb
Expand Down
17 changes: 17 additions & 0 deletions k8s/helmfile/env/local/raw.values.yaml.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resources:
- apiVersion: snapscheduler.backube/v1
kind: SnapshotSchedule
metadata:
name: sql-backups
namespace: default
spec:
claimSelector:
matchLabels:
"app.kubernetes.io/component": "primary"
"app.kubernetes.io/instance": "sql"
"app.kubernetes.io/name": "mariadb"
retention:
expires: 48h
schedule: "@daily"
snapshotTemplate:
snapshotClassName: csi-hostpath-snapclass # TODO set this for the prod snapshots
3 changes: 3 additions & 0 deletions k8s/helmfile/env/local/sql.values.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ auth:
forcePassword: true
existingSecret: sql-secrets-passwords

volumePermissions:
enabled: true # this doesn't seem to actually do what it promises in minikube :(

primary:
extraEnvVarsSecret: sql-secrets-init-passwords
resources:
Expand Down
10 changes: 10 additions & 0 deletions k8s/helmfile/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ repositories:
url: https://helm.elastic.co
- name: codecentric
url: https://codecentric.github.io/helm-charts
- name: bedag
url: https://bedag.github.io/helm-charts/

environments:
default:
Expand All @@ -35,6 +37,7 @@ helmfiles:
- path: cert-manager.yaml
values:
- foo: null
- path: snapscheduler.yaml

releases:
################################
Expand Down Expand Up @@ -189,6 +192,13 @@ releases:
values:
- "env/{{ .Environment.Name }}/tool-quickstatements.values.yaml.gotmpl"

- name: raw-k8s-resources
namespace: default
chart: bedag/raw
version: 1.1.0
values:
- "env/{{ .Environment.Name }}/raw.values.yaml.gotmpl"

################################
# LOCAL ONLY
################################
Expand Down
15 changes: 15 additions & 0 deletions k8s/helmfile/snapscheduler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repositories:
- name: backube
url: https://backube.github.io/helm-charts/

environments:
staging:
kubeContext: gke_wikibase-cloud_europe-west3-a_wbaas-2
local:
kubeContext: minikube-wbaas

releases:
- name: snapscheduler
namespace: default
chart: backube/snapscheduler
version: 2.1.0