0

我创建了一个NestJs应用程序,使用 将其打包到 bin 文件中pkg,使用 docker 映像将其容器化并命名为projectABC。所有这些都部署在 Ubuntu20 中,并且 bin 文件运行良好。

接下来,我想尝试港口存储库。按照教程,我使用这个tut创建了带有自签名证书的本地港口存储库。我正在使用minikube在我的机器上部署港口。

Harbor启动后,我创建了一个名为“project”的项目,然后将projectABC图像推入其中,并将其Project registry设置为Public. 从docker login, docker tag, 到一切​​都很好docker push。测试新推送的图像,我可以按预期docker pull检查运行。projectABC

所以现在我想使用helm chart 进行部署。到目前为止,我已成功登录注册表并推送了一个空图表项目。

helm create projectABC
export HELM_EXPERIMENTAL_OCI=1
helm chart save ./projectABC 192.168.1.69/project/ABC
helm registry login https://192.168.1.69 --insecure
helm chart push 192.168.1.69/project/ABC:0.0.1

然后我修改values.yaml以从港口回购中提取图像

image:
  repository: 192.168.1.69/project/ABC:0.0.1
  pullPolicy: Always

但它失败了结果: container in pod is waiting to start: trying and failing to pull image

所以我的问题:

  1. 我如何将我的本地港口注册为 helm 中的 repo?
  2. 我的本地港口是否被视为私人或公共回购?
  3. 我应该怎么做才能让我的图表从本地港口回购中提取图像?
4

1 回答 1

0

Tried to create secret and follow this discussion, but failed. until:

I used kubectl describe to check what is going on with my pod. Turns out it failed to pull image due to certificate is signed by unknown authority.

Found this discussion in reddit, that showing minikube need to have a copy of the certificate inside its own directory. After providing the cert and restarting minikube, it works correctly.

source

# create the dir if it is not exist
mkdir -p ~/.minikube/files/etc/ssl/certs

# copy the cert
cp ~/your.crt ~/.minikube/files/etc/ssl/certs/your-crt.pem
于 2021-01-20T11:30:03.087 回答