# Kubernetes NetworkPolicy

**URL:** <https://discuss.kubernetes.io/t/kubernetes-networkpolicy/24496>\
**Category:** General Discussions\
**Tags:** network\
**Created:** [June 13, 2023, 2:10am UTC](https://discuss.kubernetes.io/t/kubernetes-networkpolicy/24496 "2023-06-13T02:10:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leng\_Kimhong](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/leng_kimhong/32/12379_2.png) [@Leng\_Kimhong](https://discuss.kubernetes.io/u/Leng_Kimhong)\
**Post date:** [June 13, 2023, 2:10am UTC](https://discuss.kubernetes.io/t/kubernetes-networkpolicy/24496/1 "2023-06-13T02:10:20Z")

</div>

Asking for help? Comment out what you need so we can get more information to help you!

Hello All

I have used ingress for allow specific namespace for inbound. However, after I set the ingress. I couldn’t access from external server. How could I allow the specific namespace without blocking the external access?

Thanks

### Cluster information:

Kubernetes version:  
Cloud being used: (put bare-metal if not on a public cloud)  
Installation method:  
Host OS: Red Hat Enterprise Linux release 8.7 (Ootpa)  
CNI and version: 0.3.1  
CRI and version: 0.1.0

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

---

<div class="post-metadata">

**Author:** ![thefron](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thefron/32/13579_2.png) [@thefron](https://discuss.kubernetes.io/u/thefron)\
**Post date:** [November 2, 2023, 5:52am UTC](https://discuss.kubernetes.io/t/kubernetes-networkpolicy/24496/2 "2023-11-02T05:52:39Z")

</div>

In which case do you need allow external access? If you route external traffic via ingress controller, then can you just add ingress controller to the allowed namespace list?

---

<div class="post-metadata">

**Author:** ![Leng\_Kimhong](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/leng_kimhong/32/12379_2.png) [@Leng\_Kimhong](https://discuss.kubernetes.io/u/Leng_Kimhong)\
**Post date:** [July 10, 2025, 7:51am UTC](https://discuss.kubernetes.io/t/kubernetes-networkpolicy/24496/3 "2025-07-10T07:51:14Z")

</div>

I want to prevent other servers to access the nodeport. I think ingress can be set only the container port not the Nodeport that we exposed. Could you help? If we can allow or drop it with firewall rule?  
Thanks,
