Browse Source
Skip kube-proxy addon phase during kubeadm upgrade if disabled (#12320)
Co-authored-by: Roman Davydchenko <xatteg@gmail.com>
pull/12327/head
k8s-infra-cherrypick-robot
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
19 additions and
2 deletions
-
roles/kubernetes/control-plane/tasks/kubeadm-setup.yml
-
roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml
-
roles/kubernetes/control-plane/templates/kubeadm-config.v1beta4.yaml.j2
|
|
@ -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 |
|
|
|
|
|
@ -502,6 +502,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 }} |
|
|
@ -517,6 +523,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 |
|
|
|