infisical: bring self-hosted stack under GitOps (postgres, valkey, backend); secret.yaml excluded template
This commit is contained in:
14
applications/infisical/postgres/service.yaml
Normal file
14
applications/infisical/postgres/service.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: infisical-postgres
|
||||
namespace: infisical
|
||||
labels:
|
||||
app: infisical-postgres
|
||||
spec:
|
||||
selector:
|
||||
app: infisical-postgres
|
||||
ports:
|
||||
- name: postgres
|
||||
port: 5432
|
||||
targetPort: 5432
|
||||
64
applications/infisical/postgres/statefulset.yaml
Normal file
64
applications/infisical/postgres/statefulset.yaml
Normal file
@@ -0,0 +1,64 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: infisical-postgres
|
||||
namespace: infisical
|
||||
spec:
|
||||
serviceName: infisical-postgres
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: infisical-postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: infisical-postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:14-alpine
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
env:
|
||||
# Keep data in a subdir so an RWO volume's lost+found doesn't block initdb
|
||||
- name: PGDATA
|
||||
value: /var/lib/postgresql/data/pgdata
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: infisical-secrets
|
||||
key: POSTGRES_USER
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: infisical-secrets
|
||||
key: POSTGRES_PASSWORD
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: infisical-secrets
|
||||
key: POSTGRES_DB
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"]
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 10
|
||||
failureThreshold: 10
|
||||
livenessProbe:
|
||||
exec:
|
||||
command: ["sh", "-c", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"]
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 15
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 8Gi
|
||||
Reference in New Issue
Block a user