Live data from Hacker News

A skeptic's first contact with Kubernetes

blog.davidv.dev

51–60 of 105 posts

Re: A skeptic's first contact with Kubernetes

#51

Solid write up, but small nitpick with the diagram at the start: It displays a pod containing multiple containers (this is fine and normal) but then highlights some of those containers to be different services. Unless you guys are running wildly different setups, or we’re talking about sidecar and init containers which is a whole rabbit hole unto itself, I put different services in different pods.

Also the same diagram shows nodes being lower in the hierarchy than namespaces. Namespaces and nodes are orthogonal.

Re: A skeptic's first contact with Kubernetes

#52
Kubernetes provides a relatively simple abstraction to represent a cluster of machines as a single entity. It's just about as simple as it can be IMO.

Its simplicity leverages the idea that each part of your software should be fully responsible for its own lifecycle and can handle and recover from all scenarios that can impact it.

For example, if your app service happens to launch before your database service, then it should be able to seamlessly handle this situation and keep trying to reconnect until the database service is started. This characteristic is generally desirable in any operating environment but it is critical for Kubernetes. Its orchestration model is declarative, so it doesn't make much fuss over launch order... Yet it works well and simply if each of your services have this failure tolerance and self-healing characteristic.

Re: A skeptic's first contact with Kubernetes

#53
post #43

> Why are we generating a structured language (YAML), with a computer, by manually adding spaces to make the syntax valid? Yep, it sucks. It's not like nobody has tried to do better, but nothing else has the adoption of Helm. Ultimately text is, as always, universal. If you want a fun fact: the communication between kubectl and the kube-api-server is actually in JSON, not YAML.

> If you want a fun fact: the communication between kubectl and the kube-api-server is actually in JSON, not YAML. YAML is a super set of JSON. All JSON is valid YAML. No one uses YAML over the wire as you cannot guarantee the conversion from YAML to JSON as YAML is a super set and make contain things like anchors, which the JSON parser cannot handle. That's why :)

Nobody tell the JSON::XS CPAN maintainer you said that: https://metacpan.org/pod/JSON::XS#JSON-and-YAML

Or John Millikin: https://john-millikin.com/json-is-not-a-yaml-subset

Re: A skeptic's first contact with Kubernetes

#54
post #15

My problem with K8s: the network abstraction layer just feels _wrong_. It's an attempt to replicate the old model of "hard exterior, gooey interior" model of corporate networks. I would very much prefer if K8s used public routable IPv6 for traffic delivery, and then simply provided an authenticated overlay on top of it.

I've felt similarly. Possibly because I was online pretty early, pre-NAT... there was public IPv4 everywhere.

Re: A skeptic's first contact with Kubernetes

#55

Earlier quoted context omitted.

> I've found solace in CUE We rebuilt our Kustomization layers to be built via cue, so that we could theoretically work with less mistakes. Oh my god, never again. Incredibly confusing and horrible errors. Writing new modules was painful and unclear, trying to compose them together was even worse. I still get flashbacks to that “Invalid bytes” error.

I think it's worth re-examining the widespread opposition to writing configs in an interpreted "real" programming language, rather than a string templating language (if you're looking to split hairs, in this taxonomy PHP and JSX are real languages, but they're close to the line. Python is prototypically a real language. Awk, Jinja, CUE, and Bash/ZSH string expansion are not. If the word "real" bothers you, pick anoth…

I don't object to the desired state being represented in YAML, I object to generating that YAML using something that's not a "real" programming language.

I don't particularly care if you generate your data structures from schemas, or generate your schemas from data structures, but I do care if you don't generate your output YAML using anything that's not type-safe.

If you're generating YAML to deploy, you can do that during build. If you're needing to combine configuration to generate new YAML at runtime, that's what controllers are for.

Re: A skeptic's first contact with Kubernetes

#57
post #46
post #7

His take on text interpolation is very right. I'm a SWE turned SRE because as a developer I really enjoyed using K8s. But as a full-time SRE where I work just means YAML juggling. It's mind numbing that everybody is okay with this, this really is our domain's assembly era, albeit with whitespace, colons, dashes and brackets. I've found solace in CUE which I just run locally to catch all the small errors everybody mak…

I don't think that the k8s yamls/jsons are bad. It's just bad that we write and edit them as text files My take on the k8s yaml mess is, that we are lacking a modern replacement for Helm. The yaml templating on text file level is just pure crazyness. I think we would need an approach that is more like React/JSX or even better TSX (typescript JSX). Some possibility to get away from simple templating and more into stru…

RCL has control flow and types: https://rcl-lang.org/. No record types yet though, so they are not yet very useful to validate e.g. a Kubernetes manifest against a schema.

Re: A skeptic's first contact with Kubernetes

#58
post #15

My problem with K8s: the network abstraction layer just feels _wrong_. It's an attempt to replicate the old model of "hard exterior, gooey interior" model of corporate networks. I would very much prefer if K8s used public routable IPv6 for traffic delivery, and then simply provided an authenticated overlay on top of it.

> My problem with K8s: the network abstraction layer just feels _wrong_. > I would very much prefer if K8s used public routable IPv6 for traffic delivery shudder... nothing could feel more wrong to me than public routable IPv6, yuck.

Why? It neatly separates concerns. Routing and reachability should be handled by the network. The upper layers should handle authorization and discovery.

Public IPs also definitely don't need to be accessible from the wide Internet. Border firewalls are still a thing.

Re: A skeptic's first contact with Kubernetes

#59
post #57
post #46

Earlier quoted context omitted.

I don't think that the k8s yamls/jsons are bad. It's just bad that we write and edit them as text files My take on the k8s yaml mess is, that we are lacking a modern replacement for Helm. The yaml templating on text file level is just pure crazyness. I think we would need an approach that is more like React/JSX or even better TSX (typescript JSX). Some possibility to get away from simple templating and more into stru…

RCL has control flow and types: https://rcl-lang.org/ . No record types yet though, so they are not yet very useful to validate e.g. a Kubernetes manifest against a schema.

Looks a lot like Jsonnet. This is going into the direction I'm talking about.

Is there also some typing-checking/code-completion available for Kubernetes resources? I think this would be an essential part to improve developer experience and automatic checks.

Some linter to validate the k8s manifests must be a part of a solution. It's possible to check the output, but a perfect solution would also lint the RCL source code and highlight the sections that generate invalid manifests.

Re: A skeptic's first contact with Kubernetes

#60
post #57
post #46

Earlier quoted context omitted.

I don't think that the k8s yamls/jsons are bad. It's just bad that we write and edit them as text files My take on the k8s yaml mess is, that we are lacking a modern replacement for Helm. The yaml templating on text file level is just pure crazyness. I think we would need an approach that is more like React/JSX or even better TSX (typescript JSX). Some possibility to get away from simple templating and more into stru…

RCL has control flow and types: https://rcl-lang.org/ . No record types yet though, so they are not yet very useful to validate e.g. a Kubernetes manifest against a schema.

I was just comparing different approaches and stumbled upon KCL. Might be worth a look:

https://www.kcl-lang.io/docs/user_docs/getting-started/intro

Post reply on HN