OLA
OLA

Reputation: 59

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

Upvotes: 1

Views: 5012

Answers (1)

Sunjay Jeffrish
Sunjay Jeffrish

Reputation: 342

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.

Upvotes: 1

Related Questions