首页 > 解决方案 > 如何通过 kubernetes 运行领事?

问题描述

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

它失败了......状态为未就绪的容器:[consul]

kubectl create -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

标签: kubernetesdevopsconsul

解决方案


推荐阅读