Skip to content

Instantly share code, notes, and snippets.

@cweibel
Created May 22, 2019 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cweibel/7b121a37abbd959f85363bc339ae3494 to your computer and use it in GitHub Desktop.
Save cweibel/7b121a37abbd959f85363bc339ae3494 to your computer and use it in GitHub Desktop.
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