Skip to content

Instantly share code, notes, and snippets.

@joatmon08
Created October 3, 2018 12:00
Show Gist options
  • Select an option

  • Save joatmon08/4df34d52840b86751616616c46bfff6b to your computer and use it in GitHub Desktop.

Select an option

Save joatmon08/4df34d52840b86751616616c46bfff6b to your computer and use it in GitHub Desktop.
Hello Stateful CR v1
apiVersion: "hello-stateful.example.com/v1alpha1"
kind: "HelloStateful"
metadata:
name: "minikube-hello-stateful"
spec:
persistentVolume:
metadata:
name: hello-stateful-pv
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
persistentVolumeReclaimPolicy: Delete
hostPath:
path: "/tmp/hostpath-provisioner/hello-stateful-pv"
persistentVolumeClaim:
metadata:
name: hello-stateful-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
volumeName: hello-stateful-pv
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: stateful-log
mountPath: /usr/share/hello
volumes:
- name: stateful-log
persistentVolumeClaim:
claimName: hello-stateful-pvc
service:
metadata:
name: hello-stateful
labels:
app: hello-stateful
spec:
clusterIP: None
selector:
app: hello-stateful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment