Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
Add monitor demo yaml files
Browse files Browse the repository at this point in the history
  • Loading branch information
NickrenREN committed Dec 26, 2017
1 parent b8746c1 commit 0433041
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: local-storage-admin
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: local-storage-provisioner-pv-binding
namespace: default
subjects:
- kind: ServiceAccount
name: local-storage-admin
namespace: default
roleRef:
kind: ClusterRole
name: system:persistent-volume-monitor
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: local-storage-provisioner-node-binding
namespace: default
subjects:
- kind: ServiceAccount
name: local-storage-admin
namespace: default
roleRef:
kind: ClusterRole
name: system:node
apiGroup: rbac.authorization.k8s.io

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: local-volume-config
data:
storageClassMap: |
local-storage:
hostDir: "/mnt/disks/vol"
mountDir: "/local-disks"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: system:persistent-volume-monitor
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["watch", "create", "update", "patch"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: local-volume-provisioner
spec:
template:
metadata:
labels:
app: local-volume-provisioner
spec:
containers:
- name: provisioner
image: "quay.io/external_storage/local-volume-provisioner:latest"
args:
- "-enable-monitor=true"
imagePullPolicy: Always
securityContext:
privileged: true
volumeMounts:
- name: discovery-vol
mountPath: "/local-disks"
- name: local-volume-config
mountPath: "/etc/provisioner/config/"
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
# If you want provisioner to use a kubeconfig file to access API server, instead of the default
# in-cluster config, then specify the following environment variable:
# - name: KUBECONFIG
# value: /path/to/kubeconfig

volumes:
- name: discovery-vol
hostPath:
path: "/mnt/disks/vol"
- name: local-volume-config
configMap:
name: local-volume-config
serviceAccount: local-storage-admin

0 comments on commit 0433041

Please sign in to comment.