kubernetes - 如何通过 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
解决方案
推荐阅读
- virtual-machine - windows server 2012可以安装在virtual box上吗?
- javascript - 我的代码在控制台中运行,但不在 Tampermonkey 中
- android - Google AdMob 广告未显示在 Unity 游戏中
- swift - 如何将日期放入导航标题?
- java - 当我使用 quarkus-resteasy-reactive-jackson 时,quarkus-resteasy-mutiny 扩展不存在警告
- python - 如何在 Locust 的多个类中使用多个主机
- php - 付款后终止会话并返回回调页面
- python - 为什么我的 BMI 代码显示错误的类别?例如,当我得到 BMI = 21.7 但它会打印 OVERWEIGHT 语句
- google-cloud-platform - 如何将文件和/或文件夹持久化到谷歌计算引擎永久磁盘中以在 GKE 中使用?
- reactjs - 如何在组件中执行更改而不在反应应用程序中设置状态?