Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem setting active targets of kubelet, prometheus server, alertmanager, kube-controller-manager and kube-scheduler #1895

Open
marcusnh opened this issue Oct 6, 2022 · 2 comments
Labels

Comments

@marcusnh
Copy link

marcusnh commented Oct 6, 2022

What happened?
Installed the kube-prometheus stack on my system, but seemed to have problem accessing the different endpoints in the system. Not quite sure what the reason is. The stack was installed completely similar as the manifest files given in the repositories.
MicrosoftTeams-image
As you can see from the image of the prometheus service discovery it can see the differnt targets, but some are not active.
Below is my services
image
And here are my pods running in the monitoring namespace:
image
I seem to be able to access the services from the prometheus pods, but can't scrape metrics. For instance when trying to connect to the prometheus-operated service or the prometheus-k8s service from the promtheus-k8s-0 pod i get a timeout error:
image
Notice that the prometheus-k8s service is of the type loadbalancer, and i had to add a new policy to make it work:

# Allow for external access to the service
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: prometheus-allow-external
  namespace: monitoring
spec:
  podSelector:
    matchLabels:
      app.kubernetes.io/component: prometheus
      app.kubernetes.io/instance: k8s
      app.kubernetes.io/name: prometheus
      app.kubernetes.io/part-of: kube-prometheus
  ingress:
  - ports:
    - port: 9090
@marcusnh
Copy link
Author

marcusnh commented Oct 10, 2022

Found one solution using the answer mentioned here, but still do not solve problems for service-monitors not looking at the control-plane.

@marcusnh
Copy link
Author

image
From the prometheus-operator pod i have an error message given by:
level=error ts=2022-10-10T11:33:24.13088649Z caller=klog.go:116 component=k8s_client_runtime func=ErrorDepth msg="status \"monitoring/k8s\" failed: failed to update status subresource: Operation cannot be fulfilled on prometheuses.monitoring.coreos.com \"k8s\": the object has been modified; please apply your changes to the latest version and try again"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant