mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-21 02:47:39 -02:30
Skip kube-proxy addon phase during kubeadm upgrade if disabled (#12306)
This commit is contained in:
@@ -170,6 +170,7 @@
|
|||||||
- apiserver_sans_ip_check.changed or apiserver_sans_host_check.changed
|
- apiserver_sans_ip_check.changed or apiserver_sans_host_check.changed
|
||||||
- not kube_external_ca_mode
|
- not kube_external_ca_mode
|
||||||
|
|
||||||
|
# TODO: Remove --skip-phases from command when v1beta4 UpgradeConfiguration supports skipPhases
|
||||||
- name: Kubeadm | Initialize first control plane node
|
- name: Kubeadm | Initialize first control plane node
|
||||||
when: inventory_hostname == first_kube_control_plane and not kubeadm_already_run.stat.exists
|
when: inventory_hostname == first_kube_control_plane and not kubeadm_already_run.stat.exists
|
||||||
vars:
|
vars:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import_tasks: check-api.yml
|
import_tasks: check-api.yml
|
||||||
|
|
||||||
# kubeadm-config.v1beta4 with UpgradeConfiguration requires some values that were previously allowed as args to be specified in the config file
|
# kubeadm-config.v1beta4 with UpgradeConfiguration requires some values that were previously allowed as args to be specified in the config file
|
||||||
|
# TODO: Remove --skip-phases from command when v1beta4 UpgradeConfiguration supports skipPhases
|
||||||
- name: Kubeadm | Upgrade first control plane node
|
- name: Kubeadm | Upgrade first control plane node
|
||||||
command: >-
|
command: >-
|
||||||
timeout -k 600s 600s
|
timeout -k 600s 600s
|
||||||
@@ -16,13 +17,15 @@
|
|||||||
--force
|
--force
|
||||||
{%- else %}
|
{%- else %}
|
||||||
--config={{ kube_config_dir }}/kubeadm-config.yaml
|
--config={{ kube_config_dir }}/kubeadm-config.yaml
|
||||||
{%- endif -%}
|
{%- endif %}
|
||||||
|
--skip-phases={{ kubeadm_init_phases_skip | join(',') }}
|
||||||
register: kubeadm_upgrade
|
register: kubeadm_upgrade
|
||||||
when: inventory_hostname == first_kube_control_plane
|
when: inventory_hostname == first_kube_control_plane
|
||||||
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
|
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ bin_dir }}:{{ ansible_env.PATH }}"
|
PATH: "{{ bin_dir }}:{{ ansible_env.PATH }}"
|
||||||
|
|
||||||
|
# TODO: Remove --skip-phases from command when v1beta4 UpgradeConfiguration supports skipPhases
|
||||||
- name: Kubeadm | Upgrade other control plane nodes
|
- name: Kubeadm | Upgrade other control plane nodes
|
||||||
command: >-
|
command: >-
|
||||||
{{ bin_dir }}/kubeadm upgrade node
|
{{ bin_dir }}/kubeadm upgrade node
|
||||||
@@ -33,7 +36,8 @@
|
|||||||
{% if kubeadm_patches | length > 0 %}--patches={{ kubeadm_patches_dir }}{% endif %}
|
{% if kubeadm_patches | length > 0 %}--patches={{ kubeadm_patches_dir }}{% endif %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
--config={{ kube_config_dir }}/kubeadm-config.yaml
|
--config={{ kube_config_dir }}/kubeadm-config.yaml
|
||||||
{%- endif -%}
|
{%- endif %}
|
||||||
|
--skip-phases={{ kubeadm_init_phases_skip | join(',') }}
|
||||||
register: kubeadm_upgrade
|
register: kubeadm_upgrade
|
||||||
when: inventory_hostname != first_kube_control_plane
|
when: inventory_hostname != first_kube_control_plane
|
||||||
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
|
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
|
||||||
|
|||||||
@@ -470,6 +470,12 @@ apply:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||||
imagePullSerial: {{ kubeadm_image_pull_serial | lower }}
|
imagePullSerial: {{ kubeadm_image_pull_serial | lower }}
|
||||||
|
{% for skip_phase in kubeadm_init_phases_skip %}
|
||||||
|
{% if loop.first %}
|
||||||
|
skipPhases:
|
||||||
|
{% endif %}
|
||||||
|
- "{{ skip_phase }}"
|
||||||
|
{% endfor %}
|
||||||
node:
|
node:
|
||||||
certificateRenewal: {{ kubeadm_upgrade_auto_cert_renewal | lower }}
|
certificateRenewal: {{ kubeadm_upgrade_auto_cert_renewal | lower }}
|
||||||
etcdUpgrade: {{ (etcd_deployment_type == "kubeadm") | lower }}
|
etcdUpgrade: {{ (etcd_deployment_type == "kubeadm") | lower }}
|
||||||
@@ -485,6 +491,12 @@ node:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||||
imagePullSerial: {{ kubeadm_image_pull_serial | lower }}
|
imagePullSerial: {{ kubeadm_image_pull_serial | lower }}
|
||||||
|
{% for skip_phase in kubeadm_init_phases_skip %}
|
||||||
|
{% if loop.first %}
|
||||||
|
skipPhases:
|
||||||
|
{% endif %}
|
||||||
|
- "{{ skip_phase }}"
|
||||||
|
{% endfor %}
|
||||||
---
|
---
|
||||||
apiVersion: kubeproxy.config.k8s.io/v1alpha1
|
apiVersion: kubeproxy.config.k8s.io/v1alpha1
|
||||||
kind: KubeProxyConfiguration
|
kind: KubeProxyConfiguration
|
||||||
|
|||||||
Reference in New Issue
Block a user