mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-01-11 01:57:37 -03:30
Skip kube-proxy addon phase during kubeadm upgrade if disabled (#12306)
This commit is contained in:
parent
85cf0014cd
commit
dca2a5ecb3
@ -170,6 +170,7 @@
|
||||
- apiserver_sans_ip_check.changed or apiserver_sans_host_check.changed
|
||||
- not kube_external_ca_mode
|
||||
|
||||
# TODO: Remove --skip-phases from command when v1beta4 UpgradeConfiguration supports skipPhases
|
||||
- name: Kubeadm | Initialize first control plane node
|
||||
when: inventory_hostname == first_kube_control_plane and not kubeadm_already_run.stat.exists
|
||||
vars:
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
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
|
||||
# TODO: Remove --skip-phases from command when v1beta4 UpgradeConfiguration supports skipPhases
|
||||
- name: Kubeadm | Upgrade first control plane node
|
||||
command: >-
|
||||
timeout -k 600s 600s
|
||||
@ -16,13 +17,15 @@
|
||||
--force
|
||||
{%- else %}
|
||||
--config={{ kube_config_dir }}/kubeadm-config.yaml
|
||||
{%- endif -%}
|
||||
{%- endif %}
|
||||
--skip-phases={{ kubeadm_init_phases_skip | join(',') }}
|
||||
register: kubeadm_upgrade
|
||||
when: inventory_hostname == first_kube_control_plane
|
||||
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
|
||||
environment:
|
||||
PATH: "{{ bin_dir }}:{{ ansible_env.PATH }}"
|
||||
|
||||
# TODO: Remove --skip-phases from command when v1beta4 UpgradeConfiguration supports skipPhases
|
||||
- name: Kubeadm | Upgrade other control plane nodes
|
||||
command: >-
|
||||
{{ bin_dir }}/kubeadm upgrade node
|
||||
@ -33,7 +36,8 @@
|
||||
{% if kubeadm_patches | length > 0 %}--patches={{ kubeadm_patches_dir }}{% endif %}
|
||||
{%- else %}
|
||||
--config={{ kube_config_dir }}/kubeadm-config.yaml
|
||||
{%- endif -%}
|
||||
{%- endif %}
|
||||
--skip-phases={{ kubeadm_init_phases_skip | join(',') }}
|
||||
register: kubeadm_upgrade
|
||||
when: inventory_hostname != first_kube_control_plane
|
||||
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
|
||||
|
||||
@ -470,6 +470,12 @@ apply:
|
||||
{% endif %}
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
imagePullSerial: {{ kubeadm_image_pull_serial | lower }}
|
||||
{% for skip_phase in kubeadm_init_phases_skip %}
|
||||
{% if loop.first %}
|
||||
skipPhases:
|
||||
{% endif %}
|
||||
- "{{ skip_phase }}"
|
||||
{% endfor %}
|
||||
node:
|
||||
certificateRenewal: {{ kubeadm_upgrade_auto_cert_renewal | lower }}
|
||||
etcdUpgrade: {{ (etcd_deployment_type == "kubeadm") | lower }}
|
||||
@ -485,6 +491,12 @@ node:
|
||||
{% endif %}
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
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
|
||||
kind: KubeProxyConfiguration
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user