I'm sorry, as this is a primitive question, but I have a really hard time trying to understand how this repo works. I've got the main ideas, but some configs are still mysterious to me. For example, what is creating statefulsets for example for AlertManager?
I see the kind: Alertmanager, and I feel like prometheus-operator is creating statefulset for me. But is there any transparent explanation on how is it done?
And one more thing - why we can't just create stateful set with helm, why we use this stange loop with prometheus-operator creating it for us?
The Prometheus Operator does more than just create and update the statefulsets, for example it allows operations that are not possible with a statefulset usually, such as switching from an emptydir storage to a PVC backed one (and much much more).
I believe the type of documentation you are looking for is: https://github.com/coreos/prometheus-operator/blob/master/Documentation/design.md
Also I'm assuming you are using the kube-prometheus stack, of which the Prometheus Operator is just a part of, the prometheus-operator itself is just the Kubernetes controller that manages the objects in the way the above document describes.
@brancz TY very much for quick answer! Please also tell - is there any updated manual on using kube-prometheus? The previous one was packaging all charts and then install them. This solution made any helm updates of releases impossible, so I had to delete and install the whole stack over and over again.
Please provide any other install/update guide if you have one.
I highly recommend having a look at the jsonnet based stack, not the helm charts: https://github.com/coreos/prometheus-operator/tree/master/contrib/kube-prometheus
This allows you to have any flexibility that you need, and it just generates plain Kubernetes manifests that you can apply with kubectl as usual - no helm :slightly_smiling_face: .
The prometheus-operator maintainers don't maintain the helm charts, they are entirely and best effort community maintained, they usually lack behind quite a lot from the jsonnet based stack's abilities.
Most helpful comment
I highly recommend having a look at the jsonnet based stack, not the helm charts: https://github.com/coreos/prometheus-operator/tree/master/contrib/kube-prometheus
This allows you to have any flexibility that you need, and it just generates plain Kubernetes manifests that you can apply with kubectl as usual - no helm :slightly_smiling_face: .
The prometheus-operator maintainers don't maintain the helm charts, they are entirely and best effort community maintained, they usually lack behind quite a lot from the jsonnet based stack's abilities.