From 95f1e4634a1c50fa77312d058a2b713353f4307e Mon Sep 17 00:00:00 2001 From: Anton Fayzrahmanov Date: Fri, 10 Aug 2018 17:14:34 +0300 Subject: [PATCH] local-volume-provisioner: use mountPropagation HostToContainer and version bump (#3081) * Update local-volume-provisioner-ds.yml.j2 After v1.10.2 default mountPropagation is "None" * local_volume_provisioner version bump v2.1.0 uses the beta nodeAffinity API by default which is available starting 1.10 * Update local-volume-provisioner-ds.yml.j2 MY_NAMESPACE env * Update README.md Raw block devices docs. --- roles/download/defaults/main.yml | 2 +- .../local_volume_provisioner/README.md | 16 +++++++++------- .../templates/local-volume-provisioner-ds.yml.j2 | 5 +++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/roles/download/defaults/main.yml b/roles/download/defaults/main.yml index b06e23b23..0b0584b39 100644 --- a/roles/download/defaults/main.yml +++ b/roles/download/defaults/main.yml @@ -134,7 +134,7 @@ registry_image_tag: "2.6" registry_proxy_image_repo: "gcr.io/google_containers/kube-registry-proxy" registry_proxy_image_tag: "0.4" local_volume_provisioner_image_repo: "quay.io/external_storage/local-volume-provisioner" -local_volume_provisioner_image_tag: "v2.0.0" +local_volume_provisioner_image_tag: "v2.1.0" cephfs_provisioner_image_repo: "quay.io/external_storage/cephfs-provisioner" cephfs_provisioner_image_tag: "v1.1.0-k8s1.10" ingress_nginx_controller_image_repo: "quay.io/kubernetes-ingress-controller/nginx-ingress-controller" diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/README.md b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/README.md index 458a483cb..900694795 100644 --- a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/README.md +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/README.md @@ -46,18 +46,20 @@ to limit the quota of persistent volumes. ### Simple directories -``` bash -for vol in vol6 vol7 vol8; do -mkdir /mnt/disks/$vol -done -``` - -This is also acceptable in a development environment, but there is no capacity +In a development environment using `mount --bind` works also, but there is no capacity management. +### Block volumeMode PVs + +Create a symbolic link under discovery directory to the block device on the node. To use +raw block devices in pods BlockVolume feature gate must be enabled. + Usage notes ----------- +Beta PV.NodeAffinity field is used by default. If running against an older K8s +version, the useAlphaAPI flag must be set in the configMap. + The volume provisioner cannot calculate volume sizes correctly, so you should delete the daemonset pod on the relevant host after creating volumes. The pod will be recreated and read the size correctly. diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-ds.yml.j2 b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-ds.yml.j2 index 80a74f5f1..2b713ce13 100644 --- a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-ds.yml.j2 +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/templates/local-volume-provisioner-ds.yml.j2 @@ -30,12 +30,17 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + - name: MY_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace volumeMounts: - name: local-volume-provisioner mountPath: /etc/provisioner/config readOnly: true - name: local-volume-provisioner-hostpath-mnt-disks mountPath: {{ local_volume_provisioner_mount_dir }} + mountPropagation: "HostToContainer" volumes: - name: local-volume-provisioner configMap: