---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mod1-agm-postgresql
  labels:
    app.kubernetes.io/name: mod1-agm-postgresql
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: mod1-agm-postgresql
  serviceName: mod1-agm-postgresql
  replicas: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: mod1-agm-postgresql
        blinktShow: 'true'
        blinktColor: "7100FF"
    spec:
#      securityContext:
#        runAsUser: 999
#        supplementalGroups: [101,999]
      containers:
        - name: mod1-agm-postgresql
          image: postgres:14
          imagePullPolicy: "IfNotPresent"
          ports:
            - containerPort: 5432
          envFrom:
            - configMapRef:
                name: mod1-agm-postgresql
          volumeMounts:
            - name: storage
              mountPath: /var/lib/postgresql/data
      restartPolicy: Always
  volumeClaimTemplates:
    - metadata:
        name: storage
      spec:
        storageClassName: "managed-nfs-storage"
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 1Gi
