Skip to content

Instantly share code, notes, and snippets.

@jow-
Last active May 2, 2019 06:32
Show Gist options
  • Save jow-/34991ba57e8993d6abf89483afc0bb5d to your computer and use it in GitHub Desktop.
Save jow-/34991ba57e8993d6abf89483afc0bb5d to your computer and use it in GitHub Desktop.
Deploy Local LVM Storage provisioner v0.10.2
apiVersion: v1
kind: Namespace
metadata:
name: local-lvm-storage
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: local-lvm-provisioner-service-account
namespace: local-lvm-storage
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: local-lvm-provisioner-role
namespace: local-lvm-storage
rules:
- apiGroups: [""]
resources: ["nodes", "persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["endpoints", "persistentvolumes", "pods"]
verbs: ["*"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: local-lvm-provisioner-bind
namespace: local-lvm-storage
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: local-lvm-provisioner-role
subjects:
- kind: ServiceAccount
name: local-lvm-provisioner-service-account
namespace: local-lvm-storage
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: local-lvm-provisioner
namespace: local-lvm-storage
spec:
replicas: 1
selector:
matchLabels:
app: local-lvm-provisioner
template:
metadata:
labels:
app: local-lvm-provisioner
spec:
serviceAccountName: local-lvm-provisioner-service-account
containers:
- name: local-lvm-provisioner
image: jpwi/local-lvm-provisioner:v0.10.2
imagePullPolicy: Always
args:
- run
- --debug
- start
- --config
- /etc/config/config.json
- --helper-image
- jpwi/local-lvm-provisioner:v0.10.2
volumeMounts:
- name: config-volume
mountPath: /etc/config/
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumes:
- name: config-volume
configMap:
name: local-lvm-config
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-lvm
provisioner: mein.io/local-lvm
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Delete
---
kind: ConfigMap
apiVersion: v1
metadata:
name: local-lvm-config
namespace: local-lvm-storage
data:
config.json: |-
{
"nodeVGMap":[
{
"node":"DEFAULT_VGS_FOR_NON_LISTED_NODES",
"path":"/data",
"vgs":["vg1"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment