Closed kingsd041 closed 4 days ago
We can update the docs, but it is not intended that credentials would be looked up from the wildcard section. If this was done, then an attacker could compromise your credentials by deploying a pod that used an image that came from their registry, and then stealing the credentials when containerd connected and authenticated to pull the image.
Environmental Info: K3s Version: v1.30.6+k3s1
Node(s) CPU architecture, OS, and Version: 22.04.4
Cluster Configuration:
1 server Describe the bug:
When configuring the
registries.yaml
file to use a wildcard (*
) for bothmirrors
andconfigs
, K3s fails to pull images from the private Harbor registry that requires authentication.Using specific configurations works as expected. However, the behavior with wildcards is inconsistent.
Steps To Reproduce:
Configure a private Harbor registry (e.g.,
public.kingsd.top
) that requires authentication for image pulls.Example image:
public.kingsd.top/demo/nginx:1.27
Configure
/etc/rancher/k3s/registries.yaml
as follows:Scenario A (Wildcard for Both Mirrors and Configs)
Result:
Pulling the image fails with the error:
Scenario B (Specific Mirror, Wildcard Config)
Result:
Pulling the image fails with the same error as Scenario A.
Scenario C (Wildcard Mirror, Specific Config)
Result:
Image pull succeeds.
systemctl restart k3s
Attempt to pull the image:
Expected behavior:
Wildcard configurations for both
mirrors
andconfigs
should work consistently and allow pulling images when proper authentication is provided.The documentation mentions wildcard support but does not specify limitations related to this case.
Relevant doc link: Private Registry - Wildcard Support
Actual behavior:
Additional context / logs: