英文:
How to get node IP from kubernetes config?
问题
我尝试使用 status.hostIP,但它给我返回了"no value"。
spec:
containers:
- image: ...
env:
- name: 'hostIP'
valueFrom:
fieldRef:
fieldPath: status.hostIP
你能帮帮我吗,拜托?
我还尝试过 status.HostIP
。
英文:
I tried to use status.hostIP ,but it gives me "no value"
spec:
containers:
- image : ...
env:
- name: 'hostIP'
valueFrom:
fieldRef:
fieldPath: status.hostIP
Can you help me, please?
I also tried status.HostIP
答案1
得分: 1
你可以尝试在你的机器上运行以下命令:kubectl get pod
,并加上选项 -o wide
。
英文:
probably you should try:
kubectl get pod command on your machine, with the option -o wide
答案2
得分: 1
So the answer was to add hostNetwork: true
to pod spec.
英文:
So the answer was to add hostNetwork: true
to pod spec
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论