How to Securely Expose Ports in a Self-Hosted K3s Setup?

0
1
Asked By CoolGiraffe78 On

I'm looking to set up a self-hosted multi-node K3s cluster on a VPS that provides private networking, and each server has its own public IPv4 address. I'll be using Longhorn for storage and Traefik for ingress, but I want to keep it simple without adding Cilium or other complex options. The plan is to host web applications and expose a TCP port for Zabbix (10051) via an IngressRoute.

My main concern is which ports I can expose safely and which should remain on the private network. For handling the management network, I assume there will be a different VPS with a VPN. I've read about the need for port 6443, but I'm uncertain about other ports and their necessity. I know that ports 80 and 443 are generally safe, but I'm not clear about the rest of the ports Kubernetes uses.

5 Answers

Answered By WiseKangaroo45 On

I only expose ports 80 and 443 and manage everything through Traefik. It keeps things simple and secure.

Answered By JollyTurtle93 On

To minimize your attack surface, it's best to expose as few ports as possible. For any needed access, you can SSH into your server and forward the necessary ports instead of exposing them directly.

Answered By SkepticalSquirrel12 On

It seems like you might not have a grasp on the fundamentals of security. Ports are just arbitrary numbers; their safety relies on how well you control access.

Answered By CuriousPika74 On

Keep in mind, safety is relative; there's no such thing as 'safe' on the internet. Make sure to use a load balancer or a firewall to protect your public-facing services, and avoid exposing the Kubernetes API server to the outside world.

Answered By ChillRhino56 On

I suggest exposing ports 80 and 443 (with appropriate redirects) and if you're concerned about security, you can place port 6443 behind a bastion host.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.