Skip to content

Sje/kots backup db #12076

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

Closed
wants to merge 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -7740,6 +7740,9 @@ spec:
metadata:
annotations:
checksum/configuration: f96f510015050d9b0165d12f144f5eca5641c065ccbe9c75e64f58e81a9b3d8c
backup.velero.io/backup-volumes: backup
pre.hook.backup.velero.io/command: |
["/bin/bash", "-c", "mysqldump -u root -p$MYSQL_ROOT_PASSWORD --databases $MYSQL_DATABASE gitpod-sessions -h 127.0.0.1 > /backup/mysqldump.sql"]
labels:
app.kubernetes.io/name: mysql
helm.sh/chart: mysql-9.1.2
Expand Down Expand Up @@ -7849,13 +7852,17 @@ spec:
- name: config
mountPath: /opt/bitnami/mysql/conf/my.cnf
subPath: my.cnf
- mountPath: /backup
name: backup
volumes:
- name: config
configMap:
name: mysql
- name: custom-init-scripts
configMap:
name: db-init-scripts
- emptyDir: {}
name: backup
volumeClaimTemplates:
- metadata:
name: data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6831,6 +6831,9 @@ spec:
metadata:
annotations:
checksum/configuration: f96f510015050d9b0165d12f144f5eca5641c065ccbe9c75e64f58e81a9b3d8c
backup.velero.io/backup-volumes: backup
pre.hook.backup.velero.io/command: |
["/bin/bash", "-c", "mysqldump -u root -p$MYSQL_ROOT_PASSWORD --databases $MYSQL_DATABASE gitpod-sessions -h 127.0.0.1 > /backup/mysqldump.sql"]
labels:
app.kubernetes.io/name: mysql
helm.sh/chart: mysql-9.1.2
Expand Down Expand Up @@ -6940,13 +6943,17 @@ spec:
- name: config
mountPath: /opt/bitnami/mysql/conf/my.cnf
subPath: my.cnf
- mountPath: /backup
name: backup
volumes:
- name: config
configMap:
name: mysql
- name: custom-init-scripts
configMap:
name: db-init-scripts
- emptyDir: {}
name: backup
volumeClaimTemplates:
- metadata:
name: data
Expand Down
7 changes: 7 additions & 0 deletions install/installer/cmd/testdata/render/minimal/output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7111,6 +7111,9 @@ spec:
metadata:
annotations:
checksum/configuration: f96f510015050d9b0165d12f144f5eca5641c065ccbe9c75e64f58e81a9b3d8c
backup.velero.io/backup-volumes: backup
pre.hook.backup.velero.io/command: |
["/bin/bash", "-c", "mysqldump -u root -p$MYSQL_ROOT_PASSWORD --databases $MYSQL_DATABASE gitpod-sessions -h 127.0.0.1 > /backup/mysqldump.sql"]
labels:
app.kubernetes.io/name: mysql
helm.sh/chart: mysql-9.1.2
Expand Down Expand Up @@ -7220,13 +7223,17 @@ spec:
- name: config
mountPath: /opt/bitnami/mysql/conf/my.cnf
subPath: my.cnf
- mountPath: /backup
name: backup
volumes:
- name: config
configMap:
name: mysql
- name: custom-init-scripts
configMap:
name: db-init-scripts
- emptyDir: {}
name: backup
volumeClaimTemplates:
- metadata:
name: data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7123,6 +7123,9 @@ spec:
metadata:
annotations:
checksum/configuration: f96f510015050d9b0165d12f144f5eca5641c065ccbe9c75e64f58e81a9b3d8c
backup.velero.io/backup-volumes: backup
pre.hook.backup.velero.io/command: |
["/bin/bash", "-c", "mysqldump -u root -p$MYSQL_ROOT_PASSWORD --databases $MYSQL_DATABASE gitpod-sessions -h 127.0.0.1 > /backup/mysqldump.sql"]
labels:
app.kubernetes.io/name: mysql
helm.sh/chart: mysql-9.1.2
Expand Down Expand Up @@ -7232,13 +7235,17 @@ spec:
- name: config
mountPath: /opt/bitnami/mysql/conf/my.cnf
subPath: my.cnf
- mountPath: /backup
name: backup
volumes:
- name: config
configMap:
name: mysql
- name: custom-init-scripts
configMap:
name: db-init-scripts
- emptyDir: {}
name: backup
volumeClaimTemplates:
- metadata:
name: data
Expand Down
14 changes: 13 additions & 1 deletion install/installer/third_party/charts/mysql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ mysql:
# We switched to the specific version because "5.7" was broken at least once
tag: 5.7.34-debian-10-r55
primary:
# Backup settings
podAnnotations:
backup.velero.io/backup-volumes: backup
pre.hook.backup.velero.io/command: |
["/bin/bash", "-c", "mysqldump -u root -p$MYSQL_ROOT_PASSWORD --databases $MYSQL_DATABASE gitpod-sessions -h 127.0.0.1 > /backup/mysqldump.sql"]
extraVolumes:
- name: backup
emptyDir: {}
extraVolumeMounts:
- name: backup
mountPath: /backup
# End of backup settings
extraEnvVars:
# We rely on this in our DB implementations: NULL (re-)sets configured columns to be initialized with CURRENT_TIMESTAMP.
# OFF is the default as documented [here](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp) (we also see this in GCP), but not for this chart.
Expand All @@ -19,4 +31,4 @@ mysql:
serviceAccount:
create: false
volumePermissions:
enabled: true
enabled: true
2 changes: 2 additions & 0 deletions install/kots/manifests/gitpod-certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ spec:
labels:
app: gitpod
component: gitpod-installer
kots.io/app-slug: '{{repl LicenseFieldValue "appSlug" }}'
kots.io/backup: velero
2 changes: 1 addition & 1 deletion install/kots/manifests/gitpod-installation-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
containers:
- name: installation-status
# This will normally be the release tag
image: "eu.gcr.io/gitpod-core-dev/build/installer:nvn-fix-11408.15"
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-kots-backup.33"
command:
- /bin/sh
- -c
Expand Down
2 changes: 1 addition & 1 deletion install/kots/manifests/gitpod-installer-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
containers:
- name: installer
# This will normally be the release tag
image: "eu.gcr.io/gitpod-core-dev/build/installer:nvn-fix-11408.15"
image: "eu.gcr.io/gitpod-core-dev/build/installer:sje-kots-backup.33"
volumeMounts:
- mountPath: /config-patch
name: config-patch
Expand Down
8 changes: 8 additions & 0 deletions install/kots/manifests/kots-backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2022 Gitpod GmbH. All rights reserved.
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.

apiVersion: velero.io/v1
kind: Backup
metadata:
name: backup
spec: {}