Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to restrict access to the nodes to only the External Load Balancer's IP? #10980

Closed
fabienvauchelles opened this issue Oct 3, 2024 · 0 comments

Comments

@fabienvauchelles
Copy link

Environmental Info:

  • K3s Version: v1.30.2+k3s1
  • Operating System (Servers + Load Balancer): Ubuntu 24.04 LTS

Cluster Configuration:

  • 2 servers in HA (no agent)
  • 1 external load balancer running HAProxy on Level 4 (TCP)
  • HAProxy forwards traffic on TCP ports 80 and 443 to the corresponding ports on the servers in a round-robin way
  • Each server runs K3s Traefik with lb-klipper for HTTP and HTTPS load balancing.
  • 2 dummy "hello world" pods deployed, one on each node.
  • Certificates are managed by Let's Encrypt.

Note: Servers are directly exposed to the internet without the option of using a private network or firewall rules

Describe the question:

How to restrict access to the nodes to only the External Load Balancer's IP?

Actual behavior:

Currently, ports 80, 443, NodePorts, and ETCD ports (2379, 2380) are open to the internet, and I wish to limit inbound traffic on the servers to just the load balancer's IP.

Expected behavior:

Only port 22 (SSH) and 6443 (API) are publicly opened.

Tests:

I've attempted:

  • NetworkPolicies: These only seem to apply to pods.
  • iptables PREROUTING chain: Found this difficult to manage and not compatible with K3S
  • UFW: Not effective as UFW uses its own chain system.

Thanks for your help

@k3s-io k3s-io locked and limited conversation to collaborators Oct 3, 2024
@brandond brandond converted this issue into discussion #10982 Oct 3, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
Status: Done Issue
Development

No branches or pull requests

1 participant