Skip to content

Instantly share code, notes, and snippets.

@niels-s
Created March 22, 2017 15:50
Show Gist options
  • Save niels-s/5625186fba2a468132aaf052a858bc25 to your computer and use it in GitHub Desktop.
Save niels-s/5625186fba2a468132aaf052a858bc25 to your computer and use it in GitHub Desktop.
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: redis
spec:
serviceName: "redis"
replicas: 1
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:3.2-alpine
ports:
- name: redis-server
containerPort: 6379
volumeMounts:
- name: redis-storage
mountPath: /data
volumeClaimTemplates:
- metadata:
name: redis-storage
annotations:
volume.alpha.kubernetes.io/storage-class: anything
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Service
metadata:
name: redis
labels:
app: redis
spec:
clusterIP: None
ports:
- port: 6379
name: tcp
selector:
app: redis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment