Skip to content

Instantly share code, notes, and snippets.

@joatmon08
Created May 20, 2018 11:33
Show Gist options
  • Select an option

  • Save joatmon08/07d69d3fbf3668b177897b24eb0a99d7 to your computer and use it in GitHub Desktop.

Select an option

Save joatmon08/07d69d3fbf3668b177897b24eb0a99d7 to your computer and use it in GitHub Desktop.
20190520-StatefulSet
---
apiVersion: v1
kind: Service
metadata:
name: hello-stateful
labels:
app: hello-stateful
spec:
clusterIP: None
selector:
app: hello-stateful
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: hello-stateful
spec:
selector:
matchLabels:
app: hello-stateful
serviceName: hello-stateful
replicas: 1
template:
metadata:
labels:
app: hello-stateful
spec:
terminationGracePeriodSeconds: 10
containers:
- name: hello-stateful
image: joatmon08/hello-stateful:1.0
volumeMounts:
- name: log
mountPath: /usr/share/hello
volumeClaimTemplates:
- metadata:
name: log
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: gp2
resources:
requests:
storage: 1Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment