[英]Unable to pull docker image from local registry for Kubernetes deployment
我在 Linode 上有一個 K8s 集群和另一個用於運行的 VM。
我已經在操作虛擬機上安裝了 Docker 和 K8s 來構建鏡像並在集群上進行部署。
注意:我還沒有在這個 VM 上安裝 minikube。
我能夠構建我的映像,但無法將其從本地注冊表拉到 k8s pod。
以下是我已經完成並試圖解決問題的事情。
我在 pod 描述中收到以下錯誤:
Warning ErrImageNeverPull 11s (x4 over 13s) kubelet Container image "localhost:5000/app-frontend" is not present with pull policy of Never
Warning Failed 11s (x4 over 13s) kubelet Error: ErrImageNeverPull
下面是我的部署 yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-frontend
labels:
app: app-frontend
spec:
replicas: 1
selector:
matchLabels:
app: app-frontend
template:
metadata:
labels:
app: app-frontend
spec:
containers:
- name: app-frontend
image: localhost:5000/docker-image
imagePullPolicy: Never
ports:
- containerPort: 80
imagePullSecrets:
- name: regcred
任何幫助或指導將不勝感激。
在文檔中我看到了這個
將 imagePullPolicy 設置為 Never 時,切勿拉取圖像。
試試這個
imagePullPolicy: IfNotPresent
還
image: localhost:5000/docker-image
但是在第 4 點中,您指定了一個 IP
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.