120 lines
2.8 KiB
YAML
120 lines
2.8 KiB
YAML
---
|
|
apiVersion: generators.external-secrets.io/v1alpha1
|
|
kind: Password
|
|
metadata:
|
|
name: authelia-db
|
|
spec:
|
|
length: 16
|
|
digits: 5
|
|
symbols: 5
|
|
symbolCharacters: "-_$@"
|
|
noUpper: false
|
|
allowRepeat: true
|
|
|
|
---
|
|
apiVersion: external-secrets.io/v1beta1
|
|
kind: ExternalSecret
|
|
metadata:
|
|
name: "password"
|
|
spec:
|
|
refreshPolicy: "CreatedOnce"
|
|
target:
|
|
name: authelia-db-secrets
|
|
creationPolicy: Merge
|
|
deletionPolicy: Merge
|
|
template:
|
|
engineVersion: v2
|
|
data:
|
|
POSTGRES_PASSWORD: "{{`{{.password}}`}}"
|
|
AUTHELIA_STORAGE_POSTGRES_PASSWORD: "{{`{{.password}}`}}"
|
|
dataFrom:
|
|
- sourceRef:
|
|
generatorRef:
|
|
apiVersion: generators.external-secrets.io/v1alpha1
|
|
kind: Password
|
|
name: "authelia-db"
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: authelia-db-secrets
|
|
type: Opaque
|
|
stringData:
|
|
POSTGRES_DB: "authelia"
|
|
POSTGRES_USER: "authelia"
|
|
AUTHELIA_STORAGE_POSTGRES_ADDRESS: "tcp://authelia-db.{{ .Release.Namespace }}.svc.cluster.local:5432"
|
|
AUTHELIA_STORAGE_POSTGRES_USERNAME: "authelia"
|
|
AUTHELIA_STORAGE_POSTGRES_DATABASE: "authelia"
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: authelia-db
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: "authelia-db"
|
|
serviceName: authelia-db
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data
|
|
spec:
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: "authelia-db"
|
|
spec:
|
|
containers:
|
|
- name: db
|
|
image: {{ .Values.authelia.pg.image }}
|
|
imagePullPolicy: IfNotPresent
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /var/lib/postgresql/data
|
|
ports:
|
|
- containerPort: 5432
|
|
envFrom:
|
|
- secretRef:
|
|
name: authelia-db-secrets
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 5432
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
timeoutSeconds: 1
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 5432
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
timeoutSeconds: 1
|
|
failureThreshold: 3
|
|
resources:
|
|
requests:
|
|
cpu: 1
|
|
memory: 5Gi
|
|
limits:
|
|
cpu: 1
|
|
memory: 5Gi
|
|
---
|
|
kind: Service
|
|
apiVersion: v1
|
|
metadata:
|
|
name: authelia-db
|
|
spec:
|
|
selector:
|
|
app.kubernetes.io/name: "authelia-db"
|
|
type: ClusterIP
|
|
ports:
|
|
- name: db
|
|
port: 5432
|
|
targetPort: 5432
|