Describe the bug
I've clicked on the Install button for metrics to have Lens deploy Prometheus. It does seem to be working as I do get metrics data in Lens now, however the StatefulSet for Prometheus is in a constant state of alarm with the following error:
create Pod prometheus-0 in StatefulSet prometheus failed error: pods "prometheus-0" is forbidden: error looking up service account lens-metrics/prometheus: serviceaccount "prometheus" not found
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Prometheus to deploy without errors.
Environment (please complete the following information):
Kubeconfig:
Quite often the problems are caused by malformed kubeconfig which the application tries to load. Please share your kubeconfig, remember to remove any secret and sensitive information.
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: REDACTED
server: https://REDACTED.ondigitalocean.com
name: do-nyc3-pubserv
contexts:
- context:
cluster: do-nyc3-pubserv
user: do-nyc3-pubserv-admin
name: do-nyc3-pubserv
current-context: do-nyc3-pubserv
kind: Config
preferences: {}
users:
- name: do-nyc3-pubserv-admin
user:
token: REDACTED
I checked in on it this morning and the error has gone away?
hmm, makes me think that the StatefullSet might have gotten deployed before the related ServiceAccount. Essentially the deployment happens as kubectl apply -f bunch-of-yamls/ under the hood. This is quite common and as you saw, k8s eventually manages to get everything running. Although usually it should take only max few minutes as all the objects are created within seconds.
Please re-open... the ServiceAccount is there but still shows this error.
create Pod prometheus-0 in StatefulSet prometheus failed error: pods "prometheus-0" is forbidden: error looking up service account lens-metrics/prometheus: serviceaccount "prometheus" not found

had same issue, but waiting 2-5 minutes (during the time found this 馃槄) resolves the issue for me
Most helpful comment
Please re-open... the
ServiceAccountis there but still shows this error.