OpenShift运行同一个容器中两次当它应该运行的吊舱内两个不同的人(OpenShift runs

2019-11-05 07:30发布

我想OpenShift 3.10创建一个吊舱( console包括两个容器() apiconsole )。 在应用程序模板中的相关描述(下dc.spec.template.spec.containers为) DeploymentConfig console看起来是这样的:

containers:
- image: console:api
  imagePullPolicy: Always
  name: api
  terminationMessagePolicy: File
- image: console:console
  imagePullPolicy: Always
  name: console
  ports:
  - containerPort: 80
    protocol: TCP
  terminationMessagePolicy: File

oc describe is/console看起来不错,我并报告如下(在BuildConfig S为输出到两个容器ImageStreamTag小号console:apiconsole:console分别对应)。

api
  no spec tag
  * docker-registry.default.svc:5000/registry/console@sha256:96...66
console
  no spec tag
  * docker-registry.default.svc:5000/registry/console@sha256:8a...02

但是oc describe pods --selector deploymentconfig=console显示,相同的图像已经被拉两次,因此在同一个容器荚内运行两次:

Successfully pulled image "docker-registry.default.svc:5000/registry/console@sha256:8a...02"
Successfully pulled image "docker-registry.default.svc:5000/registry/console@sha256:8a...02"

我怎样才能确保荚确实包括两个不同的容器? 为什么是图像流标签 console:api显然有时不是指像96...668a...02 ,相反的是os describe is/console提示?

更新失配也是显而易见oc describe dc/console ,这表明这两个图像流标签console:apiconsole:console显然已经解决到同一容器中的图像8a...02

Containers:
 api:
  Image: docker-registry.default.svc:5000/registry/console@sha256:8a...02
 console:
  Image: docker-registry.default.svc:5000/registry/console@sha256:8a...02

Answer 1:

以下变化dc.spec.triggers似乎已经解决的情况:

- type: ConfigChange
- imageChangeParams:
    automatic: true
    containerNames:
    - api
    from:
      kind: ImageStreamTag
      name: console:api
      namespace: registry
  type: ImageChange
- imageChangeParams:
    automatic: true
    containerNames:
    - console
    from:
      kind: ImageStreamTag
      name: console:console
      namespace: registry
  type: ImageChange

此前,只有单个imageChangeParamsconsole:console 。 该吊舱现在包括两个不同的容器中。



文章来源: OpenShift runs same container twice when it should run two different ones inside pod
标签: openshift