为什么我的吊舱的状态没有条件是准备门?

时间:2019-04-28 08:59:17

标签: kubernetes

我在kubernetes-1.12.6上使用Pod Readiness Gate,就像这样 https://v1-12.docs.kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-readiness-gate

但是它不能像文档一样工作

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    run: tomcat
  name: tomcat
  namespace: default
spec:
  selector:
    matchLabels:
      run: tomcat
  template:
    metadata:
      labels:
        run: tomcat
    spec:
      containers:
      - image: tomcat
        name: tomcat
      readinessGates:
      - conditionType: www.example.com/feature-1
      restartPolicy: Always

我想要一个像这样的豆荚

Kind: Pod
...
spec:
  readinessGates:
    - conditionType: "www.example.com/feature-1"
status:
  conditions:
    - type: Ready  # this is a builtin PodCondition
      status: "True"
      lastProbeTime: null
      lastTransitionTime: 2018-01-01T00:00:00Z
    - type: "www.example.com/feature-1"   # an extra PodCondition
      status: "False"
      lastProbeTime: null
      lastTransitionTime: 2018-01-01T00:00:00Z
  containerStatuses:
    - containerID: docker://abcd...
      ready: true
...

但是我的豆荚的状态是这个

status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2019-04-27T14:59:00Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2019-04-27T14:59:00Z"
    message: corresponding condition of pod readiness gate "www.example.com/feature-1"
      does not exist.
    reason: ReadinessGatesNotReady
    status: "False"
    type: Ready

为什么?

1 个答案:

答案 0 :(得分:1)

根据readinessGates description,似乎pod外部的某些逻辑必须更新此状态字段。用户可以实现这种逻辑。

  

创建广告连播后,每个功能都负责保持其自定义   只要其ReadinessGate存在于   PodSpec。这可以通过运行k8s控制器进行同步来实现   有关豆荚的条件。