728x90
Kubectl run 시 image tag 지정
kubectl run nginx --image=nginx:latest
k8s의 container manager를 crio로 설정하고 위 명령어를 실행시키면
[user@ubuntu01 ~ (kubernetes-admin@cluster.local:default)]$ k describe pod nginx
Name: nginx
Namespace: default
Priority: 0
Node: ubuntu01/172.16.132.130
Start Time: Thu, 29 Dec 2022 00:41:33 +0900
Labels: run=nginx
Annotations: cni.projectcalico.org/containerID: 1f8d14e6af5bf403c348372908b98d3b694094de85321da9c370d809f1219180
cni.projectcalico.org/podIP: 10.233.67.207/32
cni.projectcalico.org/podIPs: 10.233.67.207/32
Status: Pending
IP: 10.233.67.207
IPs:
IP: 10.233.67.207
Containers:
nginx:
Container ID:
Image: nginx
Image ID:
Port: <none>
Host Port: <none>
State: Waiting
Reason: ImageInspectError
Ready: False
Restart Count: 0
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-6ncfh (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
kube-api-access-6ncfh:
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 19s default-scheduler Successfully assigned default/nginx to ubuntu01
Warning InspectFailed 5s (x4 over 19s) kubelet Failed to inspect image "nginx": rpc error: code = Unknown desc = short-name "nginx:latest" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf.d/01-unqualified.conf"
Warning Failed 5s (x4 over 19s) kubelet Error: ImageInspectError
위와 같이 Waiting 상태로 파드가 실행되지 않는다.
해결 방법
kubectl run nginx --image=docker.io/nginx:latest
이유는 태그의 모호성 제거 때문이라네요.
'DevOps > k8s' 카테고리의 다른 글
k8s의 보안 (0) | 2023.08.13 |
---|---|
k8s SealedSecret 사용법 (0) | 2023.06.23 |
느슨한 결합을 위한 ExternalName 서비스 (0) | 2023.06.21 |
K8S server-side apply & managed fields (0) | 2023.06.18 |
helm install bitnami nginx m1 오류 (0) | 2023.06.10 |