HI Team,
I’m working on K8s labs for Networking weave. For the last question I have tried to create nginx pod on node03 to check the routes but getting below error
Warning FailedCreatePodSandBox 13m kubelet, node03 Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container “115fd9bf69282a6a4cda9b09931ad9df63509cbe912f8f122eb033c4545585c8” network for pod “nginx”: networkPlugin cni failed to set up pod “nginx_default” network: open /run/flannel/subnet.env: no such file or directory
master $ pwd
/etc/cni/net.d
master $ ls
10-weave.conflist
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
resources: {}
args: [“sleep”, “1000”]
nodeName: node02
dnsPolicy: ClusterFirst
restartPolicy: Always
Even I got errors while creating pods using Image Security option. I have tried multiple ways still getting errors
Error:
Warning Failed 60s (x4 over 2m28s) kubelet, node01 Failed to pull image “myprivateregistry.com:5000/nginx:alpine”: rpc error: code = Unknown desc = Error response from daemon: unauthorized: authentication required
master $ kubectl get secrets private-reg-cred
NAME TYPE DATA AGE
private-reg-cred kubernetes.io/dockerconfigjson 1 2m41s
apiVersion: v1
data:
.dockerconfigjson: eyJhdXRocyI6eyJteXByaXZhdGVyZWdpc3RyeS5jb206NTAwMCI6eyJ1c2VybmFtZSI6ImRvY2tfdXNlciIsInBhc3N3b3JkIjoiZ
G9ja19wYXNzd29yZCIsImVtYWlsIjoiZG9ja191c2VyQG15cHJpdmF0ZXJlZ2lzdHJ5LmNvbSIsImF1dGgiOiJaRzlqYTE5MWMyVnlPbVJ2WTJ0ZmNHRnpjM2R
2Y21RPSJ9fX0=
kind: Secret
Deploy config:
containers:
- image: myprivateregistry.com:5000/nginx:alpine
imagePullPolicy: IfNotPresent
name: nginx
imagePullSecrets:
- name: private-reg-cred