diff --git a/content/day1/03_operator-mistakes.md b/content/day1/03_operator-mistakes.md new file mode 100644 index 0000000..72ba35a --- /dev/null +++ b/content/day1/03_operator-mistakes.md @@ -0,0 +1,69 @@ +--- +title: Title +weight: 3 +tags: + - +--- + + + + +## Common mistake + +### Not using a simple client but directly talk to the api server + +- Problem: A +- Problem: Updates send in the whole object -> Noop updates waste apiserver resources +- Fix: Use a cache client +- Problem: Caching validation + +### Don't use custom caching + +- Problem: Good Luck dealing with concurrency +- Hard: Controllers mus maintain a per kind cache +- Problem: Eventual consistency makes everything more complicated +- Fix: Use a framework + +### Predecates only apply to the current + +- If you have a predecate in the for (predecate) only appy to this call, not to other watchers +- Also check if you shold be reconciling your low-level object or reconciling the higher level ones that ref to them is better + +## Tools + +### KRT + +> Still under development + +- Operatorions in collections (kubernetes objects with state tracking) +- Fetch function that handels transformation + +### StateDB + +- In-memory database for go with watch channels +- You can setup a table that stores all objects of a kind (provided by the client) +- Triggers hooks when changes happen in the database that you can react to + +### Controller-Runtime + +> The kubebuilder one + +- Includes a chached client +- Works on the reconciler pattern -> Makes triggers simpe + +## Tips + +- Limit the number of api server updates + - Check for dif yourself and don't send updates if there is nothing new + - Use patch instead of update just with changed fields -> Especially for `.status` +- Use a framework that handles watching, coalescing and caching (krt, statedb, controller-runtime) +- Use predecates if you're using controller-runtime, this helps you filter out no-op events by checking them against the cache and filters + +## Q&A + +- Do you know where your reconciliations are coming from: + - Counts: Yes the frameworks provide metrics and you can implement your own + - But controller runtime abstracts the patch source so you have to compare before and after state yourself - but you should not do that +- What about state sharing across multiple threads? + - Controller runtime handels each reconcile as idempotent, so you can just multithread + - But handling consistency can still be hard \ No newline at end of file diff --git a/content/day1/_index.md b/content/day1/_index.md index c504db2..47d79f7 100644 --- a/content/day1/_index.md +++ b/content/day1/_index.md @@ -7,6 +7,8 @@ weight: 5 Day 1 of the main KubeCon event startet with a bunch of keynotes from the cncf themselfes (anouncing the next locations for kubecon - amsterdam and barcelona). The also announced a new sovereign cloud edge initiative (CNCF/LF meets EU and soem german ministry) called "NeoNephos" with members like SAP, StackIt or T-Systems. +This is also the day the sponsor showcase opened - so expect more talking to people and meetings or demos and less straight up talks + ## Talk recommendations - Not that much about gpus with good control plane scaling advice: [Scaling GPU Clusters without melting down](../01_scaling-gpu) @@ -14,4 +16,6 @@ The also announced a new sovereign cloud edge initiative (CNCF/LF meets EU and s ## Other stuff I learned or people i talk to -- TODO: \ No newline at end of file +- The crossplane maintainers +- Anynines +- Cloudfoundry/Korifi \ No newline at end of file