I was trying ” kubectl apply -f nfs-client.yaml “
# nfs-client.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nfs-provisioner
spec:
selector:
matchLabels:
app: nfs-provisioner
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: nfs-provisioner
spec:
serviceAccount: nfs-provisioner
containers:
- name: nfs-provisioner
image: registry.k8s.io/sig-storage/nfs-subdir-external-provisioner:v4.0.2
imagePullPolicy: Never
volumeMounts:
- name: nfs-client
mountPath: /persistentvolumes
env:
- name: PROVISIONER_NAME
value: example.com/nfs
- name: NFS_SERVER
value: 192.168.176.134
- name: NFS_PATH
value: /srv/nfs
volumes:
- name: nfs-client
nfs:
server: 192.168.176.134
path: /srv/nfs
When I executed “kubectl get pod”, it displayed
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
nfs-provisioner-7685bb75f5-4lv67 0/1 ContainerCreating 0 15m
then I excuted “kubectl describe pod nfs-provisioner-7685bb75f5-4lv67”, it displayed
Name: nfs-provisioner-7685bb75f5-4lv67
Namespace: default
Priority: 0
Service Account: nfs-provisioner
Node: ubuntunode2/192.168.176.136
Start Time: Sat, 22 Jun 2024 13:53:57 +0000
Labels: app=nfs-provisioner
pod-template-hash=7685bb75f5
Annotations: <none>
Status: Pending
IP:
IPs: <none>
Controlled By: ReplicaSet/nfs-provisioner-7685bb75f5
Containers:
nfs-provisioner:
Container ID:
Image: registry.k8s.io/sig-storage/nfs-subdir-external-provisioner:v4.0.2
Image ID:
Port: <none>
Host Port: <none>
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Environment:
PROVISIONER_NAME: example.com/nfs
NFS_SERVER: 192.168.176.134
NFS_PATH: /srv/nfs
Mounts:
/persistentvolumes from nfs-client (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-7lmnt (ro)
Conditions:
Type Status
PodReadyToStartContainers False
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
nfs-client:
Type: NFS (an NFS mount that lasts the lifetime of a pod)
Server: 192.168.176.134
Path: /srv/nfs
ReadOnly: false
kube-api-access-7lmnt:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 18m default-scheduler Successfully assigned default/nfs-provisioner-7685bb75f5-4lv67 to ubuntunode2
Warning FailedCreatePodSandBox 13m (x9 over 18m) kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to get sandbox image "registry.k8s.io/pause:3.8": failed to pull image "registry.k8s.io/pause:3.8": failed to pull and unpack image "registry.k8s.io/pause:3.8": failed to resolve reference "registry.k8s.io/pause:3.8": failed to do request: Head "https://us-west2-docker.pkg.dev/v2/k8s-artifacts-prod/images/pause/manifests/3.8": dial tcp 74.125.23.82:443: connect: connection refused
Warning FailedCreatePodSandBox 2m51s (x18 over 12m) kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to get sandbox image "registry.k8s.io/pause:3.8": failed to pull image "registry.k8s.io/pause:3.8": failed to pull and unpack image "registry.k8s.io/pause:3.8": failed to resolve reference "registry.k8s.io/pause:3.8": failed to do request: Head "https://us-west2-docker.pkg.dev/v2/k8s-artifacts-prod/images/pause/manifests/3.8": dial tcp 64.233.188.82:443: connect: connection refused
Warning FailedCreatePodSandBox 2m18s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to get sandbox image "registry.k8s.io/pause:3.8": failed to pull image "registry.k8s.io/pause:3.8": failed to pull and unpack image "registry.k8s.io/pause:3.8": failed to resolve reference "registry.k8s.io/pause:3.8": failed to do request: Head "https://us-west2-docker.pkg.dev/v2/k8s-artifacts-prod/images/pause/manifests/3.8": dial tcp 64.233.189.82:443: connect: connection refused
Due to the network policy, I pulled images from mirror website and tagged them. I have “registry.k8s.io/pause:3.8” and “registry.k8s.io/sig-storage/nfs-subdir-external-provisioner:v4.0.2” locally (both in master node and worker nodes).
$ sudo ctr images list | grep "registry.k8s.io"
registry.k8s.io/pause:3.8 application/vnd.docker.distribution.manifest.v2+json sha256:e0cc6dba04bee00badd8b13495d4411060b5563a9499fbc20e46316328efad30 301.3 KiB linux/amd64 -
registry.k8s.io/sig-storage/nfs-subdir-external-provisioner:v4.0.2 application/vnd.docker.distribution.manifest.v2+json sha256:f741e403b3ca161e784163de3ebde9190905fdbf7dfaa463620ab8f16c0f6423 17.1 MiB linux/amd64 -
swr.cn-north-4.myhuaweicloud.com/ddn-k8s/registry.k8s.io/pause:3.8 application/vnd.docker.distribution.manifest.v2+json sha256:e0cc6dba04bee00badd8b13495d4411060b5563a9499fbc20e46316328efad30 301.3 KiB linux/amd64 -
swr.cn-north-4.myhuaweicloud.com/ddn-k8s/registry.k8s.io/sig-storage/nfs-subdir-external-provisioner:v4.0.2 application/vnd.docker.distribution.manifest.v2+json sha256:f741e403b3ca161e784163de3ebde9190905fdbf7dfaa463620ab8f16c0f6423 17.1 MiB linux/amd64 -
So, why is the error “failed to pull image registry. k8s. io/pause: 3.8” still reported with “imagePullPolicy: Never”?
jimmylynkx is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.