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
|
|
|
priorityClassName: {% if local_volume_provisioner_namespace == 'kube-system' %}system-node-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
|
2018-02-15 09:55:43 +08:00
|
|
|
serviceAccountName: local-volume-provisioner
|
2022-05-11 00:04:24 +08:00
|
|
|
{% if local_volume_provisioner_tolerations %}
|
2018-06-12 08:10:13 +08:00
|
|
|
tolerations:
|
2022-05-11 00:04:24 +08:00
|
|
|
{{ local_volume_provisioner_tolerations | to_nice_yaml(indent=2) | indent(width=8) }}
|
|
|
|
{% endif %}
|
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
|
2020-06-25 21:22:38 +08:00
|
|
|
- mountPath: /dev
|
|
|
|
name: provisioner-dev
|
2019-04-08 15:32:26 +08:00
|
|
|
{% for class_name, class_config in local_volume_provisioner_storage_classes.items() %}
|
2019-01-09 04:36:44 +08:00
|
|
|
- name: local-volume-provisioner-hostpath-{{ class_name }}
|
|
|
|
mountPath: {{ class_config.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
|
2020-06-25 21:22:38 +08:00
|
|
|
- name: provisioner-dev
|
|
|
|
hostPath:
|
|
|
|
path: /dev
|
2019-04-08 15:32:26 +08:00
|
|
|
{% for class_name, class_config in local_volume_provisioner_storage_classes.items() %}
|
2019-01-09 04:36:44 +08:00
|
|
|
- name: local-volume-provisioner-hostpath-{{ class_name }}
|
2018-02-15 09:55:43 +08:00
|
|
|
hostPath:
|
2019-01-09 04:36:44 +08:00
|
|
|
path: {{ class_config.host_dir }}
|
2018-10-05 20:52:25 +08:00
|
|
|
{% endfor %}
|