Skip to content

Commit

Permalink
Merge pull request #1402 from zexi/k8s-host-network-options
Browse files Browse the repository at this point in the history
fix(k8s): add node host-networks options
  • Loading branch information
zexi authored Dec 24, 2024
2 parents 5500c74 + 90d2254 commit f081838
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion onecloud/roles/master-node/tasks/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@
name: utils/set-hostnetworks
when: host_networks is undefined or host_networks == ''

- name: Set host_networks_options
set_fact:
host_networks_options: "{{ host_networks | join(' --host-networks ') }}"
when:
host_networks is defined

- name: construct host network args
set_fact:
join_args: "{{ join_args }} --host-networks {{ host_networks }} "
join_args: "{{ join_args }} --host-networks {{ host_networks_options }} "
when:
host_networks is defined

Expand Down
8 changes: 7 additions & 1 deletion onecloud/roles/primary-master-node/setup_k8s/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,15 @@
when:
node_ip is defined

- name: Set host_networks_options
set_fact:
host_networks_options: "{{ host_networks | join(' --host-networks ') }}"
when:
host_networks is defined

- name: Construct init args host_networks
set_fact:
init_args: "{{ init_args }} --host-networks {{ host_networks }} "
init_args: "{{ init_args }} --host-networks {{ host_networks_options }} "
when:
host_networks is defined

Expand Down
8 changes: 7 additions & 1 deletion onecloud/roles/worker-node/tasks/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,15 @@
name: utils/set-hostnetworks
when: host_networks is undefined or host_networks == ''

- name: Set host_networks_options
set_fact:
host_networks_options: "{{ host_networks | join(' --host-networks ') }}"
when:
host_networks is defined

- name: construct host network args
set_fact:
join_args: "{{ join_args }} --host-networks {{ host_networks }} "
join_args: "{{ join_args }} --host-networks {{ host_networks_options }} "
when:
host_networks is defined

Expand Down

0 comments on commit f081838

Please sign in to comment.