如何通过kubernetes运行领事?

时间:2019-06-15 13:20:03

标签: kubernetes devops consul

我尝试运行pod(https://www.consul.io/docs/platform/k8s/run.html

失败的原因是...容器的状态未就绪:[领事]

kubectl创建-f consul-pod.yml

apiVersion: v1
kind: Pod
metadata:
  name: consul-example
spec:
  containers:
    - name: example
      image: "consul:latest"
      env:
        - name: HOST_IP
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
      command:
        - "/bin/sh"
        - "-ec"
        - |
            export CONSUL_HTTP_ADDR="${HOST_IP}:8500"
            consul kv put hello world
  restartPolicy: Never

0 个答案:

没有答案