github.com/replicatedcom/ship@v0.50.0/integration/init_app/helm-github/expected/installer/postgres-forked-private-source/postgres-forked/statefulset-replica.yaml (about)

     1  # Source: postgresql/templates/statefulset-slaves.yaml
     2  
     3  apiVersion: apps/v1beta2
     4  kind: StatefulSet
     5  metadata:
     6    name: "postgres-postgresql-slave"
     7    labels:
     8      app: postgresql
     9      chart: postgresql-2.6.6
    10      release: "postgres"
    11      heritage: "Tiller"
    12  spec:
    13    serviceName: postgres-postgresql-headless
    14    replicas: 1
    15    updateStrategy:
    16      type: RollingUpdate
    17    selector:
    18      matchLabels:
    19        app: postgresql
    20        release: "postgres"
    21        role: slave
    22    template:
    23      metadata:
    24        name: postgres-postgresql
    25        labels:
    26          app: postgresql
    27          chart: postgresql-2.6.6
    28          release: "postgres"
    29          heritage: "Tiller"
    30          role: slave
    31      spec:
    32        affinity:
    33          nodeAffinity:
    34            requiredDuringSchedulingIgnoredDuringExecution:
    35              nodeSelectorTerms:
    36              - matchExpressions:
    37                - key: read-or-write
    38                  operator: In
    39                  values:
    40                  - read
    41        securityContext:
    42          fsGroup: 1001
    43          runAsUser: 1001
    44        initContainers:
    45        - name: init-chmod-data
    46          image: docker.io/bitnami/minideb:latest
    47          imagePullPolicy: "Always"
    48          command:
    49            - sh
    50            - -c
    51            - |
    52              chown -R 1001:1001 /bitnami
    53              if [ -d /bitnami/postgresql/data ]; then
    54                chmod  0700 /bitnami/postgresql/data;
    55              fi
    56          securityContext:
    57            runAsUser: 0
    58          volumeMounts:
    59          - name: data
    60            mountPath: /bitnami/postgresql
    61  
    62        containers:
    63        - name: postgres-postgresql
    64          image: docker.io/bitnami/postgresql:10.6.0
    65          imagePullPolicy: "Always"
    66          resources:
    67            requests:
    68              cpu: 250m
    69              memory: 256Mi
    70  
    71          env:
    72          - name: POSTGRESQL_REPLICATION_MODE
    73            value: "slave"
    74          - name: POSTGRESQL_REPLICATION_USER
    75            value: "repl_user"
    76          - name: POSTGRESQL_REPLICATION_PASSWORD
    77            valueFrom:
    78              secretKeyRef:
    79                name: postgres-postgresql
    80                key: postgresql-replication-password
    81          - name: POSTGRESQL_MASTER_HOST
    82            value: postgres-postgresql
    83          - name: POSTGRESQL_MASTER_PORT_NUMBER
    84            value: "5432"
    85          - name: POD_IP
    86            valueFrom: { fieldRef: { fieldPath: status.podIP } }
    87          ports:
    88          - name: postgresql
    89            containerPort: 5432
    90          livenessProbe:
    91            exec:
    92              command:
    93              - sh
    94              - -c
    95              - exec pg_isready -U "postgres" --host $POD_IP
    96            initialDelaySeconds: 30
    97            periodSeconds: 10
    98            timeoutSeconds: 5
    99            successThreshold: 1
   100            failureThreshold: 6
   101          readinessProbe:
   102            exec:
   103              command:
   104              - sh
   105              - -c
   106              - exec pg_isready -U "postgres" --host $POD_IP
   107            initialDelaySeconds: 5
   108            periodSeconds: 10
   109            timeoutSeconds: 5
   110            successThreshold: 1
   111            failureThreshold: 6
   112          volumeMounts:
   113          - name: data
   114            mountPath: /bitnami/postgresql
   115        volumes: []
   116    volumeClaimTemplates:
   117      - metadata:
   118          name: data
   119        spec:
   120          accessModes:
   121            - "ReadWriteOnce"
   122          resources:
   123            requests:
   124              storage: "8Gi"