From f6a878994d8149c7be451357952191de98b0f09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Thu, 18 May 2017 18:07:58 +0100 Subject: [PATCH] sample pvc --- setup/sample-claim.yaml | 18 ++++++++++++++++++ setup/setup.sh | 11 +++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 setup/sample-claim.yaml diff --git a/setup/sample-claim.yaml b/setup/sample-claim.yaml new file mode 100644 index 0000000..6cadae3 --- /dev/null +++ b/setup/sample-claim.yaml @@ -0,0 +1,18 @@ +{ + "apiVersion": "v1", + "kind": "PersistentVolumeClaim", + "metadata": { + "name": "pvc-test" + "annotations": + "volume.beta.kubernetes.io/storage-class": "hostpath-provisioner" + }, + "spec": { + "accessModes": [ "ReadWriteOnce" ], + "resources": { + "requests": { + "storage": "5Gi" + }, + "volumeName": "pv-test" + } + } +} diff --git a/setup/setup.sh b/setup/setup.sh index c9fe8be..9052313 100644 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -1,7 +1,14 @@ +oc project default oc create -f service-account.yaml oc create -f roles.yaml -# oc adm policy add-scc-to-user hostmount-anyuid system:serviceaccount:test-provisioner:hostpath-provisioner -# oc adm policy add-cluster-role-to-user hostpath-provisioner-runner system:serviceaccount:test-provisioner:hostpath-provisioner +oc adm policy add-scc-to-user hostmount-anyuid -z hostpath-provisioner +oc adm policy add-cluster-role-to-user hostpath-provisioner -z hostpath-provisioner + +mkdir /tmp/openshift +chmod 777 /tmp/openshift +chcon -Rt svirt_sandbox_file_t /tmp/openshift oc create -f pod.yaml oc create -f class.yaml + +oc create -f sample-claim.yaml