Skip to content

Commit 6ace30c

Browse files
fix: bucket only linode (#1703)
Co-authored-by: Jehoszafat Zimnowoda <[email protected]>
1 parent 9af2bc6 commit 6ace30c

File tree

11 files changed

+46
-91
lines changed

11 files changed

+46
-91
lines changed

helmfile.d/snippets/defaults.yaml

-9
Original file line numberDiff line numberDiff line change
@@ -786,12 +786,6 @@ environments:
786786
obj:
787787
provider:
788788
type: disabled
789-
buckets:
790-
loki: loki
791-
cnpg: cnpg
792-
velero: velero
793-
harbor: harbor
794-
tempo: tempo
795789
platformBackups:
796790
database:
797791
harbor:
@@ -800,9 +794,6 @@ environments:
800794
enabled: false
801795
keycloak:
802796
enabled: false
803-
persistentVolumes:
804-
gitea:
805-
enabled: false
806797
cluster:
807798
provider: linode
808799
name: apl

tests/fixtures/env/settings.yaml

+6-9
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ kms:
4545
keys: somesecretvalue
4646
tenantId: somesecretvalue
4747
obj:
48-
buckets:
49-
cnpg: my-clusterid-cnpg
50-
harbor: my-clusterid-harbor
51-
loki: my-clusterid-loki
52-
tempo: my-clusterid-tempo
53-
velero: my-clusterid-velero
5448
provider:
5549
linode:
5650
accessKeyId: someaccessKeyId
5751
region: nl-ams-1
52+
buckets:
53+
cnpg: my-clusterid-cnpg
54+
harbor: my-clusterid-harbor
55+
loki: my-clusterid-loki
56+
tempo: my-clusterid-tempo
57+
velero: my-clusterid-velero
5858
type: linode
5959
oidc:
6060
adminGroupID: someAdminGroupID
@@ -88,9 +88,6 @@ platformBackups:
8888
enabled: true
8989
retentionPolicy: 7d
9090
schedule: 0 0 0 * * *
91-
persistentVolumes:
92-
gitea:
93-
enabled: false
9491
smtp:
9592
auth_username: [email protected]
9693

values-changes.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ changes:
286286
- version: 28
287287
deletions:
288288
- 'apps.cnpg.storage'
289+
- 'obj.buckets'
290+
- 'platformBackups.persistentVolumes.gitea'
289291
- 'alerts.drone'
290292
- 'otomi.isHomeMonitored'
291293
- 'home'

values-schema.yaml

+22-33
Original file line numberDiff line numberDiff line change
@@ -2894,22 +2894,11 @@ properties:
28942894
description: Linode API Token
28952895
$ref: '#/definitions/wordCharacterPattern'
28962896
x-secret: ''
2897-
gitea:
2898-
title: Gitea
2899-
properties:
2900-
enabled:
2901-
type: boolean
2902-
default: false
2903-
ttl:
2904-
$ref: '#/definitions/backupTtl'
2905-
schedule:
2906-
$ref: '#/definitions/backupSchedule'
29072897
obj:
29082898
properties:
29092899
provider:
29102900
properties:
29112901
linode:
2912-
additionalProperties: false
29132902
properties:
29142903
region:
29152904
description: The region of the bucket
@@ -2923,6 +2912,28 @@ properties:
29232912
description: The secret of the access key
29242913
$ref: '#/definitions/wordCharacterPattern'
29252914
x-secret: ''
2915+
buckets:
2916+
properties:
2917+
loki:
2918+
type: string
2919+
$ref: '#/definitions/wordCharacterPattern'
2920+
default: loki
2921+
cnpg:
2922+
type: string
2923+
$ref: '#/definitions/wordCharacterPattern'
2924+
default: cnpg
2925+
velero:
2926+
type: string
2927+
$ref: '#/definitions/wordCharacterPattern'
2928+
default: velero
2929+
harbor:
2930+
type: string
2931+
$ref: '#/definitions/wordCharacterPattern'
2932+
default: harbor
2933+
tempo:
2934+
type: string
2935+
$ref: '#/definitions/wordCharacterPattern'
2936+
default: tempo
29262937
required:
29272938
- region
29282939
- accessKeyId
@@ -2934,28 +2945,6 @@ properties:
29342945
- linode
29352946
- disabled
29362947
default: disabled
2937-
buckets:
2938-
properties:
2939-
loki:
2940-
type: string
2941-
$ref: '#/definitions/wordCharacterPattern'
2942-
default: loki
2943-
cnpg:
2944-
type: string
2945-
$ref: '#/definitions/wordCharacterPattern'
2946-
default: cnpg
2947-
velero:
2948-
type: string
2949-
$ref: '#/definitions/wordCharacterPattern'
2950-
default: velero
2951-
harbor:
2952-
type: string
2953-
$ref: '#/definitions/wordCharacterPattern'
2954-
default: harbor
2955-
tempo:
2956-
type: string
2957-
$ref: '#/definitions/wordCharacterPattern'
2958-
default: tempo
29592948
databases:
29602949
properties:
29612950
keycloak:

values/gitea/gitea-otomi-db.gotmpl

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{{- $cnpg := $v.apps.cnpg }}
44
{{- $gdb := $v.databases.gitea }}
55
{{- $obj := $v.obj.provider }}
6-
{{- $bu := $v.obj.buckets }}
76
{{- $b := $v.platformBackups.database.gitea }}
87

98
name: gitea-db
@@ -20,12 +19,12 @@ backup:
2019
type: {{ $obj.type }}
2120
{{- if eq $obj.type "minioLocal" }}
2221
minioLocal:
23-
destinationPath: "s3://{{ $bu.cnpg }}/gitea"
22+
destinationPath: "s3://cnpg/gitea"
2423
{{- end }}
2524
{{- if eq $obj.type "linode" }}
2625
linode:
27-
destinationPath: "s3://{{ $bu.cnpg }}/gitea"
28-
endpointURL: https://{{ $bu.cnpg }}.{{ $obj.linode.region }}.linodeobjects.com
26+
destinationPath: "s3://{{ $obj.linode.buckets.cnpg }}/gitea"
27+
endpointURL: https://{{ $obj.linode.buckets.cnpg }}.{{ $obj.linode.region }}.linodeobjects.com
2928
{{- end }}
3029
{{- end }}
3130
{{- end }}

values/harbor/harbor-otomi-db.gotmpl

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{{- $hdb := $v.databases.harbor }}
33
{{- $cnpg := $v.apps.cnpg }}
44
{{- $obj := $v.obj.provider }}
5-
{{- $bu := $v.obj.buckets }}
65
{{- $b := $v.platformBackups.database.harbor }}
76

87
name: harbor-otomi-db
@@ -19,12 +18,12 @@ backup:
1918
type: {{ $obj.type }}
2019
{{- if eq $obj.type "minioLocal" }}
2120
minioLocal:
22-
destinationPath: "s3://{{ $bu.cnpg }}/harbor"
21+
destinationPath: "s3://cnpg/harbor"
2322
{{- end }}
2423
{{- if eq $obj.type "linode" }}
2524
linode:
26-
destinationPath: "s3://{{ $bu.cnpg }}/harbor"
27-
endpointURL: https://{{ $bu.cnpg }}.{{ $obj.linode.region }}.linodeobjects.com
25+
destinationPath: "s3://{{ $obj.linode.buckets.cnpg }}/harbor"
26+
endpointURL: https://{{ $obj.linode.buckets.cnpg }}.{{ $obj.linode.region }}.linodeobjects.com
2827
{{- end }}
2928
{{- end }}
3029
{{- end }}

values/harbor/harbor.gotmpl

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{{- $h := $v.apps.harbor }}
33
{{- $db := $v.databases.harbor }}
44
{{- $obj := $v.obj.provider }}
5-
{{- $bu := $v.obj.buckets }}
65
{{- $harborDomain := printf "harbor.%s" $v.cluster.domainSuffix }}
76
{{- $notaryDomain := printf "notary.%s" $v.cluster.domainSuffix }}
87
{{- $harborSecretName := ($harborDomain | replace "." "-") }}
@@ -183,7 +182,7 @@ persistence:
183182
v4auth: true
184183
{{- end }}
185184
{{- if eq $obj.type "linode" }}
186-
bucket: {{ $bu.harbor }}
185+
bucket: {{ $obj.linode.buckets.harbor }}
187186
regionendpoint: https://{{ $obj.linode.region }}.linodeobjects.com
188187
accesskey: {{ $obj.linode.accessKeyId }}
189188
secretkey: {{ $obj.linode.secretAccessKey }}

values/keycloak/keycloak-otomi-db.gotmpl

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{{- $cnpg := $v.apps.cnpg }}
44
{{- $kdb := $v.databases.keycloak }}
55
{{- $obj := $v.obj.provider }}
6-
{{- $bu := $v.obj.buckets }}
76
{{- $b := $v.platformBackups.database.keycloak }}
87

98
name: keycloak-db
@@ -20,12 +19,12 @@ backup:
2019
type: {{ $obj.type }}
2120
{{- if eq $obj.type "minioLocal" }}
2221
minioLocal:
23-
destinationPath: "s3://{{ $bu.cnpg }}/keycloak"
22+
destinationPath: "s3://cnpg/keycloak"
2423
{{- end }}
2524
{{- if eq $obj.type "linode" }}
2625
linode:
27-
destinationPath: "s3://{{ $bu.cnpg }}/keycloak"
28-
endpointURL: https://{{ $bu.cnpg }}.{{ $obj.linode.region }}.linodeobjects.com
26+
destinationPath: "s3://{{ $obj.linode.buckets.cnpg }}/keycloak"
27+
endpointURL: https://{{ $obj.linode.buckets.cnpg }}.{{ $obj.linode.region }}.linodeobjects.com
2928
{{- end }}
3029
{{- end }}
3130
{{- end }}

values/loki/loki.gotmpl

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{- $v := .Values -}}
22
{{- $l:= $v.apps.loki }}
33
{{- $obj := $v.obj.provider }}
4-
{{- $bu := $v.obj.buckets }}
54
{{- $useObjectStorage := eq $obj.type "minioLocal" "linode" }}
65

