Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

kubectl - Kubernetes: enable host network for all pods/services

Is it possible to enable host network between host and cluster for all installed pods (or services) by default without modifying yaml files? Modifying only kubelet or docker setup

On pod it's possible with flag

hostNetwork: true

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Okay I got your question . You basically want all port forwarding from host port to the pod port.

To do : 1.- Add these to your port config in manifest

name: portA

containerPort: 9100

hostPort: 9100

Add this to your deployment manifest . Now the pod will be accessible by directly using nodeIp:9100 which will enable the pod to run in the hostport 9100.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...