| > It appears there are over 20k lines of Go code after excluding vendor libraries and the example and contrib directories (arguably, contrib should've been included). close.. $ find -name '*.go'|grep -v ./vendor|xargs wc -l|sort -n|tail
507 ./test/e2e/alertmanager_test.go
540 ./pkg/client/monitoring/v1/types.go
562 ./pkg/alertmanager/operator.go
643 ./pkg/prometheus/statefulset.go
719 ./pkg/prometheus/promcfg.go
760 ./test/e2e/prometheus_test.go
835 ./pkg/client/monitoring/v1/zz_generated.deepcopy.go
1152 ./pkg/prometheus/operator.go
11410 ./pkg/client/monitoring/v1/openapi_generated.go
24526 total
Deleting the auto generate api files and ignoring test/ gives -------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
JSON 9 0 0 6276
Go 31 1020 1065 6028
which is quite a bit off from 20k.> I dunno, it just feels a little disingenuous, to me, to say that something that involves this much code is just a "packaging method" for a normal application. What is disingenuous is to call the prometheus operator, that deploys an entire monitoring stack a "normal application" The operator sets up monitoring on all the nodes, runs all the server components including configuring grafana and setting up dashboards. Meanwhile, $ cloc puppet-prometheus-5.0.0 puppet-grafana-4.2.0
192 text files.
157 unique files.
48 files ignored.
github.com/AlDanial/cloc v 1.76 T=1.09 s (131.9 files/s, 10534.0 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
Ruby 43 425 108 2477
Puppet 32 132 1747 2280
Markdown 6 494 0 1201
ERB 20 105 0 925
YAML 35 0 200 459
JSON 4 0 0 329
Bourne Shell 2 28 130 198
Bourne Again Shell 2 28 56 176
--------------------------------------------------------------------------------
SUM: 144 1212 2241 8045
--------------------------------------------------------------------------------
Which is that large and doesn't do ANY of the things that the prometheus operator does.> I believe this is the kind of thing people actually want. Highly efficient, thin "VMs" that are easy to manage and run as independent systems without requiring the resource commitment. Or, people want to use k8s so they can run entire clusters of machines as a single consistent system and take advantage of things like rolling deployments and self healing applications. |
True. I certainly admit that I don't know the code well enough to know exactly which lines or files are critical and which aren't, but I think it's getting into the weeds to nitpick the specifics too much (for example, I would argue that while it's probably good to exclude generated files, you shouldn't exclude the tests from the line count since they require real human time to maintain).
The point is that thousands of lines of unique, application-specific code are required to create an "operator" that runs Prometheus within k8s. This is not what most people think of when someone says "a method for packaging".
> What is disingenuous is to call the prometheus operator, that deploys an entire monitoring stack a "normal application"
While Prometheus is certainly a big system in its own right, I don't think that necessarily makes it a bad representative. Many people are planning to port their own complicated systems to Kubernetes.
> Or, people want to use k8s so they can run entire clusters of machines as a single consistent system and take advantage of things like rolling deployments and self healing applications.
It's hard to talk about this because there is so much wrapped up into the gob that is k8s, and of course not all of it is bad. But we've had "rolling deployments" and "self-healing applications" before, without having to write 10k+ lines of code to manage the platform deployment. These aren't a new thing to k8s.
k8s provides a platform that gives a nomenclature to them, but it's not always clear that there is a benefit to running on that platform v. running more traditional setups, especially when you consider that you still have to configure and code your (k8s-internal) load balancers, web servers, and applications to handle these things.
There's no free lunch. Kubernetes is a container orchestrator. It automates system-level commands like "docker run ..." and provides a (mostly redundant) fabric for those containers to feed into. That's great and there are some people who really need that, but far too many people read comments like yours and interpret it to mean "If I use Kubernetes I will have self-healing applications". It doesn't work that way.