Port 2379 is the etcd client API. In Kubernetes it stores the entire cluster state, including Secrets. Peer traffic between etcd members uses port 2380. It should not be reachable from the public internet.
- Port
- 2379
- Protocol
- TCP
- Service
- etcd (client API)
- Expose to internet?
- No
- Also used by
- Kubernetes control plane, Patroni, CoreDNS backends
Is port 2379 safe to open?
Reading etcd in a Kubernetes cluster reveals every Secret, service account token and configuration object, and writing to it can take over the cluster. If client certificate authentication is not enabled, anyone who can connect can read everything.
How to secure etcd (client API)
- Only the Kubernetes API server should reach 2379; block it from everything else.
- Require client certificates with
--client-cert-auth=trueand--trusted-ca-file. - Use TLS for peer traffic on 2380 (
--peer-client-cert-auth=true). - Enable encryption at rest for Kubernetes Secrets.
Check if port 2379 is open
Linux: what is listening on this port
sudo ss -tlpn | grep ':2379 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 2379 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 2379
# or
nmap -p 2379 HOST
# Windows
Test-NetConnection HOST -Port 2379Test the etcd (client API) service itself
etcdctl --endpoints=https://HOST:2379 endpoint healthRestrict port 2379 in the firewall
Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:2379:2379) instead of relying on the host firewall.
ufw: allow only your private network, deny everyone else
sudo ufw allow from 10.0.0.0/8 to any port 2379 proto tcp
sudo ufw deny 2379/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=2379/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="2379" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 2379 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 2379 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 2379 from internet" -Direction Inbound -Protocol TCP -LocalPort 2379 -RemoteAddress Internet -Action BlockMonitor port 2379
Run a TCP port monitor against your public IP on port 2379: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.
Related ports
| Port 6443 | Kubernetes API server | High risk |
| Port 10250 | Kubernetes kubelet API | Critical risk |
| Port 2181 | Apache ZooKeeper | High risk |
FAQ
What is port 2379 used for?
Port 2379 is the etcd client API. In Kubernetes it stores the entire cluster state, including Secrets. Peer traffic between etcd members uses port 2380. It is also used by Kubernetes control plane, Patroni, CoreDNS backends.
Is it safe to open port 2379?
Not to the public internet. Reading etcd in a Kubernetes cluster reveals every Secret, service account token and configuration object, and writing to it can take over the cluster. If client certificate authentication is not enabled, anyone who can connect can read everything.
Is port 2379 TCP or UDP?
etcd (client API) uses TCP on port 2379.
How do I check if port 2379 is open?
On the server, run sudo ss -tulpn | grep ':2379 ' (Linux) or Get-NetTCPConnection -LocalPort 2379 (Windows) to see what is listening. From another machine, run nc -zv HOST 2379 or Test-NetConnection HOST -Port 2379.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.