只需在本地机器上研究K8S的核心(LinuxMint20.2)。
在本地创建了一个节点集群,其中:
k3d集群创建我的集群
现在,我想在容器中运行spring引导应用程序。
我建立当地形象:
库:0.1.0
这是来自Deployment.yml的片段
spec:
terminationGracePeriodSeconds: 40
containers:
- name: 'library'
image: library:0.1.0
imagePullPolicy: IfNotPresent尽管已经建立了这样的形象:
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
library 0.1.0 254c13416f46 About an hour ago 462MB启动容器失败:
pod/library-867dfb64db-vndtj Pulling image "library:0.1.0"
pod/library-867dfb64db-vndtj Failed to pull image "library:0.1.0": rpc error: code = Unknown desc = failed to pull and unpack image "library:0.1.0": failed to resolve reference "library:0.1.0": failed to do request: Head "https://...com/v2/library/manifests/0.1.0": x509: certificate signed by unknown authority
pod/library-867dfb64db-vndtj Error: ErrImagePull
pod/library-867dfb64db-vndtj Error: ImagePullBackOff
pod/library-867dfb64db-vndtj Back-off pulling image "library:0.1.0"如何解决k3d集群的本地图像可见性?
解决方案:
更新Deployment.yml
spec:
terminationGracePeriodSeconds: 40
containers:
- name: 'library-xp'
image: xpinjection/library:0.1.0
imagePullPolicy: Never并将图像导入到集群:
k3d映像导入xpinjection/库:0.1.0 -c my集群
发布于 2022-05-05 00:23:47
如果不想使用停靠器注册表,则必须将本地构建的映像导入k3d集群:
k3d image import [IMAGE | ARCHIVE [IMAGE | ARCHIVE...]] [flags]但是,不要忘记在部署中配置:
imagePullPolicy: Neverhttps://stackoverflow.com/questions/71998924
复制相似问题