Browse Source

Remove kubeadm_version and use kube_version instead (#11473)

We explicitly check for equality so customizing kubeadm_version does not
work at the moment.

Use only one variable instead.
pull/11477/head
Max Gautier 2 months ago
committed by GitHub
parent
commit
a3d0ba230d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 13 deletions
  1. 2
      inventory/sample/group_vars/all/offline.yml
  2. 7
      roles/download/tasks/prep_kubeadm_images.yml
  3. 9
      roles/kubespray-defaults/defaults/main/download.yml

2
inventory/sample/group_vars/all/offline.yml

@ -18,7 +18,7 @@
# quay_image_repo: "{{ registry_host }}"
## Kubernetes components
# kubeadm_download_url: "{{ files_repo }}/dl.k8s.io/release/{{ kubeadm_version }}/bin/linux/{{ image_arch }}/kubeadm"
# kubeadm_download_url: "{{ files_repo }}/dl.k8s.io/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubeadm"
# kubectl_download_url: "{{ files_repo }}/dl.k8s.io/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubectl"
# kubelet_download_url: "{{ files_repo }}/dl.k8s.io/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubelet"

7
roles/download/tasks/prep_kubeadm_images.yml

@ -1,11 +1,4 @@
---
- name: Prep_kubeadm_images | Check kubeadm version matches kubernetes version
fail:
msg: "Kubeadm version {{ kubeadm_version }} do not matches kubernetes {{ kube_version }}"
when:
- not skip_downloads | default(false)
- not kubeadm_version == downloads.kubeadm.version
- name: Prep_kubeadm_images | Download kubeadm binary
include_tasks: "download_file.yml"
vars:

9
roles/kubespray-defaults/defaults/main/download.yml

@ -74,7 +74,6 @@ image_info_command_on_localhost: "{{ lookup('vars', image_command_tool_on_localh
image_arch: "{{ host_architecture | default('amd64') }}"
# Versions
kubeadm_version: "{{ kube_version }}"
crun_version: 1.14.4
runc_version: v1.1.13
kata_containers_version: 3.1.3
@ -173,7 +172,7 @@ get_helm_url: https://get.helm.sh
# Download URLs
kubelet_download_url: "{{ dl_k8s_io_url }}/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubelet"
kubectl_download_url: "{{ dl_k8s_io_url }}/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubectl"
kubeadm_download_url: "{{ dl_k8s_io_url }}/release/{{ kubeadm_version }}/bin/linux/{{ image_arch }}/kubeadm"
kubeadm_download_url: "{{ dl_k8s_io_url }}/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubeadm"
etcd_download_url: "{{ github_url }}/etcd-io/etcd/releases/download/{{ etcd_version }}/etcd-{{ etcd_version }}-linux-{{ image_arch }}.tar.gz"
cni_download_url: "{{ github_url }}/containernetworking/plugins/releases/download/{{ cni_version }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz"
calicoctl_download_url: "{{ github_url }}/projectcalico/calico/releases/download/{{ calico_ctl_version }}/calicoctl-linux-{{ image_arch }}"
@ -200,7 +199,7 @@ etcd_binary_checksum: "{{ etcd_binary_checksums[image_arch][etcd_version] }}"
cni_binary_checksum: "{{ cni_binary_checksums[image_arch][cni_version] }}"
kubelet_binary_checksum: "{{ kubelet_checksums[image_arch][kube_version] }}"
kubectl_binary_checksum: "{{ kubectl_checksums[image_arch][kube_version] }}"
kubeadm_binary_checksum: "{{ kubeadm_checksums[image_arch][kubeadm_version] }}"
kubeadm_binary_checksum: "{{ kubeadm_checksums[image_arch][kube_version] }}"
yq_binary_checksum: "{{ yq_checksums[image_arch][yq_version] }}"
calicoctl_binary_checksum: "{{ calicoctl_binary_checksums[image_arch][calico_ctl_version] }}"
calico_crds_archive_checksum: "{{ calico_crds_archive_checksums[calico_version] }}"
@ -466,8 +465,8 @@ downloads:
kubeadm:
enabled: true
file: true
version: "{{ kubeadm_version }}"
dest: "{{ local_release_dir }}/kubeadm-{{ kubeadm_version }}-{{ image_arch }}"
version: "{{ kube_version }}"
dest: "{{ local_release_dir }}/kubeadm-{{ kube_version }}-{{ image_arch }}"
sha256: "{{ kubeadm_binary_checksum }}"
url: "{{ kubeadm_download_url }}"
unarchive: false

Loading…
Cancel
Save