Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apiVersion: v1
- kind: Service
- metadata:
- name: postgres
- namespace: default
- labels:
- app: postgres
- spec:
- ports:
- - port: 5432
- name: postgres-port
- clusterIP: None
- selector:
- app: postgres
- ---
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: postgres
- spec:
- replicas: 1
- serviceName: "postgres"
- selector:
- matchLabels:
- app: postgres
- updateStrategy:
- type: RollingUpdate
- template:
- metadata:
- labels:
- app: postgres
- spec:
- containers:
- - name: postgres-container
- image: postgres
- ports:
- - name: postgres-port
- containerPort: 5432
- imagePullPolicy: Always
- envFrom:
- - secretRef:
- name: db-secrets
- resources:
- requests:
- memory: "300Mi"
- cpu: "500m"
- limits:
- memory: "1000Mi"
- cpu: "2000m"
- volumeMounts:
- - mountPath: /var/lib/postgresql/data
- name: postgres-data
- volumeClaimTemplates:
- - metadata:
- name: postgres-data
- spec:
- accessModes: [ "ReadWriteOnce" ]
- resources:
- requests:
- storage: 10Gi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement