Browse Source

Fix kubernetes-app/argocd: download related things with the download role (#9786)

* Fix yq install in argocd role: use download_file instead of get_url

* Fix use download_file instead of get_url to download argocd-install manifest in argocd role

* Fix order and add arm64 checksum

* Fix: Failed to template loop_control.label: 'None'
pull/9805/head
pli 1 year ago
committed by GitHub
parent
commit
4ba1df5237
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 63 additions and 10 deletions
  1. 25
      roles/download/defaults/main.yml
  2. 48
      roles/kubernetes-apps/argocd/tasks/main.yml

25
roles/download/defaults/main.yml

@ -150,6 +150,8 @@ crio_supported_versions:
v1.24: v1.24.3 v1.24: v1.24.3
crio_version: "{{ crio_supported_versions[kube_major_version] }}" crio_version: "{{ crio_supported_versions[kube_major_version] }}"
yq_version: "v4.30.6"
# Download URLs # Download URLs
kubelet_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubelet" kubelet_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubelet"
kubectl_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubectl" kubectl_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/{{ image_arch }}/kubectl"
@ -174,6 +176,7 @@ krew_download_url: "https://github.com/kubernetes-sigs/krew/releases/download/{{
containerd_download_url: "https://github.com/containerd/containerd/releases/download/v{{ containerd_version }}/containerd-{{ containerd_version }}-linux-{{ image_arch }}.tar.gz" containerd_download_url: "https://github.com/containerd/containerd/releases/download/v{{ containerd_version }}/containerd-{{ containerd_version }}-linux-{{ image_arch }}.tar.gz"
cri_dockerd_download_url: "https://github.com/Mirantis/cri-dockerd/releases/download/v{{ cri_dockerd_version }}/cri-dockerd-{{ cri_dockerd_version }}.{{ image_arch }}.tgz" cri_dockerd_download_url: "https://github.com/Mirantis/cri-dockerd/releases/download/v{{ cri_dockerd_version }}/cri-dockerd-{{ cri_dockerd_version }}.{{ image_arch }}.tgz"
skopeo_download_url: "https://github.com/lework/skopeo-binary/releases/download/{{ skopeo_version }}/skopeo-linux-{{ image_arch }}" skopeo_download_url: "https://github.com/lework/skopeo-binary/releases/download/{{ skopeo_version }}/skopeo-linux-{{ image_arch }}"
yq_download_url: "https://github.com/mikefarah/yq/releases/download/{{ yq_version }}/yq_linux_{{ image_arch }}"
crictl_checksums: crictl_checksums:
arm: arm:
@ -837,11 +840,20 @@ skopeo_binary_checksums:
ppc64l3: ppc64l3:
v1.10.0: 0 v1.10.0: 0
yq_checksums:
arm64:
v4.30.6: 40ee3000d5b65703caffb0263a7d5e75164f10afd2c9a3c879b6016f0300ac25
v4.27.5: ea360a0ecdff30c8625ccd0b97f8714b8308a429fd839cf8ccc481f311e217c6
amd64:
v4.30.6: 2aabdd748d301fc2286ea9f73eb20477b4ce173fbf072e0102fff1fcbed05985
v4.27.5: 9a54846e81720ae22814941905cd3b056ebdffb76bf09acffa30f5e90b22d615
etcd_binary_checksum: "{{ etcd_binary_checksums[image_arch][etcd_version] }}" etcd_binary_checksum: "{{ etcd_binary_checksums[image_arch][etcd_version] }}"
cni_binary_checksum: "{{ cni_binary_checksums[image_arch][cni_version] }}" cni_binary_checksum: "{{ cni_binary_checksums[image_arch][cni_version] }}"
kubelet_binary_checksum: "{{ kubelet_checksums[image_arch][kube_version] }}" kubelet_binary_checksum: "{{ kubelet_checksums[image_arch][kube_version] }}"
kubectl_binary_checksum: "{{ kubectl_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][kubeadm_version] }}"
yq_binary_checksum: "{{ yq_checksums[image_arch][yq_version] }}"
calicoctl_binary_checksum: "{{ calicoctl_binary_checksums[image_arch][calico_ctl_version] }}" calicoctl_binary_checksum: "{{ calicoctl_binary_checksums[image_arch][calico_ctl_version] }}"
calico_crds_archive_checksum: "{{ calico_crds_archive_checksums[calico_version] }}" calico_crds_archive_checksum: "{{ calico_crds_archive_checksums[calico_version] }}"
ciliumcli_binary_checksum: "{{ ciliumcli_binary_checksums[image_arch][cilium_cli_version] }}" ciliumcli_binary_checksum: "{{ ciliumcli_binary_checksums[image_arch][cilium_cli_version] }}"
@ -1806,6 +1818,19 @@ downloads:
groups: groups:
- kube_control_plane - kube_control_plane
yq:
enabled: "{{ argocd_enabled }}"
file: true
version: "{{ yq_version }}"
dest: "{{ local_release_dir }}/yq"
sha256: "{{ yq_binary_checksum|default(None) }}"
url: "{{ yq_download_url }}"
unarchive: false
owner: "root"
mode: "0755"
groups:
- kube_control_plane
download_defaults: download_defaults:
container: false container: false
file: false file: false

48
roles/kubernetes-apps/argocd/tasks/main.yml

@ -1,10 +1,18 @@
--- ---
- name: Kubernetes Apps | Install yq
become: yes
get_url:
url: "https://github.com/mikefarah/yq/releases/download/v4.30.6/yq_linux_{{ host_architecture }}"
- name: Kubernetes Apps | Download yq
include_tasks: "../../../download/tasks/download_file.yml"
vars:
download: "{{ download_defaults | combine(downloads.yq) }}"
- name: Kubernetes Apps | Copy yq binary from download dir
synchronize:
src: "{{ local_release_dir }}/yq"
dest: "{{ bin_dir }}/yq" dest: "{{ bin_dir }}/yq"
mode: '0755'
compress: no
perms: yes
owner: no
group: no
delegate_to: "{{ inventory_hostname }}"
- name: Kubernetes Apps | Set ArgoCD template list - name: Kubernetes Apps | Set ArgoCD template list
set_fact: set_fact:
@ -19,17 +27,37 @@
- "inventory_hostname == groups['kube_control_plane'][0]" - "inventory_hostname == groups['kube_control_plane'][0]"
- name: Kubernetes Apps | Download ArgoCD remote manifests - name: Kubernetes Apps | Download ArgoCD remote manifests
become: yes
get_url:
url: "{{ item.url }}"
dest: "{{ kube_config_dir }}/{{ item.file }}"
mode: 0644
include_tasks: "../../../download/tasks/download_file.yml"
vars:
download_argocd:
enabled: "{{ argocd_enabled }}"
file: true
dest: "{{ local_release_dir }}/{{ item.file }}"
url: "{{ item.url }}"
unarchive: false
owner: "root"
mode: 0644
sha256: ""
download: "{{ download_defaults | combine(download_argocd) }}"
with_items: "{{ argocd_templates | selectattr('url', 'defined') | list }}" with_items: "{{ argocd_templates | selectattr('url', 'defined') | list }}"
loop_control: loop_control:
label: "{{ item.file }}" label: "{{ item.file }}"
when: when:
- "inventory_hostname == groups['kube_control_plane'][0]" - "inventory_hostname == groups['kube_control_plane'][0]"
- name: Kubernetes Apps | Copy ArgoCD remote manifests from download dir
synchronize:
src: "{{ local_release_dir }}/{{ item.file }}"
dest: "{{ kube_config_dir }}/{{ item.file }}"
compress: no
perms: yes
owner: no
group: no
delegate_to: "{{ inventory_hostname }}"
with_items: "{{ argocd_templates | selectattr('url', 'defined') | list }}"
when:
- "inventory_hostname == groups['kube_control_plane'][0]"
- name: Kubernetes Apps | Set ArgoCD namespace for remote manifests - name: Kubernetes Apps | Set ArgoCD namespace for remote manifests
become: yes become: yes
command: | command: |

Loading…
Cancel
Save