Browse Source

working on setup

pull/2/head
Nicolas Massé 9 years ago
parent
commit
4e0ee7621a
  1. 8
      setup/pod.yaml
  2. 69
      setup/roles.yaml
  3. 4
      setup/service-account.yaml
  4. 7
      setup/setup.sh

8
setup/pod.yaml

@ -8,14 +8,18 @@ spec:
image: hostpath-provisioner:latest image: hostpath-provisioner:latest
imagePullPolicy: "IfNotPresent" imagePullPolicy: "IfNotPresent"
env: env:
- name: HOSTPATH_TO_USE
value: /var/openshift/
- name: NODE_NAME - name: NODE_NAME
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: spec.nodeName fieldPath: spec.nodeName
volumeMounts: volumeMounts:
- name: pv-volume - name: pv-volume
mountPath: /tmp/hostpath-provisioner mountPath: /var/openshift
volumes: volumes:
- name: pv-volume - name: pv-volume
hostPath: hostPath:
path: /tmp/hostpath-provisioner path: /var/openshift
serviceAccount: hostpath-provisioner

69
setup/roles.yaml

@ -1,49 +1,20 @@
- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole
kind: ClusterRole apiVersion: v1
metadata: metadata:
creationTimestamp: null name: hostpath-provisioner
labels: rules:
kubernetes.io/bootstrapping: rbac-defaults - apiGroups: [""]
name: system:persistent-volume-provisioner resources: ["persistentvolumes"]
rules: verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: - apiGroups: [""]
- "" resources: ["persistentvolumeclaims"]
resources: verbs: ["get", "list", "watch", "update"]
- persistentvolumes - apiGroups: ["storage.k8s.io"]
verbs: resources: ["storageclasses"]
- create verbs: ["get", "list", "watch"]
- delete - apiGroups: [""]
- get resources: ["events"]
- list verbs: ["list", "watch", "create", "update", "patch"]
- watch - apiGroups: [""]
- apiGroups: resources: ["services", "endpoints"]
- "" verbs: ["get"]
resources:
- persistentvolumeclaims
verbs:
- get
- list
- update
- watch
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update

4
setup/service-account.yaml

@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: hostpath-provisioner

7
setup/setup.sh

@ -0,0 +1,7 @@
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 create -f pod.yaml
oc create -f class.yaml
Loading…
Cancel
Save