Skip to content

Instantly share code, notes, and snippets.

@vigneshragupathy
Created November 24, 2019 06:56
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 vigneshragupathy/d04c1473a6dacc90fcc8af2946b54b92 to your computer and use it in GitHub Desktop.
Save vigneshragupathy/d04c1473a6dacc90fcc8af2946b54b92 to your computer and use it in GitHub Desktop.
statefulset
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
spec:
ports:
- port: 80
name: web
clusterIP: None
selector:
app: nginx
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: web
spec:
serviceName: "nginx"
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: k8s.gcr.io/nginx-slim:0.8
ports:
- containerPort: 80
name: web
volumeMounts:
- name: vikki-pv-volume
mountPath: /usr/share/nginx/html
volumes:
- name: vikki-pv-volume
persistentVolumeClaim:
claimName: vikki-pv-volume-claim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment