【发布时间】:2021-03-08 19:22:56
【问题描述】:
我正在尝试在 Minikube 上部署一个带有自定义插件和主题的 WordPress 实例。
首先,我创建了一个基于 Bitnami's Image 的自定义 WordPress Docker 映像。我已将其推送到 Docker Hub 并将存储库设为私有。
现在,我正在尝试使用 Bitnami 的 WordPress Helm Chart 部署映像。为此,我:
-
在与部署相同的命名空间中创建了一个秘密
regcred,如Kubernetes Docs 中所述。kubectl create secret docker-registry recred --docker-server=https://index.docker.io/v1 --docker-username=USERNAME --docker-password=PWORD --docker-email=EMAIL
-
将图表的
values-production.yaml(here) 更改为以下内容:
.
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
global:
imageRegistry: docker.io
imagePullSecrets:
- regcred
# storageClass: myStorageClass
## Bitnami WordPress image version
## ref: https://hub.docker.com/r/bitnami/wordpress/tags/
##
image:
registry: docker.io
repository: MYUSERNAME/PRIVATEIMAGE
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
pullSecrets:
- regcred
## Set to true if you would like to see extra information on logs
##
debug: true
...
我认为 pod 应该能够提取私有存储库,但它永远不能。状态卡在Waiting: ImagePullBackOff
我做错了吗?我正在关注this tutorial,顺便说一句。另外,我正在通过 WSL2(Ubuntu 发行版)在我的 Windows 10 上运行。
【问题讨论】:
-
您在创建映像后是否在 DockerHub 上发布了它。 Yop 必须在 DockerHub 拥有或创建一个帐户,并使用login 命令从终端登录:sudo docker login。成功登录后,您是否使用标记中的 DockerHub 用户名重建了 docker 映像并将其推送到 DockerHub ?你读过docs.bitnami.com/kubernetes/get-started-kubernetes 吗?
-
是的@Malgorzata,你说的我都做了。我想我已经解决了这个问题,正如我写的答案中所解释的那样。还是谢谢你!
标签: kubernetes bitnami dockerhub