move flexvolume plugin directory creation to preinstall (#4999)

* move flexvolume plugin directory creation to preinstall

* changes per pr feedback
pull/5021/head
Jeff Bornemann 2019-07-30 15:00:10 -04:00 committed by Kubernetes Prow Robot
parent fbbfff3795
commit da50ed0936
6 changed files with 15 additions and 3 deletions

View File

@ -191,6 +191,9 @@ podsecuritypolicy_enabled: false
# Acceptable options are 'pods', 'system-reserved', 'kube-reserved' and ''. Default is "".
# kubelet_enforce_node_allocatable: pods
# An alternative flexvolume plugin directory
# kubelet_flexvolumes_plugins_dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
## Supplementary addresses that can be added in kubernetes ssl keys.
## That can be useful for example to setup a keepalived virtual IP
# supplementary_addresses_in_ssl_keys: [10.0.0.1, 10.0.0.2, 10.0.0.3]

View File

@ -50,8 +50,6 @@ loadbalancer_apiserver_cpu_requests: 25m
# - extensions/v1beta1/daemonsets=true
# - extensions/v1beta1/deployments=true
kubelet_flexvolumes_plugins_dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
# A port range to reserve for services with NodePort visibility.
# Inclusive at both ends of the range.
kube_apiserver_node_port_range: "30000-32767"

View File

@ -7,7 +7,6 @@ Wants=docker.socket
[Service]
User=root
EnvironmentFile=-{{ kube_config_dir }}/kubelet.env
ExecStartPre=-/bin/mkdir -p {{ kubelet_flexvolumes_plugins_dir }}
ExecStart={{ bin_dir }}/kubelet \
$KUBE_LOGTOSTDERR \
$KUBE_LOG_LEVEL \

View File

@ -25,6 +25,7 @@ kube_cert_group: kube-cert
kube_config_dir: /etc/kubernetes
kube_cert_dir: "{{ kube_config_dir }}/ssl"
kube_cert_compat_dir: /etc/kubernetes/pki
kubelet_flexvolumes_plugins_dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
# Container Linux by CoreOS cloud init config file to define /etc/resolv.conf content
# for hostnet pods and infra needs

View File

@ -178,3 +178,13 @@
etcd_deployment_type: host
when:
- etcd_kubeadm_enabled
- name: check /usr readonly
stat:
path: "/usr"
register: usr
- name: set alternate flexvolume path
set_fact:
kubelet_flexvolumes_plugins_dir: /var/lib/kubelet/volumeplugins
when: not usr.stat.writeable

View File

@ -22,6 +22,7 @@
- "{{ kube_cert_dir }}"
- "{{ kube_manifest_dir }}"
- "{{ kube_script_dir }}"
- "{{ kubelet_flexvolumes_plugins_dir }}"
- name: Check if kubernetes kubeadm compat cert dir exists
stat: