Fork me on GitHub
#clojure-europe
<
2023-06-22
>
schmalz07:06:55

Morning all.

vijaykiran07:06:30

Morning!

šŸ¶ 8
šŸ˜ 8
ray07:06:20

Good morning

mccraigmccraig11:06:04

this mornings fun : K8S HPA stopped getting metrics from the metrics-server, and the metrics-server itself went skewy, because of some mysterious auth errors... prometheus/grafana suffered similarly... the upshot was that yapster's API didn't scale in response to the getting-to-work load increase, the CPUs in the API containers were pegged (but we couldn't see that, 'cos no grafana) and API requests were queued (aleph/manifold) and taking long enough that clients timed out - but everything looked just fine in the API logs and cassandra telemetry. took me far longer to figure it out than it should have done!

otfrom12:06:12

qui custodiet ipsos custodes

ā˜ļø 6
emilaasa13:06:45

https://erlang.org/documentation/doc-4.9.1/doc/design_principles/sup_princ.html

(try
    (re-implement-erlangs-supervision-tree orchestrator-n)
  (catch e ItWasTooHardException
     (resume/logf "Cloud orchestrator %s experience! 
                   Familiar with distributed systems, especially with
                   complexity regarding %s" 
                   orchestrator-n e ))

šŸ˜‚ 2
emilaasa13:06:22

Thatā€™s part of my CV algorithm, feel free to use it. šŸ˜„

lemontea13:06:29

SRE (Site Reliability Engineering) case study wow

lemontea13:06:16

cascading failure and unobservable bug something something

ray19:06:44

K8S itself: a case study in complexity

šŸ˜… 2
mccraigmccraig19:06:37

@U04V5V0V4 i do like the small set of verbs operating on an open collection of nouns thing though

ray19:06:07

I missed that poem :man-shrugging::skin-tone-2:

mccraigmccraig19:06:50

k8s operators let you use the same small set of verbs to manage new types of thing... we use them to uniformly manage kafka clusters, kafka topics, gnatsd clusters, elasticsearch clusters &c

ray21:06:48

Tbh I have been put off by the fact that helm charts exist ie a cottage industry in complexity management. But maybe itā€™s got simpler?

lemontea07:06:07

@U0524B4UW oh I thought you mean RESTful architecture (uniform verb is good for heterogenous integration across organisation boundary?)

lemontea07:06:48

though HATEOAS (and the larger theme of semantics web) seems to me to remain a pipedream even in 2023ā€¦

lemontea07:06:33

@U0524B4UW heard of operators (even played with some), but is there some place that clearly explain how itā€™s different from just a helm chart deployment? my impression after reading various doc is that the point you mentioned isnā€™t emphasised nearly enough

lemontea07:06:39

@U0525KG62 lol the IT tech books I read on monitoring with prometheus/grafana specifically has a section on thatā€¦ forgotten whatā€™s in there though :man-shrugging:

mccraigmccraig07:06:09

@U04V5V0V4 helm charts put me off too - i chose not to use any for our deploy because they added what felt like too much complexity in an already unfamiliar (to me) domain - but they do address an abstraction problem with K8S (also targeted by kustomize)

mccraigmccraig07:06:07

K8S is undoubtedly complex - but a lot of that complexity is a reflection of the underlying domain - AWS, GCP &c, and i suspect the abstraction capabilities will improve over time e.g. operators were introduced a few years after K8S became a thing, kustomize is only since 1.14

mccraigmccraig07:06:02

@U6L5FFL95 an operator can give you new k8s nouns, e.g. here is yaml for a kafka topic from our system (it's the strimzi operator that defines the new noun in this case): https://gist.github.com/mccraigmccraig/10ec06f56fe6e4a010b523dbaef1aab9 against which you can apply, get, describe, delete as with any other k8s resource... e.g. https://gist.githubusercontent.com/mccraigmccraig/4adbd5da9d59c756a859ea5bfe049a83/raw/27444eb2abe3d5e8c808a6c53928aefa0daa2fec/gistfile1.txt

mccraigmccraig07:06:40

want more partitions - change your topic yaml and apply - the strimzi operator converges your deployment with kafka specific operations

mccraigmccraig07:06:16

i chose kafka topics as an example because the yaml for them is embarrassingly simple - but the same idea applies to more complex things - here's our elasticsearch logging cluster definition : https://gist.github.com/mccraigmccraig/92168f36c8aead55ddae2a108d2c8f8c want more data nodes ? update the yaml ( https://gist.github.com/mccraigmccraig/92168f36c8aead55ddae2a108d2c8f8c#file-gistfile1-txt-L53 ) and apply

lemontea07:06:23

lemme think - seems like thereā€™s something here, but Iā€™m not sure how to put it into wordā€¦

lemontea07:06:52

ā€¦in the meantime, so is it that something like ā€œperform a database backupā€ is also an example of a target to being ā€œoperationalizedā€?

mccraigmccraig07:06:25

@U6L5FFL95 yes - here's a cassandra operator which does just that : https://docs.k8ssandra.io/tasks/backup-restore/

mccraigmccraig07:06:10

(i haven't used it - cassandra operators were too new when i set up our cluster)

mccraigmccraig07:06:04

k8s is almost certainly overkill for a straightforward API+DB project - but if you throw in a few extra components - kafka and websockets (e.g. gnatsd) and batch jobs and a desire to avoid coupling yourself to a particular cloud then it makes a lot of sense

lemontea07:06:12

oh nevermindā€¦ nothing a quick web search canā€™t solve: https://eskala.io/blog/what-are-the-differences-between-helm-and-operators/

lemontea08:06:09

(I also like the stackoverflow ans with the tagline: ā€œCRD + Controller = operatorā€ (ok, maybe a bit more complex than that - operator also ā€œencode and crystalize operational expertiseā€, whatever that means))

lemontea08:06:00

though Iā€™d also say that operator brings to mind the idea of a long-lived (at an org level) service

lemontea08:06:11

the kind that you dedicate staff to babysit

mccraigmccraig08:06:30

yeah that definition ( CRD + Controller = operator ) makes sense to me... and when you look at what resources an operator creates, it's usually just a deployment or statefulset for the controller, so turtles all the way down

mccraigmccraig08:06:57

@U6L5FFL95 the operator defines new resource types (CRDs) and the controller wraps complex ops processes on those CRDs into the k8s verbs

lemontea08:06:56

oh i seeā€¦ so youā€™re saying that the power of the CRD + controller combo increases once you begin to actually, err, ā€œProgramā€ in it

lemontea08:06:22

in a potentially recursive manner (not sure what the right word is here)

mccraigmccraig08:06:56

lol - not sure šŸ™‚ - for me the power is that all manner of complex ops processes can be handled in a simple and uniform manner

lemontea08:06:13

the idea is actually pretty nice - it is when you implement it on a platform as sprawling and byzantine as kubernetes that makes it (ohno!)

lemontea08:06:04

but then, the container orchestration war is already in history textbook, itā€™s too late if anyone donā€™t like k8s for whatever reasons

mccraigmccraig08:06:29

ha, in true https://www.juliadonaldson.co.uk/books/picture-books/a-squash-and-a-squeeze/ style you should try AWS CloudFormation for a bit and then go back to k8s šŸ™‚

2
lemontea08:06:10

(though the childrenā€™s book look good)

mccraigmccraig08:06:42

i would go as far as šŸ˜±

lemontea08:06:33

havenā€™t tried that. though my friends over there find that terraform state can get stuckā€¦

lemontea08:06:51

(not exactly terraformā€™s fault thoughā€¦ likely to be the specific cloud vendor providerā€™s)

lemontea08:06:08

itā€™s not fun I can tell

lemontea08:06:07

anyway, I think my main complain on operator is that their docs (for some of the most prominent ones) doesnā€™t do a good job of illustrating things with a self-contained, end-to-end example to highlight operatorā€™s advantages

mccraigmccraig08:06:22

yeah @U6L5FFL95 i won't even try and argue with that - my view on k8s was not acquired from the docs - iirc i came across the https://strimzi.io/ operator for kafka before i ever tried k8s, and seeing what it could do perked my interest

šŸ‘€ 2
mccraigmccraig08:06:13

although the current k8s explanation of operators is pretty good : https://kubernetes.io/docs/concepts/extend-kubernetes/operator/

šŸ‘ 2
lemontea08:06:43

yup, so maybe rant a bit more (and off track too) - crossplane, now thatā€™s the real šŸ˜±

lemontea08:06:02

I mean, as complexity of k8s approaches infinity, perhaps what ppl actually wants, in the limit, is their own self-hostable PaaS to get away from cloud vendor dependence

lemontea08:06:41

though it turns out that k8s itself is not a PaaS per se, but could be a substrate to build a PaaS on top of (the horrorā€¦)

lemontea08:06:08

I am at times puzzled by why it seems that in spite of all the advances over the year, something as ā€œbasicā€ as cloud/PaaS/IaaS etc remains essentially an unsolved problem once you go beyond the surface

lemontea08:06:58

ya thanks a lots @U0524B4UW - I came across this https://operatorframework.io/what/ a long time ago but donā€™t really know whatā€™s going on for the tiniest bitā€¦ with your explanation I seem to begin to ā€œget itā€ (by an epsilon :rolling_on_the_floor_laughing:)

mccraigmccraig08:06:17

@U6L5FFL95 my current company (sona - took over yapster) runs on k8s - they ported their app from azure to GCP in a day, with no (well, the story says "no", so perhaps "approximately no") changes - so it worked pretty well as a portable PaaS for them

lemontea08:06:55

though I have doubts on how often does someone need to build its own operator. Seems like the use case will be much broader if ā€œI have my bespoke custom fullstack application that I want to automate operations on in an end-to-end mannerā€ is a valid case for a custom operator

mccraigmccraig08:06:43

i think building an operator goes hand-in-hand with building an architectural component - it makes sense for e.g. datastax to build a cassandra operator, or confluence to build a kafka operator (or even AWS to build operators, since they are providing services at scale)... could also make sense for a company with a well-defined application to build their own operator for that application

mccraigmccraig08:06:30

but you don't need to rush in to building an operator ... you can go a long way with other operators and inbuild k8s nouns - i never considered building an operator for yapster, although now i'm thinking about it there are some ops tasks which require a bunch of kubectl commands in the right order, which is probably the smell indicating you should build an operator

lemontea08:06:45

ya thatā€™s exactly what Iā€™m worrying about - many ppl learn about things in a hands-on way, so if building an operator is culturally seem as ā€œsomething only big-name org doā€, it would makes it harder to reach for ordinary folks

lemontea08:06:20

even more so if there is a legitimate reason for that

lemontea09:06:33

maybe for something at this high a level of abstraction, itā€™s like what you said - on-ramping in an organic manner naturally is better

lemontea09:06:44

i.e. start with just using operators for well known components like DB and kafka (crucial to have clear doc), then gradually evolves towards having your own operator when the pattern emerges

borkdude15:06:17

::ugt/morning

šŸ’Æ 10
šŸ”‘ 6
šŸ˜„ 4
morning 2
simongray11:06:29

(:require [time.greeting :as tg])

(def ugt ::tg/universal)