I'm using k3s to test my k8s configurations. Sadly, imagePullSecrets
seems not to work properly.
I've tested the same configuration in minikube and it works fine.
Example:
I create the secret with:
kubectl create secret generic myreg --from-file=.dockerconfigjson=$HOME/.docker/config.json
And this is a daemonset example:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: foo
namespace: default
labels:
app: foo
spec:
selector:
matchLabels:
name: foo
template:
metadata:
labels:
name: foo
spec:
imagePullSecrets:
- name: myreg
containers:
- name: foo
image: whatever/foo:latest
The status stays as ErrImagePull
and running describe
over the pod it says:
Normal BackOff 2s kubelet, localhost Back-off pulling image "whatever/foo:latest"
Warning Failed 2s kubelet, localhost Error: ImagePullBackOff
Why Does it not work?