Skip to content

add volume config generation #8450

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

Merged
merged 1 commit into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions roles/openshift_node_group/tasks/create_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@
when: openshift_node_group_edits|length > 0
run_once: true

- name: create volume config template
template:
src: volume-config.yaml.j2
dest: "{{ mktempout.stdout }}/volume-config.yaml"
when:
- configout.results.results.0 == {} and openshift_node_group_name != "" and openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != ""
run_once: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run_once means that it will run only on the first node of a set of nodes. We'd want this file to get deployed to all relevant nodes, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I should've read the entire PR before commenting.


- name: lay down the volume config from the existing configmap
copy:
content: "{{ configout.results.results.0.data['volume-config.yaml'] }}"
dest: "{{ mktempout.stdout }}/volume-config.yaml"
when:
- configout.results.results.0 != {} and openshift_node_group_name != "" and openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != ""
run_once: true

- debug: var=yeditout
run_once: true

Expand All @@ -53,6 +69,19 @@
namespace: "{{ openshift_node_group_namespace }}"
from_file:
node-config.yaml: "{{ mktempout.stdout }}/node-config.yaml"
when:
- openshift_node_local_quota_per_fsgroup is undefined or openshift_node_local_quota_per_fsgroup == ""
run_once: true

- name: create node-config.yaml and volume-config.yaml configmap
oc_configmap:
name: "{{ openshift_node_group_name }}"
namespace: "{{ openshift_node_group_namespace }}"
from_file:
node-config.yaml: "{{ mktempout.stdout }}/node-config.yaml"
volume-config.yaml: "{{ mktempout.stdout }}/volume-config.yaml"
when:
- openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != ""
run_once: true

- name: remove templated files
Expand Down
4 changes: 4 additions & 0 deletions roles/openshift_node_group/templates/volume-config.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kubelet.config.openshift.io/v1
kind: VolumeConfig
localQuota:
perFSGroup: {{ openshift_node_local_quota_per_fsgroup }}