Skip to content

Commit b759896

Browse files
authored
feat: one backend obj for all apps (#1640)
1 parent 5be31fd commit b759896

29 files changed

+5068
-1041
lines changed

chart/otomi/values.schema.json

+4,690
Large diffs are not rendered by default.

charts/otomi-db/templates/cluster.yaml

+7-29
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
backup:
4545
retentionPolicy: {{ .Values.backup.retentionPolicy }}
4646
barmanObjectStore:
47-
destinationPath: s3://database
47+
destinationPath: {{ .Values.backup.minioLocal.destinationPath }}
4848
endpointURL: "http://minio.minio.svc.cluster.local:9000"
4949
s3Credentials:
5050
accessKeyId:
@@ -54,44 +54,22 @@ spec:
5454
name: minio-creds
5555
key: MINIO_SECRET_KEY
5656
{{- end }}
57-
{{- if eq .Values.backup.type "azure" }}
57+
{{- if eq .Values.backup.type "linode" }}
5858
backup:
5959
retentionPolicy: {{ .Values.backup.retentionPolicy }}
6060
barmanObjectStore:
61-
destinationPath: "https://{{ .Values.backup.azure.accountName }}.blob.core.windows.net/{{ .Values.backup.azure.containerName }}"
62-
azureCredentials:
63-
storageAccount:
64-
name: azure-creds
65-
key: AZURE_STORAGE_ACCOUNT
66-
storageKey:
67-
name: azure-creds
68-
key: AZURE_STORAGE_KEY
69-
{{- end }}
70-
{{- if eq .Values.backup.type "s3" }}
71-
backup:
72-
retentionPolicy: {{ .Values.backup.retentionPolicy }}
73-
barmanObjectStore:
74-
destinationPath: s3://{{ .Values.backup.s3.bucket }}
75-
endpointURL: {{ .Values.backup.s3.endpointURL }}
61+
destinationPath: {{ .Values.backup.linode.destinationPath }}
62+
endpointURL: {{ .Values.backup.linode.endpointURL }}
7663
s3Credentials:
7764
accessKeyId:
78-
name: s3-creds
65+
name: linode-creds
7966
key: S3_STORAGE_ACCOUNT
8067
secretAccessKey:
81-
name: s3-creds
68+
name: linode-creds
8269
key: S3_STORAGE_KEY
8370
{{- end }}
84-
{{- if eq .Values.backup.type "gcs" }}
85-
backup:
86-
retentionPolicy: {{ .Values.backup.retentionPolicy }}
87-
barmanObjectStore:
88-
destinationPath: "gs://{{ .Values.backup.gcs.bucket }}"
89-
googleCredentials:
90-
applicationCredentials:
91-
name: gcs-creds
92-
key: gcsCredentials
93-
{{- end }}
9471
{{- end }}
72+
9573
{{- with .Values.clusterSpec }}
9674
{{- toYaml . | nindent 2 }}
9775
{{- end }}

charts/otomi-db/values.yaml

+4-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ clusterAffinity:
1919
topologyKey: kubernetes.io/hostname
2020
podAntiAffinityType: preferred
2121

22-
2322
# Example for backups:
2423
# clusterBackup:
2524
# backup:
@@ -34,8 +33,6 @@ clusterAffinity:
3433
# name: minio-creds
3534
# key: MINIO_SECRET_KEY
3635

37-
38-
3936
clusterSpec:
4037
bootstrap:
4138
initdb:
@@ -51,11 +48,7 @@ backup:
5148
backupOwnerReference: none
5249
retentionPolicy: 7d
5350
type: minioLocal
54-
azure:
55-
storageAccount: ""
56-
container: ""
57-
s3:
58-
endpointURL: ""
59-
bucket: ""
60-
gcs:
61-
bucket: ""
51+
minioLocal:
52+
destinationPath: ""
53+
linode:
54+
destinationPath: ""

charts/velero/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ spec:
229229
{{- end }}
230230
{{- with .Values.credentials.extraEnvVars }}
231231
{{- range $key, $value := . }}
232-
- name: {{ default "none" $key }}
232+
- name: {{ default "none" (upper $key) }}
233233
valueFrom:
234234
secretKeyRef:
235235
name: {{ include "velero.secretName" $ }}

helmfile.d/snippets/defaults.yaml

+14-9
Original file line numberDiff line numberDiff line change
@@ -691,24 +691,29 @@ environments:
691691
requests:
692692
cpu: 50m
693693
memory: 256Mi
694+
obj:
695+
provider:
696+
type: disabled
697+
bucket:
698+
loki: loki
699+
cnpg: cnpg
700+
velero: velero
701+
harbor: harbor
702+
tempo: tempo
694703
platformBackups:
695704
database:
696705
harbor:
697706
enabled: false
698-
persistentVolumes:
699707
gitea:
700708
enabled: false
701-
drone:
702-
enabled: false
703709
keycloak:
704710
enabled: false
705-
harbor:
706-
enabled: false
707-
argo:
708-
enabled: false
709-
minio:
711+
persistentVolumes:
712+
gitea:
710713
enabled: false
711-
cluster: {}
714+
cluster:
715+
provider: linode
716+
name: apl
712717
dns:
713718
domainFilters: []
714719
zoneIdFilters: []

tests/fixtures/env/apps/cnpg.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,3 @@ apps:
77
requests:
88
cpu: 100m
99
memory: 200Mi
10-
storage:
11-
s3:
12-
accessKeyId: 2C2F1864-3ADB-4D06-8F77-C82CAB6F0415
13-
bucket: databases/
14-
s3Url: https://nl-ams-1.linodeobjects.com
15-
type: s3

tests/fixtures/env/apps/harbor.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
apps:
22
harbor:
33
enabled: true
4-
persistence:
5-
imageChartStorage:
6-
gcs:
7-
bucket: otomi-harbor
8-
rootdirectory: /google/demo
9-
type: gcs
104
core: {}
115
registry:
126
credentials: {}

tests/fixtures/env/apps/loki.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,4 @@ apps:
8383
retention:
8484
duration: 24h
8585
period: 24h
86-
storage:
87-
s3:
88-
bucket: my-bucket
89-
region: west-eu
90-
useInstanceRole: true
91-
type: s3
9286
v11StartDate: 2021-05-13

tests/fixtures/env/apps/secrets.cnpg.yaml

-5
This file was deleted.

tests/fixtures/env/apps/secrets.harbor.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
apps:
22
harbor:
33
adminPassword: harborsomesecretvalue
4-
persistence:
5-
imageChartStorage:
6-
gcs:
7-
encodedkey: somesecretvalue
84
secretKey: somesecretvalue
95
core:
106
secret: vQFMm9Qk0pTUF3MK

tests/fixtures/env/apps/secrets.velero.yaml

-7
This file was deleted.

tests/fixtures/env/apps/tempo.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
apps:
22
tempo:
33
enabled: true
4-
storage:
5-
type: minioLocal
6-
# azure:
7-
# accountName: account_name
8-
# containerName: container_name
9-
# accountKey: shshsheyeywywiqwioqw
104
autoscaling:
115
ingester:
126
enabled: true

tests/fixtures/env/apps/velero.yaml

-24
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,3 @@ apps:
33
enabled: true
44
restic:
55
enabled: false
6-
cloud:
7-
# azure:
8-
# resourceGroup: test
9-
# environment: AzurePublicCloud
10-
# subscriptionId: test
11-
# tenantId: test
12-
# aadClientId: bla12344556666658457847476
13-
# aadClientSecret: bla383736363653
14-
# type: azure
15-
# storage:
16-
# azureBlob:
17-
# storageAccount: bla
18-
# bucket: velero
19-
# resourceGroup: bla
20-
# type: azureBlob
21-
google:
22-
project: velero
23-
serviceAccount: bla
24-
type: google
25-
storage:
26-
gcs:
27-
bucket: velero
28-
serviceAccount: bla
29-
type: gcs

tests/fixtures/env/cluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ cluster:
44
k8sContext: otomi-eks-demo
55
name: demo
66
owner: redkubes
7-
provider: azure
7+
provider: linode

tests/fixtures/env/secrets.settings.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,14 @@ otomi:
2424
password: blablabla
2525
smtp:
2626
auth_password: somesecretvalue
27+
obj:
28+
provider:
29+
# s3:
30+
# secretAccessKey: somesecretvalue
31+
linode:
32+
secretAccessKey: somesecretvalue
33+
# azureBlob:
34+
# aadClientSecret: somesecretvalue
35+
platformBackups:
36+
persistentVolumes:
37+
linodeApiToken: justanapitokenhere

tests/fixtures/env/settings.yaml

+23-11
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ otomi:
6161
additionalClusters:
6262
- domainSuffix: demo.eks.otomi.cloud
6363
name: demo
64-
provider: aws
64+
provider: custom
6565
globalPullSecret:
6666
username: otomi
6767
hasExternalDNS: true
@@ -76,19 +76,31 @@ platformBackups:
7676
enabled: true
7777
retentionPolicy: 7d
7878
schedule: 0 0 0 * * *
79+
keycloak:
80+
enabled: true
81+
retentionPolicy: 7d
82+
schedule: 0 0 0 * * *
83+
gitea:
84+
enabled: true
85+
retentionPolicy: 7d
86+
schedule: 0 0 0 * * *
7987
persistentVolumes:
80-
argo:
81-
enabled: false
82-
drone:
83-
enabled: false
8488
gitea:
8589
enabled: false
86-
harbor:
87-
enabled: false
88-
keycloak:
89-
enabled: false
90-
minio:
91-
enabled: false
90+
obj:
91+
bucket:
92+
loki: loki
93+
cnpg: cnpg
94+
velero: velero
95+
harbor: harbor
96+
tempo: tempo
97+
provider:
98+
# type: minioLocal
99+
linode:
100+
region: nl-ams-1
101+
accessKeyId: someaccessKeyId
102+
type: linode
103+
# type: disabled
92104
smtp:
93105
auth_username: [email protected]
94106

0 commit comments

Comments
 (0)