0

I'm using the microk8s addon prometheus and I want to define new jobs in order to monitoring specific pods.

I can access to the console of the pod prometheus-k8s-0 but I can't write in any of the prometheus configuration files due to I haven't got permissions.

Also, I can't do sudo or su in order to change the file permissions because it is not defined. I've tried to change the configuration of the pod with the command microk8s kubectl edit prometheus-k8s-0 but when I go to save the changes the following message appears: A copy of your changes has been stored to "/tmp/kubectl-edit-3711475650.yaml" Unable to connect to the server: net/http: request canceled (Client.Timeout exceeded while awaiting headers) So, what can I do?

Thank you in advance.

1 Answers1

0

IIUC you should review the PodMonitor and pehaps ServiceMonitor Custom Resources that are created by the Prometheus Operator.

Instead of tweaking Prometheus YAML configs, you define PodMonitor and ServiceMonitor Resources in your Namespaces. The Prometheus Operator detects these and reconfigures Prometheus dynamically.

If the Prometheus Operator docs are unclear, try Googling PodMonitor as there are several blog posts (I've not read any of these) that may help.

DazWilkin
  • 32,823
  • 5
  • 47
  • 88