當我嘗試使用yaml文件創建POD時,我無法從本地docker註冊表中拉出圖像。這裏採取的診斷步驟進行:當試圖使用yaml文件創建POD時,無法從本地Docker註冊表中拉出圖像
kubectl describe pod <pod name>
錯誤消息:錯誤同時拉動圖像:獲取http://localhost:5001/v1/repositories/hello_world_application/images:撥打TCP [:: 1]:5001:用getsockopt:連接被拒絕
docker images
REPOSITORY標記圖像ID創建SIZE
img_app最新259dc6d7b6fe 19小時之前689.3 MB 本地主機:5001/img_app最新259dc6d7b6fe 19小時之前689.3 MB docker.io/python 2.7 ca388cdb5ac1 17天以前676.1 MB
netstat -anp | grep 5001
TCP6 0 0 ::: 5001 ::: * LISTEN 31971 /註冊表
這裏是我的Pod
配置(MY-pod.yaml):
apiVersion: v1
kind: Pod
metadata:
name: my-pod-1
labels:
name: my-pod-label
spec:
containers:
- name: my-application
image: localhost:5001/img_app:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5000
name: my-pod-label