76
nameOverride: loki
@@ -51,11 +50,11 @@ loki:
5150
{{- if $useObjectStorage }}
5251
aws:
5352
{{- if eq $obj.type "minioLocal" }}
54-
s3: http://otomi-admin:{{ $v.otomi.adminPassword }}@minio.minio.svc.cluster.local.:9000/{{ $bu.loki }}
53+
s3: http://otomi-admin:{{ $v.otomi.adminPassword }}@minio.minio.svc.cluster.local.:9000/loki
5554
s3forcepathstyle: true
5655
{{- end }}
5756
{{- if eq $obj.type "linode" }}
58-
s3: https://{{ $obj.linode.accessKeyId }}:{{ $obj.linode.secretAccessKey }}@{{ $obj.linode.region }}.linodeobjects.com/{{ $bu.loki }}
57+
s3: https://{{ $obj.linode.accessKeyId }}:{{ $obj.linode.secretAccessKey }}@{{ $obj.linode.region }}.linodeobjects.com/{{ $obj.linode.buckets.loki }}
5958
s3forcepathstyle: true
6059
sse_encryption: false
6160
http_config:

values/tempo/tempo.gotmpl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{- $v := .Values -}}
22
{{- $t:= $v.apps.tempo }}
33
{{- $obj := $v.obj.provider }}
4-
{{- $bu := $v.obj.buckets }}
54

