简体   繁体   English

如何使用 Terraform 使用来自 Artifact Registry 的 Docker 映像部署 GKE 工作负载?

[英]How do I deploy a GKE Workload with my Docker image from the Artifact Registry using Terraform?

I have a kubernetes cluster that I have stood up with terraform in GCP.我有一个 kubernetes 集群,我已经在 GCP 中与 terraform 站在一起。 Now I want to deploy/run my Docker image to/on it, from the GCP console I would do this by going to the workloads section of the kubernetes engine portion of the console and then selecting Deploy a containerized application , I however want to do this with terraform, and am having difficulty determining how to do this and finding good reference examples for how to do it.现在我想从 GCP 控制台将我的 Docker 映像部署/运行到它/在其上运行我会通过转到控制台的kubernetes 引擎部分的工作负载部分然后选择Deploy a containerized application来做到这一点,但是我想做这与 terraform 一起,并且很难确定如何执行此操作并找到如何执行此操作的良好参考示例。 Any examples on how to do this would be appreciated.任何有关如何执行此操作的示例将不胜感激。

Thank you!谢谢!

You need to do 2 things:你需要做两件事:

  • For managing workloads on Kubernetes, you can use this Kubectl Terraform provider要管理 Kubernetes 上的工作负载,您可以使用这个Kubectl Terraform 提供程序
  • For custom images that preset in a 3rd party registry, you'll need to create a Kubernetes secret of type Docker and then use it in your manifests via imagePullSecrets attribute.对于在第 3 方注册表中预设的自定义图像,您需要创建 Docker 类型的Docker机密,然后通过imagePullSecrets属性在清单中使用它。 Check out this example .看看这个例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在使用“带有 Docker 的 Ubuntu”映像创建的 GKE 集群上部署 pod - Unable to deploy pods on GKE cluster created using 'Ubuntu with Docker' image 如何自动从 Artifact Registry 中删除图像 - How to remove an image from Artifact Registry automatically 如何在 gcp vm 中部署 docker 镜像 - how to deploy docker image in gcp vm GCP:如何修剪/维护工件注册表存储? - GCP: How to prune/maintain Artifact Registry storage? 如何在 Terraform 中创建 GCP 工作负载身份 IAM 绑定? - How to create the GCP workload identity IAM bindings in Terraform? 命令删除工件注册表的所有图像版本,除了最新的? - Command To Delete All Image Versions of Artifact Registry Except Latest? Google Artifact Registry 和 Jenkins:防止部署具有高或严重漏洞的容器 - Google Artifact Registry and Jenkins: prevent deploy containers with high or critical vulnerabilities 使用 terraform 使用现有的共享 vpc 网络创建 gke 集群 - Create gke cluster with existing shared vpc network using terraform 如何仅为特定文件夹部署我的 GAE 项目? - How do I deploy my GAE project for only a specific folder? 目前有什么方法可以使用 Artifact Registry 镜像官方 maven 存储库? - Is there currently any way to mirror an official maven repo using Artifact Registry?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM