News for hackers. Stuff that matters.
Re:Ask HN: If Kubernetes is the solution, why are there so m... by throwaway894345 on Wednesday June 01, 2022 @12:53PM (#31584658)
Why is applying a full manifest “declarative” but applying a patch is “imperative”? That’s clearly an error.
Re:Ask HN: If Kubernetes is the solution, why are there so m... by tbrownaw on Wednesday June 01, 2022 @02:30PM (#31586099)
Applying a full manifest is "this is your state now".

Applying a patch is "make these changes to your existing state".

That dependency on existing state is a difference, and it seems to map reasonably well to what declarative/imperative seem to usually be used to mean in this context.

Re:Ask HN: If Kubernetes is the solution, why are there so m... by throwaway894345 on Wednesday June 01, 2022 @02:38PM (#31586227)
1. A strategic merge patch says "this is your state now" (the only difference is the scope of the state in question, with a full manifest including a bunch of extraneous stuff)

2. "make these changes to your existing state" is still declarative

Re:Ask HN: If Kubernetes is the solution, why are there so m... by jen20 on Wednesday June 01, 2022 @04:55PM (#31587964)
> Applying a full manifest is "this is your state now".

It isn’t though. It’s “please make the state look like this eventually”. You do not patch state, just spec. Controllers effect the changes.

Re:Ask HN: If Kubernetes is the solution, why are there so m... by throwaway894345 on Thursday June 02, 2022 @01:12PM (#31597684)
You're both correct, but you're talking about different states. The parent's "state" is the state of the etcd database and your state is the actual state of the resources that the controllers are managing.

That said, the parent is wrong that a full manifest is declaring the (etcd) state in a way that a (strategic merge) patch isn't--both are declaring etcd state, but a strategic merge patch is doing so in finer-grained increments. A strategic merge patch can declare zero state or many full manifests, while applying full manifests can only work in increments of complete resource manifests. But both are telling Kubernetes "this is your (etcd) state now".

Re:Ask HN: If Kubernetes is the solution, why are there so m... by sgarland on Wednesday June 01, 2022 @01:45PM (#31585407)
Then open a PR.
Re:Ask HN: If Kubernetes is the solution, why are there so m... by throwaway894345 on Thursday June 02, 2022 @09:59AM (#31594972)
This is a strange way to concede an argument, but I’ll take it.