Open aDisplayName opened 4 days ago
Hello,
Concerning your question, there is currently no way to do what you ask. You still can use pull secrets attached to a service account and it will be used for pods using this service account, but I understand that it doesn't exactly achieve what you try to do. #385 asked for a similar feature, and while adding an option of a global ImagePullSecret is not something we intend to do, I find the idea of injecting pull secrets for repositories with a specific prefix interesting. But I'm still not sure if it is in the scope of kuik. Maybe a kyverno policy would be enough?
For instance something like this (generated with ChatGPT):
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: add-pull-secret-to-cachedimage
spec:
rules:
- name: add-pull-secret
match:
resources:
kinds:
- CachedImage
preconditions:
all:
- key: "{{ request.object.metadata.labels['kuik.enix.io/repository'] }}"
operator: In
value: ["registry.k8s.io-kube-state-metrics-kube-state-metrics"]
mutate:
patchStrategicMerge:
spec:
imagePullSecrets:
- name: my-pull-secret # Replace with the desired pull secret name
kube-image-keeper: v1.10.0
Here is our setup:
Our clusters are not hosted on the cloud so we don't know if the recent PR #428 gonna help us. Question: Is there a way to specify / inject the global pull secret for the entire cluster for repository using a certain prefixes? We don't mind to inject to kuik deployment if it is allowed.