Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubelet_flexvolumes_plugins_dir undefined in v2.14.0 #6640

Closed
w33dw0r7d opened this issue Sep 8, 2020 · 2 comments · Fixed by #6645
Closed

kubelet_flexvolumes_plugins_dir undefined in v2.14.0 #6640

w33dw0r7d opened this issue Sep 8, 2020 · 2 comments · Fixed by #6645
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@w33dw0r7d
Copy link
Contributor

Environment:

  • Cloud provider or hardware configuration:
    openstack

  • OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"):

Linux 3.10.0-1127.19.1.el7.x86_64 x86_64
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
  • Version of Ansible (ansible --version):
ansible 2.9.6
  config file = /Users/v.fidunin/workdir/kubespray/test_spray/ansible.cfg
  configured module search path = ['/Users/v.fidunin/workdir/kubespray/test_spray/library']
  ansible python module location = /Users/v.fidunin/workdir/kubespray/test_spray/env/lib/python3.8/site-packages/ansible
  executable location = /Users/v.fidunin/workdir/kubespray/test_spray/env/bin/ansible
  python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]
  • Version of Python (python --version):
Python 3.8.5

Kubespray version (commit) (git rev-parse --short HEAD):

a1f04e98

tag v2.14.0

Network plugin used:

calico

Command used to invoke ansible:

 ansible-playbook -i inventory/k8s-vf/hosts.yaml --become --become-user=root cluster.yml

Output of ansible run:

TASK [kubernetes-apps/external_cloud_controller/openstack : External OpenStack Cloud Controller | Generate Manifests] *******************************************************************************************************************************
ok: [k8s-vf-master-01] => (item={'name': 'external-openstack-cloud-config-secret', 'file': 'external-openstack-cloud-config-secret.yml'})
ok: [k8s-vf-master-01] => (item={'name': 'external-openstack-cloud-controller-manager-roles', 'file': 'external-openstack-cloud-controller-manager-roles.yml'})
ok: [k8s-vf-master-01] => (item={'name': 'external-openstack-cloud-controller-manager-role-bindings', 'file': 'external-openstack-cloud-controller-manager-role-bindings.yml'})
failed: [k8s-vf-master-01] (item={'name': 'external-openstack-cloud-controller-manager-ds', 'file': 'external-openstack-cloud-controller-manager-ds.yml'}) => {"ansible_loop_var": "item", "changed": false, "item": {"file": "external-openstack-cloud-controller-manager-ds.yml", "name": "external-openstack-cloud-controller-manager-ds"}, "msg": "AnsibleUndefinedVariable: 'kubelet_flexvolumes_plugins_dir' is undefined"}

Anything else do we need to know:
openstack.yaml

openstack_blockstorage_version: "v2"
cinder_csi_enabled: true

workaround:

+++ b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-controller-manager-ds.yml.j2
@@ -59,8 +59,10 @@ spec:
               name: openstack-cacert
               readOnly: true
 {% endif %}
+{% if kubelet_flexvolumes_plugins_dir is defined %}
             - mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
               name: flexvolume-dir
+{% endif %}
           resources:
             requests:
               cpu: 200m
@@ -69,10 +71,12 @@ spec:
               value: /etc/config/cloud.conf
       hostNetwork: true
       volumes:
+{% if kubelet_flexvolumes_plugins_dir is defined %}
       - hostPath:
           path: "{{ kubelet_flexvolumes_plugins_dir }}"
           type: DirectoryOrCreate
         name: flexvolume-dir
+{% endif %}
       - hostPath:
           path: /etc/kubernetes/pki
           type: DirectoryOrCreate

If this ok, I can make PR.

@w33dw0r7d w33dw0r7d added the kind/bug Categorizes issue or PR as related to a bug. label Sep 8, 2020
@floryut
Copy link
Member

floryut commented Sep 9, 2020

Looks fine by me, if you could submit a PR that'd very welcome @w33dw0r7d

@w33dw0r7d
Copy link
Contributor Author

@floryut done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants