Hacker News new | ask | show | jobs
by globular-toast 16 days ago
Kubernetes will still work after a year too, it just won't be supported. I forgot about a K3s setup for well over a year...

If you don't need a cluster then a single node K3s is still better than Docker Compose. You might know how an ad hoc load balancer and Docker Compose works, but I wouldn't say this knowledge is any more given than knowing K8s these days.

But if you do need a cluster then maintaining a bunch of Talos nodes is easier than maintaining a bunch of full fat GNU/Linux boxen tbh.

1 comments

I've never looked at K3s so this is intriguing. I find docker compose great but it lacks some things that add to the complexity if bolting on, e.g. secrets management, or even load balancing on the single node to achieve zero downtime deployments. Would k3s handle the proxy layer?
IMO a lot of the "K8s is complex" is just the fact that you _can_ go complex with it, but you can really just declare pods and stuff and avoid the abstractions

I feel like k8s is better as soon as your thing goes from simple self-contained thing to multiple things running on one box

especially with agents it's never been easier to work with k8s.

from my experience, k3s supports basically everything k8s has that you'd need for a single-node setup

not sure what "Would k3s handle the proxy layer" means but if you mean the load-balancing part, then yes, that's like one of the main abstractions that k8s provides. but again, it provides many knobs so you probably just wanna pick the simplest option available

> means but if you mean the load-balancing part, then yes, that's like one of the main abstractions that k8s provides.

Yeah that's what I thought. Perhaps just put HAProxy in front and then let k3s know about it?

If you want to do L7 routing, aka virtual hosts, then K8s comes with support for that built in via the Ingress resource, or the new Gateway API. To realise it you need an ingress controller installed in your cluster. It's so common that K3s comes with one out of the box by default: Traefik. For a single node that's all you need.

For load balancing across a proper cluster then you can either provision an external load balancer (like keepalived) or you can look into something like MetalLB which runs entirely on-cluster (but you need BGP support for true load balancing).

In a cloud cluster (like AWS EKS) you get load balancers automatically just by provisioning a LoadBalancer type Service in Kubernetes.

you can do that, e.g. by using a pod exposed with a NodePort for it where it just uses the host IP/port you configure and forwards to pods (the internal network) using whatever config HAProxy needs

or use the Gateway/Ingress abstractions that basically do this automatically, where you just expose services via them, and they handle the routing

looks like the above is documented at: https://www.haproxy.com/documentation/kubernetes-ingress/

the nodeport way would basically be what you'd do with compose, where you map the host (node) ports to the container ones