Skip to content

Instantly share code, notes, and snippets.

@tlipinski
Created October 10, 2019 20:43
Show Gist options
  • Save tlipinski/3630692a8026a258fb9004e65604cfae to your computer and use it in GitHub Desktop.
Save tlipinski/3630692a8026a258fb9004e65604cfae to your computer and use it in GitHub Desktop.
Restricting access to NodePort service in Kubernetes
*nat
:PREROUTING ACCEPT [1:40]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:KUBE-SERVICES - [0:0]
-A PREROUTING -s 1.2.3.0/24 -j KUBE-SERVICES
-A PREROUTING -s 4.5.6.0/24 -j KUBE-SERVICES
-A PREROUTING -j RETURN
-A PREROUTING -m comment --comment "kubernetes service portals" -j KUBE-SERVICES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment