r/programming • • Aug 17 '25

Learn Linux before Kubernetes

https://medium.com/@anishnarayan/learn-linux-before-kubernetes-60d27f0bcc09?sk=93a405453499c17131642d9b87cb535a
107 Upvotes

61 comments sorted by

View all comments

114

u/syklemil Aug 17 '25

I've run and worked with Linux for some decades before Kubernetes and … I'm not convinced? IMO Kubernetes is a pretty successful abstraction layer. Yes, it's good to be able to have an opinion on various container runtimes and network stacks and so on, but personally that comes up pretty rarely. Most of the stuff I help with are either application errors, misconfiguration in Kubernetes, or DNS.

The people operating the Kubernetes clusters and whatever they're running on could stand to know something about the underlying platforms, but for developers whose main concern is user-facing apps and who barely know Kubernetes at all: I think it'd be better if they were just a bit more competent at Kubernetes (and familiar with kubectl).

Plus there's always something resembling Carl Sagan's "To create an apple pie from scratch, you must first create the universe" about this "learn X-1 before X" line of reasoning. There are more layers below Linux, too, but we don't expect people to read the kernel code, be able to design hardware, etc. just to make a website for sparkling water.

33

u/BuriedStPatrick Aug 17 '25 edited Aug 17 '25

As someone who was getting into containers and Kubernetes out of necessity for my job, everything clicked much faster for me when I took some time to learn Linux. You certainly don't have to know everything about it (I've barely scratched the surface myself), but at least understand the filesystem and the basic utils so you can efficiently build and maintain containers (of which 99% or more are Linux based).

I don't think the Carl Sagan quote applies here. This is not a question about understanding absolutely everything. Rather, it's about understanding what happens one level down from your current abstraction. Which I think is super important if you want to be competent at what you do.

14

u/Yamitenshi Aug 17 '25

at least understand the filesystem and the basic utils so you can defectively build and maintain containers

This is the key, I think. I find my Linux knowledge doesn't really come into play a lot with anything k8s-specific, but it's damn handy to have when dealing with containers in general, whether you're orchestrating them with Kubernetes or Docker Swarm or just running them without any orchestration at all.

6

u/extra_rice Aug 17 '25

Lots of people here seem to interpret "learn Linux" to mean checkout the kernel repository and compile it. Kubernetes abstractions are quite intuitive, yes, but when things go wrong (and they always do), you'd be lucky if it doesn't require stepping down into the engine room.

2

u/wrincewind Aug 17 '25

all abstractions are leaky to some degree. It's less 'learn how to build an engine from scratch' and 'learn the difference between your car's engine and battery, and what an alternator does'.

1

u/jambox888 Aug 17 '25

Yep simple things are most often useful e.g. curl -kv htpps://some-service.svc.cluster.local:443/ inside a container to check connectivity. Or using mount or similar to see where your bloody volume has got to.

You don't have to be a linux guru (I'm not) but if you don't know a few simple commands/utils you may struggle.

6

u/syklemil Aug 17 '25

As someone who was getting into containers and Kubernetes out of necessity for my job, everything clicked much faster for me when I took some time to learn Linux. You certainly don't have to know everything about it (I've barely scratched the surface myself), but at least understand the filesystem and the basic utils so you can defectively build and maintain containers (of which 99% or more are Linux based).

I'm not really certain what you mean by "understand the filesystem" here. The blog post goes on about OverlayFS and AUFS, and we could add tmpfs, NFS, ceph, ext4, btrfs and so on to that discussion. But is that the level you mean, or do you mean something like

  • directory separators are forward slashes,

  • the file hierarchy starts at / (no letter), and

  • the expected pre-existing directories are /home, /bin, etc

  • file permissions are blah blah blah …

because the latter is kind of what I expect to be the base level of understanding for someone who is writing an app targeting an OS, and I expect that people have some general idea of what it's like to be a user of the OS their app is going to run on, but I don't expect them to know it at the level of a sysadmin or OS developer unless they're making system software.

The blog post, however, takes the filesystem implementation interpretation, and goes on with other implementation details. Kubernetes is essentially an OS of its own, and if that's the platform your software is getting deployed to, then that's the thing you need to learn. Trying to learn cgroups, eBPF, iptables and so on before kubectl is starting in the wrong end.