I have a local Kubernetes Running on Windows using Docker. In My Windows Host I am running a Process on Port 4000.
Inside my POD I am doing curl windows_host_ip:4000 But not able to get the response. Connection from POD is being established but the response is giving timeout. Logs
GET /ordermanagement/order/orders HTTP/1.1 User-Agent: curl/7.38.0 Host: 192.168.18.10:4000 Accept: /
Please let me know how can I allow incoming traffic to my POD from my Host System
This is the expected behavior. A pod is not supposed to have access to the host's network, process, filesystem, etc. directly otherwise anyone breaking into a pod can get the entire information of not only the host system but also about other pods running in the host.
You could look into creating a Kubernetes endpoint for the host process inside the cluster, please see this documentation here for manually managing services endpoints .
You can also potentially achieve this by running your pod as Privileged pod, however, it is not a good security practice to run privileged pods.
Privileged - determines if any container in a pod can enable privileged mode. By default, a container is not allowed to access any devices on the host, but a "privileged" container is given access to all devices on the host. This allows the container nearly all the same access as processes running on the host. This is useful for containers that want to use Linux capabilities like manipulating the network stack and accessing devices.
You can turn a pod into a privileged one by setting the privileged flag to true
(by default a container is not allowed to access any devices on the host).
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.