简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM