From 363fa287f71b06d1401fca49b06eec1de550a520 Mon Sep 17 00:00:00 2001 From: zuoxuesong-worker Date: Tue, 2 Sep 2025 15:08:02 +0800 Subject: [PATCH] bugfix: change k8s default config image tags (#2741) Signed-off-by: xuesongzuo@yunify.com --- builtin/core/roles/native/dns/tasks/main.yaml | 7 ++++--- builtin/core/roles/native/meta/main.yaml | 15 +++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/builtin/core/roles/native/dns/tasks/main.yaml b/builtin/core/roles/native/dns/tasks/main.yaml index 5795ea71..56c3a4ef 100644 --- a/builtin/core/roles/native/dns/tasks/main.yaml +++ b/builtin/core/roles/native/dns/tasks/main.yaml @@ -80,7 +80,6 @@ {{- if (index .hostvars (.groups.image_registry | first) "internal_ipv6") | empty | not }} {{ index .hostvars (.groups.image_registry | first) "internal_ipv6" }} {{ .image_registry.auth.registry }} {{- end }} - {{ .image_registry.auth.registry }} {{- end }} {{- end }} # kubekey image_registry control_plane_endpoint END @@ -132,7 +131,9 @@ # - Worker: 127.0.0.1 {{ .kubernetes.control_plane_endpoint.host }} - name: DNS | Set local DNS for kubernetes control plane endpoint - loop: "{{ .native.localDNS | toJson }}" + loop: "{{ .native.localDNS | toJson }}" + when: + - .groups.k8s_cluster | default list | has .inventory_hostname command: | # Remove any previous Kubekey-managed kubernetes control plane endpoint DNS entries sed -i ':a;$!{N;ba};s@# kubekey kubernetes control_plane_endpoint BEGIN.*# kubekey kubernetes control_plane_endpoint END@@' {{ .item }} @@ -145,5 +146,5 @@ 127.0.0.1 {{ .kubernetes.control_plane_endpoint.host }} ::1 {{ .kubernetes.control_plane_endpoint.host }} {{- end }} - # kubekey kubernetes kubernetes control_plane_endpoint END + # kubekey kubernetes control_plane_endpoint END EOF \ No newline at end of file diff --git a/builtin/core/roles/native/meta/main.yaml b/builtin/core/roles/native/meta/main.yaml index a07100db..f65e1269 100644 --- a/builtin/core/roles/native/meta/main.yaml +++ b/builtin/core/roles/native/meta/main.yaml @@ -1,15 +1,18 @@ dependencies: - # install nfs for nfs nodes - - role: native/nfs - when: .groups.nfs | default list | has .inventory_hostname - # Always perform initialization steps for all nodes - - role: native/ntp - - role: native/dns # Initialize new Kubernetes nodes - role: native/repository when: - .groups.k8s_cluster | default list | has .inventory_hostname - .kubernetes_install_LoadState.stdout | eq "not-found" + # install nfs for nfs nodes + - role: native/nfs + when: .groups.nfs | default list | has .inventory_hostname + # Always perform initialization steps for all nodes + - role: native/ntp + when: + - .groups.k8s_cluster | default list | has .inventory_hostname + - .kubernetes_install_LoadState.stdout | eq "not-found" + - role: native/dns - role: native/init