Created
March 22, 2017 15:50
-
-
Save niels-s/5625186fba2a468132aaf052a858bc25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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