Skip to content

Commit 32d1aaf

Browse files
committed
Merge branch 'main' into APL-537
2 parents 01fa5f3 + 98d8bfe commit 32d1aaf

14 files changed

+154
-164
lines changed

charts/otomi-db/values.yaml

+2-19
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,8 @@ clusterAffinity:
2121
topologyKey: kubernetes.io/hostname
2222
podAntiAffinityType: preferred
2323

24-
# Example for backups:
25-
# clusterBackup:
26-
# backup:
27-
# barmanObjectStore:
28-
# destinationPath: s3://bucket/
29-
# endpointURL: "http://minio.minio.svc.cluster.local:9000"
30-
# s3Credentials:
31-
# accessKeyId:
32-
# name: minio-creds
33-
# key: MINIO_ACCESS_KEY
34-
# secretAccessKey:
35-
# name: minio-creds
36-
# key: MINIO_SECRET_KEY
37-
3824
clusterSpec:
39-
bootstrap:
40-
initdb:
41-
database: app
42-
owner: app
25+
bootstrap: {}
4326

4427
backup:
4528
enabled: false
@@ -53,4 +36,4 @@ backup:
5336
minioLocal:
5437
destinationPath: ""
5538
linode:
56-
destinationPath: ""
39+
destinationPath: ""

helmfile.d/helmfile-03.init.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ releases:
1717
namespace: argocd
1818
labels:
1919
app: core
20-
<<: *default
20+
<<: *default
2121
- name: otomi-operator
2222
installed: true
2323
namespace: otomi-operator
@@ -57,6 +57,12 @@ releases:
5757
pkg: apl-gitea-operator
5858
app: core
5959
<<: *default
60+
- name: harbor-artifacts
61+
installed: {{ $a | get "harbor.enabled" }}
62+
namespace: harbor
63+
labels:
64+
pkg: harbor
65+
<<: *raw
6066
- name: apl-harbor-operator-artifacts
6167
installed: {{ $a | get "harbor.enabled" }}
6268
namespace: apl-harbor-operator

helmfile.d/helmfile-04.databases.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ releases:
2727
pkg: keycloak
2828
<<: *otomiDb
2929
- name: gitea-otomi-db
30-
installed: {{ or $v.databases.gitea.useOtomiDB $v.databases.gitea.imported }}
30+
installed: true
3131
namespace: gitea
3232
labels:
3333
pkg: gitea

helmfile.d/helmfile-09.init.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ bases:
1010
{{ readFile "snippets/templates.gotmpl" }}
1111
{{- $v := .Values }}
1212
{{- $a := $v.apps }}
13-
{{- $h := $a.harbor }}
14-
{{- $k := $a.keycloak }}
1513

1614
releases:
1715
- name: knative-serving-artifacts
@@ -40,12 +38,6 @@ releases:
4038
labels:
4139
pkg: minio
4240
<<: *default
43-
- name: harbor-artifacts
44-
installed: {{ $h | get "enabled" }}
45-
namespace: harbor
46-
labels:
47-
pkg: harbor
48-
<<: *raw
4941
- name: tekton-triggers
5042
installed: true
5143
namespace: tekton-pipelines
@@ -58,4 +50,4 @@ releases:
5850
namespace: otomi-pipelines
5951
labels:
6052
app: core
61-
<<: *default
53+
<<: *default

helmfile.d/snippets/defaults.yaml

