7bec169d58
* failed * version_compare * succeeded * skipped * success * version_compare becomes version since ansible 2.5 * ansible minimal version updated in doc and spec * last version_compare
60 lines
2 KiB
Django/Jinja
60 lines
2 KiB
Django/Jinja
---
|
|
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:
|
|
{% if kube_version is version('v1.11.1', '>=') %}
|
|
priorityClassName: {% if local_volume_provisioner_namespace == 'kube-system' %}system-node-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
|
|
{% endif %}
|
|
serviceAccountName: local-volume-provisioner
|
|
tolerations:
|
|
- effect: NoSchedule
|
|
operator: Exists
|
|
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
|
|
- name: MY_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
volumeMounts:
|
|
- name: local-volume-provisioner
|
|
mountPath: /etc/provisioner/config
|
|
readOnly: true
|
|
{% for class in local_volume_provisioner_storage_classes %}
|
|
- name: {{ class.name }}
|
|
mountPath: {{ class.mount_dir }}
|
|
mountPropagation: "HostToContainer"
|
|
{% endfor %}
|
|
volumes:
|
|
- name: local-volume-provisioner
|
|
configMap:
|
|
name: local-volume-provisioner
|
|
{% for class in local_volume_provisioner_storage_classes %}
|
|
- name: {{ class.name }}
|
|
hostPath:
|
|
path: {{ class.host_dir }}
|
|
{% endfor %}
|