Skip to content

Commit 9c133e9

Browse files
authored
Merge pull request #30 from kishen-v/kubeadm-flags
Introduce ignore_preflight_errors flag for kubeadm
2 parents 1f831a4 + 907b07a commit 9c133e9

File tree

2 files changed

+10
-7
lines changed
  • kubetest2-tf/data/k8s-ansible

2 files changed

+10
-7
lines changed

kubetest2-tf/data/k8s-ansible/group_vars/all

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ release_marker: ci/latest
4747
bootstrap_token: abcdef.0123456789abcdef
4848
kubelet_extra_args: ""
4949
k8s_branch: master
50+
ignore_preflight_errors: "SystemVerification"
5051

5152
# in the format of: https://dl.k8s.io/{{ directory }}/{{ build_version }}/kubernetes-client-linux-ppc64le.tar.gz
5253
# Eg: https://dl.k8s.io/ci/v1.28.0-alpha.1.48+039ae1edf5a71f/kubernetes-client-linux-ppc64le.tar.gz

kubetest2-tf/data/k8s-ansible/roles/install-k8s/tasks/main.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@
6060

6161
- name: Perform kubeadm init on the control plane node based on LB configuration.
6262
command: >
63-
{% if loadbalancer == '' -%}
64-
kubeadm init --config /root/kubeadm.yaml
65-
{%- else -%}
66-
kubeadm init --config /root/kubeadm.yaml --upload-certs
67-
{%- endif %}
63+
kubeadm init --config /root/kubeadm.yaml
64+
{% if loadbalancer != '' %} --upload-certs{% endif %}
65+
{% if ignore_preflight_errors != '' %} --ignore-preflight-errors={{ ignore_preflight_errors }}{% endif %}
6866
when: inventory_hostname == groups['masters'][0]
6967

7068

@@ -88,7 +86,9 @@
8886
with_items: "{{ groups['all'] }}"
8987

9088
- name: kubeadm join control plane nodes
91-
command: "{{ kubernetes_cp_join_command }}"
89+
command: >
90+
{{ kubernetes_cp_join_command }}
91+
{% if ignore_preflight_errors != '' %} --ignore-preflight-errors={{ ignore_preflight_errors }}{% endif %}
9292
when: inventory_hostname != groups['masters'][0] and node_type == "master"
9393

9494
- name: Create a directory ${HOME}/.kube if it does not exist
@@ -134,5 +134,7 @@
134134
with_items: "{{ groups['all'] }}"
135135

136136
- name: kubeadm join worker nodes
137-
command: "{{ kubernetes_join_command }}"
137+
command: >
138+
{{ kubernetes_join_command }}
139+
{% if ignore_preflight_errors != '' %} --ignore-preflight-errors={{ ignore_preflight_errors }}{% endif %}
138140
when: node_type == "worker"

0 commit comments

Comments
 (0)