diff options
author | Staffan Olsson <staffan@repos.se> | 2016-09-04 20:57:37 +0200 |
---|---|---|
committer | Staffan Olsson <staffan@repos.se> | 2016-09-04 20:57:37 +0200 |
commit | e9020c809cca51dba9a26e8ad17f404ff58a3b8c (patch) | |
tree | a8ece096f183747ae267c8fc4ca13279b814dcef /zookeeper/bootstrap | |
parent | 1eef3f9bbca15dbc1d2b97e1f5feb51fe27f8526 (diff) | |
download | kubernetes-kafka-e9020c809cca51dba9a26e8ad17f404ff58a3b8c.tar.gz kubernetes-kafka-e9020c809cca51dba9a26e8ad17f404ff58a3b8c.tar.bz2 kubernetes-kafka-e9020c809cca51dba9a26e8ad17f404ff58a3b8c.zip |
For clusters that don't support automatic volume provisioning, such as Minikube
Diffstat (limited to 'zookeeper/bootstrap')
-rw-r--r-- | zookeeper/bootstrap/pv-template.yml | 45 | ||||
-rwxr-xr-x | zookeeper/bootstrap/pv.sh | 11 | ||||
-rw-r--r-- | zookeeper/bootstrap/pvc.yml | 45 |
3 files changed, 101 insertions, 0 deletions
diff --git a/zookeeper/bootstrap/pv-template.yml b/zookeeper/bootstrap/pv-template.yml new file mode 100644 index 0000000..4a6aefa --- /dev/null +++ b/zookeeper/bootstrap/pv-template.yml @@ -0,0 +1,45 @@ +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: datadir-zoo-0 + labels: + app: zk + petindex: "0" +spec: + accessModes: + - ReadWriteOnce + capacity: + storage: 100Mi + hostPath: + path: /tmp/k8s-data/datadir-zoo-0 +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: datadir-zoo-1 + labels: + app: zk + petindex: "1" +spec: + accessModes: + - ReadWriteOnce + capacity: + storage: 100Mi + hostPath: + path: /tmp/k8s-data/datadir-zoo-1 +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: datadir-zoo-2 + labels: + app: zk + petindex: "2" +spec: + accessModes: + - ReadWriteOnce + capacity: + storage: 100Mi + hostPath: + path: /tmp/k8s-data/datadir-zoo-2 diff --git a/zookeeper/bootstrap/pv.sh b/zookeeper/bootstrap/pv.sh new file mode 100755 index 0000000..78bf7f5 --- /dev/null +++ b/zookeeper/bootstrap/pv.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "Note that in for example GKE a PetSet will have PersistentVolume(s) and PersistentVolumeClaim(s) created for it automatically" + +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" +path="$dir/data" +echo "Please enter a path where to store data during local testing: ($path)" +read newpath +[ -n "$newpath" ] && path=$newpath + +cat bootstrap/pv-template.yml | sed "s|/tmp/k8s-data|$path|" | kubectl create -f - diff --git a/zookeeper/bootstrap/pvc.yml b/zookeeper/bootstrap/pvc.yml new file mode 100644 index 0000000..e12cfa2 --- /dev/null +++ b/zookeeper/bootstrap/pvc.yml @@ -0,0 +1,45 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: datadir-zoo-0 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + selector: + matchLabels: + app: zk + petindex: "0" +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: datadir-zoo-1 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + selector: + matchLabels: + app: zk + petindex: "1" +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: datadir-zoo-2 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + selector: + matchLabels: + app: zk + petindex: "2" |