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