Skip to content

Commit

Permalink
fix: bootstrap postgresqlPassword (#437)
Browse files Browse the repository at this point in the history
it needs to be provided as it can't be changed after initial deployment
  • Loading branch information
j-zimnowoda committed Jun 16, 2021
1 parent 317ca42 commit 91359cd
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 10 deletions.
2 changes: 1 addition & 1 deletion profiles/common/env/charts/drone.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
charts:
drone:
enabled: false
enabled: true
2 changes: 1 addition & 1 deletion profiles/common/env/charts/gitea.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
charts:
gitea:
enabled: false
enabled: true
1 change: 1 addition & 0 deletions profiles/common/env/charts/keycloak.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
charts:
keycloak:
enabled: true
idp:
alias: redkubes-azure
clientID: otomi
Expand Down
3 changes: 3 additions & 0 deletions profiles/common/env/charts/kubeapps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts:
kubeapps:
enabled: true
3 changes: 3 additions & 0 deletions profiles/common/env/charts/secrets.gitea.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts:
gitea:
postgresqlPassword: LrFNTOV78Yubm7CGk3CPGchP4EbPlQw
1 change: 1 addition & 0 deletions profiles/common/env/charts/secrets.keycloak.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ charts:
keycloak:
idp:
clientSecret: 'mnf9adfgjwr23m4das'
postgresqlPassword: kz5Fh7GeOOUp1TcaFd8kkun6dTx4clj
3 changes: 3 additions & 0 deletions profiles/common/env/charts/secrets.kubeapps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts:
kubeapps:
postgresqlPassword: gGdkDyR2Oaj3SOPdsCWtaYP1zjD898Z
3 changes: 3 additions & 0 deletions tests/fixtures/env/charts/kubeapps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts:
kubeapps:
enabled: true
1 change: 1 addition & 0 deletions tests/fixtures/env/charts/secrets.gitea.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ charts:
gitea:
admin:
password: bladibla
postgresqlPassword: postgresqlPassword
1 change: 1 addition & 0 deletions tests/fixtures/env/charts/secrets.keycloak.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ charts:
keycloak:
idp:
clientSecret: somsecretvalue
postgresqlPassword: postgresqlPassword
3 changes: 3 additions & 0 deletions tests/fixtures/env/charts/secrets.kubeapps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts:
kubeapps:
postgresqlPassword: postgresqlPassword
12 changes: 12 additions & 0 deletions values-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,10 @@ properties:
type: string
postgresqlPassword:
type: string
description: Once set and deployed it cannot be changed with manual intervention.
required:
- enabled
- postgresqlPassword
harbor:
additionalProperties: false
properties:
Expand Down Expand Up @@ -1300,6 +1304,7 @@ properties:
type: string
postgresqlPassword:
type: string
description: Once set and deployed it cannot be changed with manual intervention.
resources:
additionalProperties: false
properties:
Expand All @@ -1312,6 +1317,9 @@ properties:
- default
- otomi
type: string
required:
- enabled
- postgresqlPassword
kubeapps:
additionalProperties: false
properties:
Expand All @@ -1320,6 +1328,10 @@ properties:
type: boolean
postgresqlPassword:
type: string
description: Once set and deployed it cannot be changed with manual intervention.
required:
- enabled
- postgresqlPassword
kubernetes-external-secrets:
additionalProperties: false
properties:
Expand Down
5 changes: 2 additions & 3 deletions values/gitea/gitea.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{{- $giteaDomain := printf "gitea.%s" $v.cluster.domainSuffix }}
{{- $stage := $v.charts | get "cert-manager.stage" "production" }}
{{- $skipVerify := eq $stage "staging" }}
{{- $rnd := randAlpha 32 }}

nameOverride: gitea
fullnameOverride: gitea
Expand Down Expand Up @@ -96,8 +95,8 @@ postgresql:
size: 1Gi
global:
postgresql:
postgresqlPassword: {{ $g | get "postgresqlPassword" $rnd }}
postgresqlPostgresPassword: {{ $g | get "postgresqlPassword" $rnd }}
postgresqlPassword: {{ $g | get "postgresqlPassword" }}
postgresqlPostgresPassword: {{ $g | get "postgresqlPassword" }}
resources:
limits:
memory: 512Mi
Expand Down
2 changes: 1 addition & 1 deletion values/keycloak/keycloak.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ postgresql:
enabled: true
fsGroup: 1001
runAsUser: 1001
postgresqlPassword: {{ $k | get "postgresqlPassword" (randAlpha 32) }}
postgresqlPassword: {{ $k | get "postgresqlPassword" }}
persistence:
enabled: {{ $k | get "postgresql.persistence.enabled" (eq $dbVendor "postgres") }}
metrics:
Expand Down
7 changes: 3 additions & 4 deletions values/kubeapps/kubeapps.gotmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{- $v := .Values }}
{{- $k := $v | get "charts.kubeapps" dict }}
{{- $rnd := randAlpha 32 }}
assetsvc:
resources:
limits:
Expand All @@ -24,10 +23,10 @@ metrics:

postgresql:
existingSecret: null
postgresqlPassword: {{ $k | get "postgresqlPassword" $rnd }}
postgresqlPostgresPassword: {{ $k | get "postgresqlPassword" $rnd }}
postgresqlPassword: {{ $k | get "postgresqlPassword" }}
postgresqlPostgresPassword: {{ $k | get "postgresqlPassword" }}
replication:
password: {{ $k | get "postgresqlPassword" $rnd }}
password: {{ $k | get "postgresqlPassword" }}
resources:
limits:
memory: 768Mi
Expand Down

0 comments on commit 91359cd

Please sign in to comment.