【问题标题】:How do you update a container in a container-vm after its image changed in Google Container Engine?在容器虚拟机中的容器在谷歌容器引擎中更改后,如何更新容器?
【发布时间】:2015-03-26 16:33:25
【问题描述】:

我在 Google Container Engine 上的 container-vm 上的容器中运行服务。我关注了https://cloud.google.com/compute/docs/containers/container_vms#creating_containers_at_time_of_instance_creation 首先创建containers.yaml conf:

version: v1beta2
containers:
  - name: example-image
    image: gcr.io/your_project_name/example-image

然后创建实例:

gcloud compute instances create containervm-example \
    --image container-vm \
    --metadata-from-file google-container-manifest=containers.yaml \
    --zone us-central1-a \
    --machine-type f1-micro

如果我的图像更改为gcr.io/your_project_name/example-image:new-tag,我该如何更新正在运行的容器?

我是否必须删除该实例并创建另一个具有相同名称但更新的配置文件与我的新图像名称相同的文件?这对我来说似乎有点激进。如果我尝试从 vm 停止正在运行的容器,它会自动重新启动。如果可能的话,我不想在 vm 上做任何手动操作,我只想在它上面运行我的容器。

video 中,我看到他使用如下命令更新正在运行的容器:

cloudcfg.sh -u 15s rollingupdate dataController

但我没有找到文档,它是用于使用 Kubernetes 在集群中运行容器的。如果我正在运行一个容器虚拟机,那么在其中维护我的容器的建议方法是什么?容器仍然有 kublet 服务,但我找不到如何在容器的映像更改时使用它来更新容器。

【问题讨论】:

    标签: google-cloud-platform google-kubernetes-engine google-container-registry


    【解决方案1】:

    容器虚拟机只是完整的 Kubernetes/Container Engine 基础架构的一部分。 Container VM 不支持完整的 Kubernetes API,我在 I/O 演示中所做的 kubecfg.sh 示例使用了完整的 Kubernetes API。

    这里有更多关于使用完整容器引擎的信息: https://cloud.google.com/container-engine/

    还有一个来自 OSS Kubernetes 项目的滚动更新示例: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubectl.md#rollingupdate

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-10
      • 1970-01-01
      • 2015-09-21
      • 1970-01-01
      • 2015-01-13
      • 2017-05-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多