Skip to content

Instantly share code, notes, and snippets.

@wuestkamp
Created June 28, 2020 16:58
Show Gist options
  • Save wuestkamp/b206c43792258b9137286a2b480904e8 to your computer and use it in GitHub Desktop.
Save wuestkamp/b206c43792258b9137286a2b480904e8 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- port: 80
name: sts
clusterIP: None
selector:
app: nginx
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: sts
spec:
selector:
matchLabels:
app: nginx
serviceName: nginx
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
terminationGracePeriodSeconds: 10
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
name: web
volumeMounts:
- name: sts
mountPath: /usr/share/nginx/html
volumeClaimTemplates:
- metadata:
name: sts
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 3Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment