mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
fix: update containerd config template to handle image registry authentication more robustly (#2842)
Signed-off-by: redscholar <blacktiledhouse@gmail.com>
This commit is contained in:
parent
c75b70bbcd
commit
6e382eaa73
|
|
@ -59,20 +59,22 @@ state = "/run/containerd"
|
||||||
{{- if or (.cri.registry.auths | empty | not) (.groups.image_registry | default list | empty | not) }}
|
{{- if or (.cri.registry.auths | empty | not) (.groups.image_registry | default list | empty | not) }}
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry.configs]
|
[plugins."io.containerd.grpc.v1.cri".registry.configs]
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .image_registry.auth.registry | empty | not }}
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ .image_registry.auth.registry }}".auth]
|
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ .image_registry.auth.registry }}".auth]
|
||||||
username = "{{ .image_registry.auth.username }}"
|
username = "{{ .image_registry.auth.username }}"
|
||||||
password = "{{ .image_registry.auth.password }}"
|
password = "{{ .image_registry.auth.password }}"
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ .image_registry.auth.registry }}".tls]
|
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ .image_registry.auth.registry }}".tls]
|
||||||
{{- if .image_registry.auth.ca_file | empty | not }}
|
{{- if .image_registry.auth.ca_file | empty | not }}
|
||||||
ca_file = "/etc/containerd/certs.d/{{ .image_registry.auth.registry }}/ca.crt"
|
ca_file = "/etc/containerd/certs.d/{{ .image_registry.auth.registry }}/ca.crt"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .image_registry.auth.cert_file | empty | not }}
|
{{- if .image_registry.auth.cert_file | empty | not }}
|
||||||
cert_file = "/etc/containerd/certs.d/{{ .image_registry.auth.registry }}/server.crt"
|
cert_file = "/etc/containerd/certs.d/{{ .image_registry.auth.registry }}/server.crt"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .image_registry.auth.key_file | empty | not }}
|
{{- if .image_registry.auth.key_file | empty | not }}
|
||||||
key_file = "/etc/containerd/certs.d/{{ .image_registry.auth.registry }}/server.key"
|
key_file = "/etc/containerd/certs.d/{{ .image_registry.auth.registry }}/server.key"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
insecure_skip_verify = {{ .image_registry.auth.insecure | default true }}
|
insecure_skip_verify = {{ .image_registry.auth.insecure | default true }}
|
||||||
|
{{- end }}
|
||||||
{{- if .cri.registry.auths | empty | not }}
|
{{- if .cri.registry.auths | empty | not }}
|
||||||
{{- range .cri.registry.auths }}
|
{{- range .cri.registry.auths }}
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ .repo }}".auth]
|
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ .repo }}".auth]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue