Skip to content

Instantly share code, notes, and snippets.

@cweibel cweibel/pgstatefulset2.yml Secret
Created May 22, 2019

Embed
What would you like to do?
blog post Part 1 full secrets sample yml
apiVersion: v1
kind: Service
metadata:
labels:
run: postgres6meta2
name: postgres6meta
namespace: default
spec:
ports:
- port: 5432
protocol: TCP
targetPort: 5432
name: mypostgresport
selector:
run: postgres6meta2
sessionAffinity: None
type: NodePort
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres6meta
spec:
selector:
matchLabels:
run: postgres6meta2
serviceName: "nginx"
#replicas: 3 # by default is 1
template:
metadata:
labels:
run: postgres6meta2
spec:
terminationGracePeriodSeconds: 10
containers:
- name: hello-postgres
image: postgres:11.2
ports:
- containerPort: 5432
name: mypostgresport
volumeMounts:
- name: postgresdatapath
mountPath: /var/lib/postgresql/data
- name: mysecrets
mountPath: /etc/mysecrets
livenessProbe:
exec:
command: ["psql", "-w", "-U", "postgres", "-d", "postgres", "-c", "SELECT 1"]
initialDelaySeconds: 45
timeoutSeconds: 2
volumes:
- name: mysecrets
secret:
secretName: toppings
volumeClaimTemplates:
- metadata:
name: postgresdatapath
spec:
accessModes: [ "ReadWriteOnce" ]
# storageClassName: "sta"
resources:
requests:
storage: 1Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.