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

feat: one backend obj for all apps #1640

Merged
merged 27 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6039953
fix: rm pv platform backup
srodenhuis Jul 4, 2024
d91b98e
fix: schema
srodenhuis Jul 4, 2024
11acedf
feat: one backend obj for all apps
srodenhuis Jul 5, 2024
0b0beac
fix: dest path
srodenhuis Jul 7, 2024
341f609
fix: s3enforce
srodenhuis Jul 7, 2024
207cc3b
fix: set sconfig
srodenhuis Jul 7, 2024
47249a5
fix: ship path
srodenhuis Jul 7, 2024
55775f1
fix: versions
srodenhuis Jul 9, 2024
541680e
Merge branch 'main' into sr-storage-backup-refactor
srodenhuis Jul 9, 2024
93a2689
fix: tempo bucket
srodenhuis Jul 9, 2024
f1c9599
fix: chunck size
srodenhuis Jul 9, 2024
7fbfb4e
fix: dec chunck size
srodenhuis Jul 9, 2024
099ccd5
fix: restore chunck size
srodenhuis Jul 9, 2024
24a34c7
fix: multipartcopythresholdsize
srodenhuis Jul 10, 2024
fcee338
fix: velero linode plugin
srodenhuis Jul 11, 2024
61a60d4
fix: velero linode plugin
srodenhuis Jul 11, 2024
09a3b65
fix: fixtures
srodenhuis Jul 11, 2024
b4226fc
fix: opt key
srodenhuis Jul 11, 2024
df52fdb
fix: str loc
srodenhuis Jul 11, 2024
ba869c3
fix: add gitea pv backup
srodenhuis Jul 15, 2024
c3e1a9d
fix: obj needs to be enabled for db backup
srodenhuis Jul 15, 2024
b6c2e0b
fix: velero depl env upper
srodenhuis Jul 16, 2024
532a15d
fix: use local when not obj
srodenhuis Jul 17, 2024
7a7dacf
fix: fixtures
srodenhuis Jul 17, 2024
9b42c06
Merge branch 'main' into sr-storage-backup-refactor
srodenhuis Jul 17, 2024
5b2776b
fix: val validation
srodenhuis Jul 18, 2024
d9eefc6
Merge branch 'main' into sr-storage-backup-refactor
srodenhuis Jul 18, 2024
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
4,690 changes: 4,690 additions & 0 deletions chart/otomi/values.schema.json

Large diffs are not rendered by default.

36 changes: 7 additions & 29 deletions charts/otomi-db/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
backup:
retentionPolicy: {{ .Values.backup.retentionPolicy }}
barmanObjectStore:
destinationPath: s3://database
destinationPath: {{ .Values.backup.minioLocal.destinationPath }}
endpointURL: "http://minio.minio.svc.cluster.local:9000"
s3Credentials:
accessKeyId:
Expand All @@ -54,44 +54,22 @@ spec:
name: minio-creds
key: MINIO_SECRET_KEY
{{- end }}
{{- if eq .Values.backup.type "azure" }}
{{- if eq .Values.backup.type "linode" }}
backup:
retentionPolicy: {{ .Values.backup.retentionPolicy }}
barmanObjectStore:
destinationPath: "https://{{ .Values.backup.azure.accountName }}.blob.core.windows.net/{{ .Values.backup.azure.containerName }}"
azureCredentials:
storageAccount:
name: azure-creds
key: AZURE_STORAGE_ACCOUNT
storageKey:
name: azure-creds
key: AZURE_STORAGE_KEY
{{- end }}
{{- if eq .Values.backup.type "s3" }}
backup:
retentionPolicy: {{ .Values.backup.retentionPolicy }}
barmanObjectStore:
destinationPath: s3://{{ .Values.backup.s3.bucket }}
endpointURL: {{ .Values.backup.s3.endpointURL }}
destinationPath: {{ .Values.backup.linode.destinationPath }}
endpointURL: {{ .Values.backup.linode.endpointURL }}
s3Credentials:
accessKeyId:
name: s3-creds
name: linode-creds
key: S3_STORAGE_ACCOUNT
secretAccessKey:
name: s3-creds
name: linode-creds
key: S3_STORAGE_KEY
{{- end }}
{{- if eq .Values.backup.type "gcs" }}
backup:
retentionPolicy: {{ .Values.backup.retentionPolicy }}
barmanObjectStore:
destinationPath: "gs://{{ .Values.backup.gcs.bucket }}"
googleCredentials:
applicationCredentials:
name: gcs-creds
key: gcsCredentials
{{- end }}
{{- end }}

{{- with .Values.clusterSpec }}
{{- toYaml . | nindent 2 }}
{{- end }}
15 changes: 4 additions & 11 deletions charts/otomi-db/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ clusterAffinity:
topologyKey: kubernetes.io/hostname
podAntiAffinityType: preferred


# Example for backups:
# clusterBackup:
# backup:
Expand All @@ -34,8 +33,6 @@ clusterAffinity:
# name: minio-creds
# key: MINIO_SECRET_KEY