65

76
fullnameOverride: tempo
@@ -80,7 +79,7 @@ storage:
8079
{{- end }}
8180
{{- if eq $obj.type "linode" }}
8281
s3:
83-
bucket: {{ $bu.tempo }}
82+
bucket: {{ $obj.linode.buckets.tempo }}
8483
endpoint: {{ $obj.linode.region }}.linodeobjects.com
8584
access_key: {{ $obj.linode.accessKeyId }}
8685
secret_key: {{ $obj.linode.secretAccessKey }}

values/velero/velero.gotmpl

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{- $v := .Values }}
22
{{- $vl := $v.apps.velero }}
33
{{- $obj := $v.obj.provider }}
4-
{{- $bu := $v.obj.buckets }}
54
{{- $b := $v.platformBackups.persistentVolumes }}
65

76
resources: {{- $vl.resources | toYaml | nindent 2 }}
@@ -64,7 +63,7 @@ configuration:
6463
- name: apl-minio
6564
provider: aws
6665
default: true
67-
bucket: {{ $bu.velero}}
66+
bucket: velero
6867
config:
6968
s3Url: http://minio.minio.svc.cluster.local:9000
7069
publicUrl: http://minio.minio.svc.cluster.local:9000
@@ -76,7 +75,7 @@ configuration:
7675
- name: apl-linode
7776
provider: aws
7877
default: true
79-
bucket: {{ $bu.velero }}
78+
bucket: {{ $obj.linode.buckets.velero }}
8079
config:
8180
s3Url: https://{{ $obj.linode.region }}.linodeobjects.com
8281
region: {{ $obj.linode.region }}
@@ -131,21 +130,4 @@ deployNodeAgent: {{ $vl.restic.enabled }}
131130
nodeAgent:
132131
podSecurityContext:
133132
runAsUser: 1338
134-
fsGroup: 1338
135-
136-
{{- if $b.gitea.enabled }}
137-
schedules:
138-
gitea:
139-
disabled: false
140-
schedule: {{ $b.gitea.schedule }}
141-
useOwnerReferencesInBackup: false
142-
template:
143-
ttl: {{ $b.gitea.ttl }}
144-
includedNamespaces:
145-
- gitea
146-
includedResources:
147-
- pv
148-
- pvc
149-
includeClusterResources: true
150-
storageLocation: apl
151-
{{- end }}
133+
fsGroup: 1338

0 commit comments

Comments
 (0)