Helm 3 imagePullSecrets: [] secrete gives an error.
Error: unable to build Kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Deployment.spec.template.spec.imagePullSecrets0): invalid type for io.k8s.api.core.v1.LocalObjectReference: got "string", expected "map"
How to create ImagePullSecret:
https://helm.sh/docs/howto/charts_tips_and_tricks/#creating-image-pull-secrets
Add to deployment:
spec:
imagePullSecrets:
- name: myregistrykey
I use this setup and works fine.
In deployment.yaml
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
In values.yaml
imagePullSecrets:
- name: regcred
And create secret regcred
manually using
kubectl create secret docker-registry regcred --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>
You can find detailed documentation here