+21-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ environments:
1414
memory: 64Mi
1515
limits:
1616
cpu: 200m
17-
memory: 256Mi
17+
memory: 256Mi
1818
_rawValues: {}
1919
argocd:
2020
controllerStatusProcessors: 20
@@ -249,7 +249,7 @@ environments:
249249
condition: (
250250
container.image.repository in (
251251
docker.io/gitea/gitea
252-
) or (k8s.ns.name = "keycloak")
252+
) or (k8s.ns.name = "keycloak")
253253
)
254254
- macro: user_known_create_files_below_dev_activities
255255
condition: (
@@ -881,7 +881,7 @@ environments:
881881
cpu: 100m
882882
memory: 256Mi
883883
persistence:
884-
master:
884+
master:
885885
size: 1Gi
886886
sentinel:
887887
size: 1Gi
@@ -1037,7 +1037,7 @@ environments:
10371037
memory: 24Mi
10381038
limits:
10391039
cpu: 100m
1040-
memory: 128Mi
1040+
memory: 128Mi
10411041
_rawValues: {}
10421042
otel:
10431043
enabled: false
@@ -1261,9 +1261,10 @@ environments:
12611261
databases:
12621262
keycloak:
12631263
imageName: null
1264-
imported: false
12651264
size: 5Gi
12661265
replicas: 2
1266+
recovery: {}
1267+
externalClusters: []
12671268
resources:
12681269
limits:
12691270
cpu: "200m"
@@ -1276,6 +1277,8 @@ environments:
12761277
size: 5Gi
12771278
replicas: 2
12781279
coreDatabase: registry
1280+
recovery: {}
1281+
externalClusters: []
12791282
resources:
12801283
limits:
12811284
cpu: "200m"
@@ -1285,10 +1288,10 @@ environments:
12851288
memory: 192Mi
12861289
gitea:
12871290
imageName: null
1288-
useOtomiDB: true
1289-
imported: false
12901291
size: 5Gi
12911292
replicas: 2
1293+
recovery: {}
1294+
externalClusters: []
12921295
resources:
12931296
limits:
12941297
cpu: "200m"
@@ -1303,12 +1306,23 @@ environments:
13031306
database:
13041307
harbor:
13051308
enabled: false
1309+
retentionPolicy: 7d
1310+
schedule: 0 0 * * *
1311+
pathSuffix: harbor
13061312
gitea:
13071313
enabled: false
1314+
retentionPolicy: 7d
1315+
schedule: 0 0 * * *
1316+
pathSuffix: gitea
13081317
keycloak:
13091318
enabled: false
1319+
retentionPolicy: 7d
1320+
schedule: 0 0 * * *
1321+
pathSuffix: keycloak
13101322
gitea:
13111323
enabled: false
1324+
retentionPolicy: 7d
1325+
schedule: 0 0 * * *
13121326
cluster:
13131327
provider: linode
13141328
name: apl

src/cmd/bootstrap.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const bootstrapSops = async (
7474
obj.keys = publicKey
7575
if (privateKey && !process.env.SOPS_AGE_KEY) {
7676
process.env.SOPS_AGE_KEY = privateKey
77-
await deps.writeFile(`${env.ENV_DIR}/.secrets`, `SOPS_AGE_KEY=${privateKey}`)
77+
await deps.writeFile(`${envDir}/.secrets`, `SOPS_AGE_KEY=${privateKey}`)
7878
}
7979
}
8080

@@ -87,21 +87,21 @@ export const bootstrapSops = async (
8787
d.info('Copying sops related files')
8888
// add sops related files
8989
const file = '.gitattributes'
90-
await deps.copyFile(`${rootDir}/.values/${file}`, `${env.ENV_DIR}/${file}`)
90+
await deps.copyFile(`${rootDir}/.values/${file}`, `${envDir}/${file}`)
9191

9292
// prepare some credential files the first time and crypt some
9393
if (!exists) {
9494
if (isCli || env.OTOMI_DEV) {
9595
// first time so we know we have values
96-
const secretsFile = `${env.ENV_DIR}/.secrets`
96+
const secretsFile = `${envDir}/.secrets`
9797
d.log(`Creating secrets file: ${secretsFile}`)
9898
if (provider === 'google') {
9999
// and we also assume the correct values are given by using '!' (we want to err when not set)
100100
const serviceKeyJson = JSON.parse(values.kms.sops!.google!.accountJson as string)
101101
// and set it in env for later decryption
102102
process.env.GCLOUD_SERVICE_KEY = values.kms.sops!.google!.accountJson
103103
d.log('Creating gcp-key.json for vscode.')
104-
await deps.writeFile(`${env.ENV_DIR}/gcp-key.json`, JSON.stringify(serviceKeyJson))
104+
await deps.writeFile(`${envDir}/gcp-key.json`, JSON.stringify(serviceKeyJson))
105105
d.log(`Creating credentials file: ${secretsFile}`)
106106
await deps.writeFile(secretsFile, `GCLOUD_SERVICE_KEY=${JSON.stringify(JSON.stringify(serviceKeyJson))}`)
107107
} else if (provider === 'aws') {

tests/fixtures/env/settings/platformBackups.yaml

+31-1
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,46 @@ spec:
88
enabled: true
99
retentionPolicy: 7d
1010
schedule: 0 0 * * *
11+
pathSuffix: gitea
1112
harbor:
1213
enabled: true
1314
retentionPolicy: 7d
1415
schedule: 0 0 * * *
16+
pathSuffix: harbor-1
17+
recovery:
18+
source: harbor-backup
19+
database: registry
20+
owner: harbor
21+
externalClusters:
22+
- name: harbor-backup
23+
barmanObjectStore:
24+
serverName: harbor-otomi-db
25+
destinationPath: s3://my-clusterid-harbor/harbor
26+
endpointURL: https://nl-ams-1.linodeobjects.com
27+
s3Credentials:
28+
accessKeyId:
29+
name: linode-creds
30+
key: S3_STORAGE_ACCOUNT
31+
secretAccessKey:
32+
name: linode-creds
33+
key: S3_STORAGE_KEY
34+
wal:
35+
compression: gzip
36+
maxParallel: 8
37+
data:
38+
compression: gzip
1539
keycloak:
1640
enabled: true
1741
retentionPolicy: 7d
1842
schedule: 0 0 * * *
43+
pathSuffix: keycloak-1
44+
recovery:
45+
backup:
46+
name: keycloak-backup
47+
database: keycloak
48+
owner: keycloak
1949
gitea:
2050
enabled: true
2151
retentionPolicy: 7d
22-
schedule: 0 0 0 * * *
52+
schedule: 0 0 * * *
2353
persistentVolumes: {}

values-changes.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ changes:
336336
- databases.harbor.resources.limits.cpu: '200m'
337337
- databases.harbor.resources.requests.memory: '192Mi'
338338
- databases.harbor.resources.requests.cpu: '200m'
339-
- version: 34
339+
- version: 33
340340
deletions:
341+
- 'databases.keycloak.imported'
342+
- 'databases.gitea.imported'
343+
- 'databases.gitea.useOtomiDB'
341344
- 'teamConfig.{team}.services[].type'

values-schema.yaml

+43-10
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ properties:
16461646
$ref: '#/definitions/email'
16471647
issuer:
16481648
description: |
1649-
Indicates the origin of the wildcard certificate.
1649+
Indicates the origin of the wildcard certificate.
16501650
The custom-ca - cert-manager uses the customRootCA to generate wildcard certificate.
16511651
The letsencrypt - cert-manager requests certificate from letsencrypt endpoint.
16521652
The byo-wildcard-cert allows users to bring their own trusted wildcard certificate (cert-manager not involved)
@@ -3159,6 +3159,10 @@ properties:
31593159
$ref: '#/definitions/backupRetentionPolicy'
31603160
schedule:
31613161
$ref: '#/definitions/backupSchedule'
3162+
pathSuffix:
3163+
type: string
3164+
pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])$'
3165+
default: harbor
31623166
gitea:
31633167
title: Gitea
31643168
properties:
@@ -3171,6 +3175,10 @@ properties:
31713175
$ref: '#/definitions/backupRetentionPolicy'
31723176
schedule:
31733177
$ref: '#/definitions/backupSchedule'
3178+
pathSuffix:
3179+
type: string
3180+
pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])$'
3181+
default: gitea
31743182
keycloak:
31753183
title: Keycloak
31763184
properties:
@@ -3183,6 +3191,10 @@ properties:
31833191
$ref: '#/definitions/backupRetentionPolicy'
31843192
schedule:
31853193
$ref: '#/definitions/backupSchedule'
3194+
pathSuffix:
3195+
type: string
3196+
pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])$'
3197+
default: keycloak
31863198
persistentVolumes:
31873199
type: object
31883200
description: Create backups of persistent volumes
@@ -3284,9 +3296,16 @@ properties:
32843296
replicas:
32853297
type: integer
32863298
default: 2
3287-
imported:
3288-
type: boolean
3289-
default: false
3299+
recovery:
3300+
type: object
3301+
additionalProperties: true
3302+
default: {}
3303+
externalClusters:
3304+
type: array
3305+
items:
3306+
type: object
3307+
additionalProperties: true
3308+
default: []
32903309
harbor:
32913310
title: Harbor
32923311
properties:
@@ -3297,22 +3316,36 @@ properties:
32973316
replicas:
32983317
type: integer
32993318
default: 2
3319+
recovery:
3320+
type: object
3321+
additionalProperties: true
3322+
default: {}
3323+
externalClusters:
3324+
type: array
3325+
items:
3326+
type: object
3327+
additionalProperties: true
3328+
default: []
33003329
gitea:
33013330
title: gitea
33023331
properties:
3303-
useOtomiDB:
3304-
type: boolean
3305-
default: false
33063332
size:
33073333
type: string
33083334
resources:
33093335
$ref: '#/definitions/resources'
33103336
replicas:
33113337
type: integer
33123338
default: 2
3313-
imported:
3314-
type: boolean
3315-
default: false
3339+
recovery:
3340+
type: object
3341+
additionalProperties: true
3342+
default: {}
3343+
externalClusters:
3344+
type: array
3345+
items:
3346+
type: object
3347+
additionalProperties: true
3348+
default: []
33163349
teamConfig:
33173350
additionalProperties: false
33183351
patternProperties:

0 commit comments

Comments
 (0)