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