clusterSpec:
bootstrap:
initdb:
Expand All @@ -51,11 +48,7 @@ backup:
backupOwnerReference: none
retentionPolicy: 7d
type: minioLocal
azure:
storageAccount: ""
container: ""
s3:
endpointURL: ""
bucket: ""
gcs:
bucket: ""
minioLocal:
destinationPath: ""
linode:
destinationPath: ""
2 changes: 1 addition & 1 deletion charts/velero/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "velero.secretName" $ }}
key: {{ default "none" $key }}
key: {{ default "none" $value }}
{{- end }}
{{- end }}
{{- if .Values.lifecycle }}
Expand Down
3 changes: 0 additions & 3 deletions charts/velero/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ data:
{{- range $key, $value := .Values.credentials.secretContents }}
{{ $key }}: {{ tpl $value $ | b64enc | quote }}
{{- end }}
{{- range $key, $value := .Values.credentials.extraEnvVars }}
{{ $key }}: {{ tpl $value $ | b64enc | quote }}
{{- end }}
{{- end -}}
11 changes: 10 additions & 1 deletion helmfile.d/snippets/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,17 @@ environments:
requests:
cpu: 50m
memory: 256Mi
obj:
provider:
type: disabled
platformBackups:
database:
harbor:
enabled: false
gitea:
enabled: false
keycloak:
enabled: false
persistentVolumes:
gitea:
enabled: false
Expand All @@ -694,7 +701,9 @@ environments:
enabled: false
minio:
enabled: false
cluster: {}
cluster:
provider: linode
name: apl
dns:
domainFilters: []
zoneIdFilters: []
Expand Down
6 changes: 0 additions & 6 deletions tests/fixtures/env/apps/cnpg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,3 @@ apps:
requests:
cpu: 100m
memory: 200Mi
storage:
s3:
accessKeyId: 2C2F1864-3ADB-4D06-8F77-C82CAB6F0415
bucket: databases/
s3Url: https://nl-ams-1.linodeobjects.com
type: s3
6 changes: 0 additions & 6 deletions tests/fixtures/env/apps/harbor.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apps:
harbor:
enabled: true
persistence:
imageChartStorage:
gcs:
bucket: otomi-harbor
rootdirectory: /google/demo
type: gcs
core: {}
jobservice: {}
registry:
Expand Down
6 changes: 0 additions & 6 deletions tests/fixtures/env/apps/loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,4 @@ apps:
retention:
duration: 24h
period: 24h
storage:
s3:
bucket: my-bucket
region: west-eu
useInstanceRole: true
type: s3
v11StartDate: 2021-05-13
5 changes: 0 additions & 5 deletions tests/fixtures/env/apps/secrets.cnpg.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions tests/fixtures/env/apps/secrets.harbor.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
apps:
harbor:
adminPassword: harborsomesecretvalue
persistence:
imageChartStorage:
gcs:
encodedkey: somesecretvalue
secretKey: somesecretvalue
core:
secret: vQFMm9Qk0pTUF3MK
Expand Down
7 changes: 0 additions & 7 deletions tests/fixtures/env/apps/secrets.velero.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions tests/fixtures/env/apps/tempo.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apps:
tempo:
enabled: true
storage:
type: minioLocal
# azure:
# accountName: account_name
# containerName: container_name
# accountKey: shshsheyeywywiqwioqw
autoscaling:
ingester:
enabled: true
Expand Down
24 changes: 0 additions & 24 deletions tests/fixtures/env/apps/velero.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,3 @@ apps:
enabled: true
restic:
enabled: false
cloud:
# azure:
# resourceGroup: test
# environment: AzurePublicCloud
# subscriptionId: test
# tenantId: test
# aadClientId: bla12344556666658457847476
# aadClientSecret: bla383736363653
# type: azure
# storage:
# azureBlob:
# storageAccount: bla
# bucket: velero
# resourceGroup: bla
# type: azureBlob
google:
project: velero
serviceAccount: bla
type: google
storage:
gcs:
bucket: velero
serviceAccount: bla
type: gcs
2 changes: 1 addition & 1 deletion tests/fixtures/env/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ cluster:
k8sContext: otomi-eks-demo
name: demo
owner: redkubes
provider: azure
provider: linode
region: eu-central-1
11 changes: 11 additions & 0 deletions tests/fixtures/env/secrets.settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,14 @@ otomi:
password: blablabla
smtp:
auth_password: somesecretvalue
obj:
provider:
# s3:
# secretAccessKey: somesecretvalue
linode:
secretAccessKey: somesecretvalue
# azureBlob:
# aadClientSecret: somesecretvalue
platformBackups:
persistentVolumes:
linodeApiToken: justanapitokenhere
33 changes: 22 additions & 11 deletions tests/fixtures/env/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ otomi:
additionalClusters:
- domainSuffix: demo.eks.otomi.cloud
name: demo
provider: aws
provider: custom
globalPullSecret:
username: otomi
hasExternalDNS: true
Expand All @@ -80,19 +80,30 @@ platformBackups:
enabled: true
retentionPolicy: 7d
schedule: 0 0 0 * * *
keycloak:
enabled: true
retentionPolicy: 7d
schedule: 0 0 0 * * *
gitea:
enabled: true
retentionPolicy: 7d
schedule: 0 0 0 * * *
persistentVolumes:
argo:
enabled: false
drone:
enabled: false
gitea:
enabled: false
harbor:
enabled: false
keycloak:
enabled: false
minio:
enabled: false
obj:
bucket:
loki: loki
cnpg: cnpg
velero: velero
harbor: harbor
tempo: tempo
provider:
# type: minioLocal
linode:
region: nl-ams-1
accessKeyId: someaccessKeyId
type: linode
smtp:
auth_username: no-reply@doma.in
from: no-reply@doma.in
Expand Down
Loading
Loading