Skip to content

Instantly share code, notes, and snippets.

@kkbruce
Created August 11, 2023 09:30
Show Gist options
  • Save kkbruce/ada5a05c5776ab4bddeba3282c724d98 to your computer and use it in GitHub Desktop.
Save kkbruce/ada5a05c5776ab4bddeba3282c724d98 to your computer and use it in GitHub Desktop.
Set Windows Firewall for Windows Node for Kubernetes
# Reference: https://kubernetes.io/docs/reference/networking/ports-and-protocols/
# Control plane Firewall rules
New-NetFirewallRule -DisplayName "Kubernetes API server" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 6443
New-NetFirewallRule -DisplayName "etcd server client API" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 2379-2380
New-NetFirewallRule -DisplayName "Kubelet API" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 10250
New-NetFirewallRule -DisplayName "kube-scheduler" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 10259
New-NetFirewallRule -DisplayName "kube-controller-manager" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 10257
# Worker node Firewall rules
New-NetFirewallRule -DisplayName "Kubelet API" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 10250
New-NetFirewallRule -DisplayName "NodePort Services" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 30000-32767
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment