Browse Source

Fix volume location in containarized installs

Hemant Kumar 6 years ago
parent
commit
9c02aa7220

+ 6 - 0
roles/openshift_control_plane/tasks/main.yml

@@ -45,6 +45,12 @@
     path: "/etc/origin/master"
     state: directory
 
+- name: Create flexvolume directory when containerized
+  file:
+    state: directory
+    path: "{{ openshift_flexvolume_container_directory_default }}/volume/exec"
+    mode: '0750'
+
 - name: Create the policy file if it does not already exist
   command: >
     {{ openshift_client_binary }} adm create-bootstrap-policy-file

+ 2 - 0
roles/openshift_control_plane/templates/master.yaml.v1.j2

@@ -83,6 +83,8 @@ kubernetesMasterConfig:
     - VolumeScheduling=true
 {% endif %}
   controllerArguments: {{ openshift.master.controller_args | default(None) | lib_utils_to_padded_yaml( level=2 ) }}
+    flex-volume-plugin-dir:
+    - "{{ openshift_flexvolume_container_directory_default }}/volume/exec"
 {% if openshift_master_use_persistentlocalvolumes | bool %}
     feature-gates:
     - PersistentLocalVolumes=true

+ 1 - 0
roles/openshift_facts/defaults/main.yml

@@ -142,3 +142,4 @@ openshift_node_groups:
       - 'node-role.kubernetes.io/infra=true,node-role.kubernetes.io/master=true,node-role.kubernetes.io/compute=true'
     edits: []
 openshift_master_manage_htpasswd: True
+openshift_flexvolume_container_directory_default: "/etc/origin/kubelet-plugins"

+ 7 - 0
roles/openshift_node/tasks/config.yml

@@ -47,6 +47,13 @@
     state: directory
     mode: 0755
 
+- name: Create flexvolume directory when running on atomic
+  file:
+    state: directory
+    path: "{{ openshift_flexvolume_container_directory_default }}/volume/exec"
+    mode: '0750'
+  when: openshift_is_atomic | bool
+
 - name: include aws provider credentials
   import_tasks: aws.yml
   when: not (openshift_node_use_instance_profiles | default(False))

+ 4 - 0
roles/openshift_node/templates/node.yaml.v1.j2

@@ -12,6 +12,10 @@ imageConfig:
   latest: {{ openshift_node_image_config_latest }}
 kind: NodeConfig
 kubeletArguments: {{  l2_openshift_node_kubelet_args  | default(None) | lib_utils_to_padded_yaml(level=1) }}
+{% if openshift_is_atomic | bool %}
+  volume-plugin-dir:
+  - "{{ openshift_flexvolume_container_directory_default }}/volume/exec"
+{% endif %}
 {% if openshift_use_crio | bool %}
   container-runtime:
   - remote