0
votes

Request

Please explain how 2 StatefulSets are createad automatically when deploying prometheus-operator Helm chart. It'd be awesome if you could point me to the piece of the chart that pulls those 2 statefulsets.

Reproduce

$ helm repo add stable https://kubernetes-charts.storage.googleapis.com

$ helm install prom-op stable/prometheus-operator

$ kubectl get pods
NAME                                                   READY   STATUS    RESTARTS   AGE
alertmanager-prom-op-prometheus-operator-alertmanager-0   2/2     Running   0          49m
prom-op-grafana-78c44f8bc8-nvf45                          2/2     Running   0          49m
prom-op-kube-state-metrics-db84fc9d-smsk6                 1/1     Running   0          49m
prom-op-prometheus-node-exporter-87t5g                    1/1     Running   0          49m
prom-op-prometheus-operator-operator-8554b8f87-6hv9d      2/2     Running   0          49m
prometheus-prom-op-prometheus-operator-prometheus-0       3/3     Running   1          49m

$ kubectl get sts
NAME                                                 READY   AGE
alertmanager-prom-op-prometheus-operator-alertmanager   1/1     51m
prometheus-prom-op-prometheus-operator-prometheus       1/1     51m

As you can see 2 statefulsets are created, but I can't seem to understand how they get created.

Context

There is a custom tailored prometheus-operator on my hands that does not pull 2 statefulsets for some reason. So far my analysis did not yield any clear understanding. All I end up with is grafana, kube-state-metrics, node-exporter and operator, and no statefulsets.

Reference

prometheus-operator Helm chart source

1
It's look like the prometheus-operator code create the sts objects.Shmuel
@Shmuel can you point me to the the piece of the code that in your opinion is responsoble for the creation of the statefulsets? I'd appreciate that very much.sgulomov

1 Answers

2
votes

figured out that the CRD was responsible for creating those 2 statefulsets; turned out that the tailored prometheus-operator lacked service accounts for alertmanager, prometheus and prometheus-operator and RBAC to work properly. I just copied those from the stable chart.