From 5ea2d1eb67c51b173916cda40194a89532816794 Mon Sep 17 00:00:00 2001 From: muzi502 <42566386+muzi502@users.noreply.github.com> Date: Fri, 30 Apr 2021 08:51:57 +0800 Subject: [PATCH] Add image_arch in flannel image tag (#7560) * Add image_arch variable when download flannel image * Fix flannel image tag typo with image arch --- roles/download/defaults/main.yml | 2 +- roles/network_plugin/flannel/templates/cni-flannel.yml.j2 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/download/defaults/main.yml b/roles/download/defaults/main.yml index 209422db9..a5fa6edad 100644 --- a/roles/download/defaults/main.yml +++ b/roles/download/defaults/main.yml @@ -401,7 +401,7 @@ kube_proxy_image_repo: "{{ kube_image_repo }}/kube-proxy" etcd_image_repo: "{{ quay_image_repo }}/coreos/etcd" etcd_image_tag: "{{ etcd_version }}{%- if image_arch != 'amd64' -%}-{{ image_arch }}{%- endif -%}" flannel_image_repo: "{{ quay_image_repo }}/coreos/flannel" -flannel_image_tag: "{{ flannel_version }}" +flannel_image_tag: "{{ flannel_version }}-{{ image_arch }}" calico_node_image_repo: "{{ quay_image_repo }}/calico/node" calico_node_image_tag: "{{ calico_version }}{%- if image_arch != 'amd64' -%}-{{ image_arch }}{%- endif -%}" calico_cni_image_repo: "{{ quay_image_repo }}/calico/cni" diff --git a/roles/network_plugin/flannel/templates/cni-flannel.yml.j2 b/roles/network_plugin/flannel/templates/cni-flannel.yml.j2 index 485afe293..b642ff298 100644 --- a/roles/network_plugin/flannel/templates/cni-flannel.yml.j2 +++ b/roles/network_plugin/flannel/templates/cni-flannel.yml.j2 @@ -66,7 +66,7 @@ spec: serviceAccountName: flannel containers: - name: kube-flannel - image: {{ flannel_image_repo }}:{{ flannel_image_tag }}-{{ arch }} + image: {{ flannel_image_repo }}:{{ flannel_image_tag | regex_replace(image_arch,'') }}{{ arch }} imagePullPolicy: {{ k8s_image_pull_policy }} resources: limits: @@ -109,7 +109,7 @@ spec: - {{ arch }} initContainers: - name: install-cni - image: {{ flannel_image_repo }}:{{ flannel_image_tag }}-{{ arch }} + image: {{ flannel_image_repo }}:{{ flannel_image_tag | regex_replace(image_arch,'') }}{{ arch }} command: - cp args: