Skip to content

Commit 4ac1d92

Browse files
committed
password is now hook and also contains backendDsn value, deployment is statefulset now
1 parent 1ffb137 commit 4ac1d92

File tree

7 files changed

+22
-17
lines changed

7 files changed

+22
-17
lines changed

charts/edgedb/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: edgedb
33
description: A Helm chart for self hosting EdgeDB
44
type: application
5-
version: 0.1.1
5+
version: 0.1.2
66
appVersion: "5.6"

charts/edgedb/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ This is useful in case a postgres operator is creating the database for you and
4646
4747
### Security Configuration
4848
#### Server Password
49-
By default, the chart generates a random password. You can provide your own password using a secret:
50-
```yaml
51-
security:
52-
password:
53-
secret:
54-
name: my-edgedb-secret
55-
key: password
56-
```
49+
By default, the chart generates a random password as a secret.
5750
5851
#### TLS Configuration
5952

charts/edgedb/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252

5353

54+
{{/*
55+
Get the server password value
56+
*/}}
57+
{{- define "edgedb.serverPassword" -}}
58+
{{- if .Values.security.password }}
59+
{{- .Values.security.password.secret.name }}
60+
{{- else }}
61+
{{- include "edgedb.fullname" . }}-server-password
62+
{{- end }}
63+
{{- end }}
64+
5465
{{- define "edgedb.tlsSecretName"}}
5566
{{- if .Values.security.tls.enabled }}
5667
{{- if .Values.security.tls.secret }}

charts/edgedb/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: apps/v1
2-
kind: Deployment
2+
kind: StatefulSet
33
metadata:
44
name: {{ include "edgedb.fullname" . }}
55
labels:

charts/edgedb/templates/password.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ apiVersion: v1
33
kind: Secret
44
metadata:
55
name: {{ include "edgedb.fullname" . }}-server-password
6+
annotations:
7+
"helm.sh/hook": pre-install
8+
"helm.sh/hook-weight": "-5"
9+
"helm.sh/hook-delete-policy": before-hook-creation
610
labels:
711
{{- include "edgedb.labels" . | nindent 4 }}
812
type: Opaque
913
data:
10-
password: {{ randAlphaNum 20 | b64enc | quote }}
11-
{{ end }}
14+
password: {{ $password := randAlphaNum 20 }}{{ $password | b64enc | quote }}
15+
edgedbBackendDsn: {{ printf "edgedb://edgedb:%s@%s.%s.svc.cluster.local:5656" $password (include "edgedb.fullname" .) .Release.Namespace | b64enc | quote }}
16+
{{- end }}

charts/edgedb/values.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ affinity: {}
1212
replicas: 1
1313

1414
security:
15-
password:
16-
# You can provide your own password by referencing a secret, otherwise the chart will create a password
17-
# secret:
18-
# name: edgedb-user-defined-secret
19-
# key: user-defined-key
2015
tls:
2116
enabled: false
2217
# Provide the template for a cert-manager certificate

devenv.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
helm install $1 \
99
charts/$1 \
1010
--namespace $1 \
11+
--values charts/$1/values-example.yaml \
1112
--create-namespace
1213
'';
1314
};

0 commit comments

Comments
 (0)