Google cloud platform 在Google容器引擎中更改容器映像后,如何更新容器vm中的容器?
我在Google容器引擎上的容器vm上的容器中运行服务。我跟着 首先创建Google cloud platform 在Google容器引擎中更改容器映像后,如何更新容器vm中的容器?,google-cloud-platform,google-kubernetes-engine,google-container-registry,Google Cloud Platform,Google Kubernetes Engine,Google Container Registry,我在Google容器引擎上的容器vm上的容器中运行服务。我跟着 首先创建containers.yamlconf: version: v1beta2 containers: - name: example-image image: gcr.io/your_project_name/example-image 然后创建实例: gcloud compute instances create containervm-example \ --image container-vm \
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\u name/example image:new tag
如何更新正在运行的容器
我是否必须删除该实例并创建另一个具有相同名称但具有更新的conf文件(名称为新映像)的实例?我觉得这有点激进。如果我尝试从vm停止正在运行的容器,它会自动重新启动。如果可能的话,我不想在vm上执行任何手动操作,我只想在上面运行我的容器
在这里,我看到为了更新正在运行的容器,他使用了如下命令:
cloudcfg.sh-u 15s滚动更新数据控制器
但是我没有找到文档,它是用于在带有Kubernetes的集群中运行容器的。如果我正在运行一个容器虚拟机,建议如何在其中维护我的容器?容器仍然有kublet服务,但我找不到如何在其映像更改时使用它来更新容器。容器VM只是完整的Kubernetes/容器引擎基础结构的一部分。容器VM不支持完整的Kubernetes API,我在I/O演示中所做的kubecfg.sh示例使用完整的Kubernetes API 此处提供了有关使用完整容器引擎的更多信息: 下面是OSS Kubernetes项目的滚动更新示例: