2018-02-15 09:55:43 +08:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
name: local-volume-provisioner
|
|
|
|
namespace: {{ local_volume_provisioner_namespace }}
|
|
|
|
labels:
|
|
|
|
k8s-app: local-volume-provisioner
|
|
|
|
version: {{ local_volume_provisioner_image_tag }}
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
k8s-app: local-volume-provisioner
|
|
|
|
version: {{ local_volume_provisioner_image_tag }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: local-volume-provisioner
|
|
|
|
version: {{ local_volume_provisioner_image_tag }}
|
|
|
|
spec:
|
2018-09-25 22:50:22 +08:00
|
|
|
{% if kube_version|version_compare('v1.11.1', '>=') %}
|
|
|
|
priorityClassName: {% if local_volume_provisioner_namespace == 'kube-system' %}system-node-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
|
|
|
|
{% endif %}
|
2018-02-15 09:55:43 +08:00
|
|
|
serviceAccountName: local-volume-provisioner
|
2018-06-12 08:10:13 +08:00
|
|
|
tolerations:
|
|
|
|
- effect: NoSchedule
|
|
|
|
operator: Exists
|
2018-02-15 09:55:43 +08:00
|
|
|
containers:
|
|
|
|
- name: provisioner
|
|
|
|
image: {{ local_volume_provisioner_image_repo }}:{{ local_volume_provisioner_image_tag }}
|
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
env:
|
|
|
|
- name: MY_NODE_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: spec.nodeName
|
2018-08-10 22:14:34 +08:00
|
|
|
- name: MY_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
2018-02-15 09:55:43 +08:00
|
|
|
volumeMounts:
|
|
|
|
- name: local-volume-provisioner
|
|
|
|
mountPath: /etc/provisioner/config
|
|
|
|
readOnly: true
|
2018-10-05 20:52:25 +08:00
|
|
|
{% for class in local_volume_provisioner_storage_classes %}
|
|
|
|
- name: {{ class.name }}
|
|
|
|
mountPath: {{ class.mount_dir }}
|
2018-08-10 22:14:34 +08:00
|
|
|
mountPropagation: "HostToContainer"
|
2018-10-05 20:52:25 +08:00
|
|
|
{% endfor %}
|
2018-02-15 09:55:43 +08:00
|
|
|
volumes:
|
|
|
|
- name: local-volume-provisioner
|
|
|
|
configMap:
|
|
|
|
name: local-volume-provisioner
|
2018-10-05 20:52:25 +08:00
|
|
|
{% for class in local_volume_provisioner_storage_classes %}
|
|
|
|
- name: {{ class.name }}
|
2018-02-15 09:55:43 +08:00
|
|
|
hostPath:
|
2018-10-05 20:52:25 +08:00
|
|
|
path: {{ class.host_dir }}
|
|
|
|
{% endfor %}
|