gpt4 book ai didi

docker - 从私有(private) GKE 集群访问非 gcr 公共(public)容器注册表

转载 作者:行者123 更新时间:2023-12-02 21:06:28 26 4
gpt4 key购买 nike

我想在我的私有(private) GKE 集群中部署 nginx-ingress-controller 镜像 ( https://github.com/kubernetes/ingress-nginx ),但我无法拉取该镜像,因为它位于 quay.io 的注册表中。如何拉取不在 GCR 或 GCR Dockerhub 镜像上的公共(public)镜像?

我考虑过将其提取并上传到我自己的 GCR 注册中心,但后来我不得不继续更新它。有没有办法只保留该图像的私有(private)镜像?

最佳答案

私有(private) GKE 集群中的节点没有外部 IP,默认情况下无法导出到互联网,这就是集群无法从非 GCR 注册表中提取图像的原因。

要允许互联网导出,您需要启用 Cloud NAT在与您的 GKE 集群相同的项目中。

gcloud compute routers create nat-router \
--network custom-network1 \
--region us-central1

gcloud compute routers nats create nat-config \
--router-region us-central1 \
--router nat-router \
--nat-all-subnet-ip-ranges \
--auto-allocate-nat-external-ips

参见 https://cloud.google.com/nat/docs/gke-example#step_6_create_a_nat_configuration_using了解更多详情。

关于docker - 从私有(private) GKE 集群访问非 gcr 公共(public)容器注册表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57664657/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com