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

Docs feedback: Scrape jobs can't authenticate with K8s #827

Closed
vnugent opened this issue May 11, 2024 · 1 comment · Fixed by #829
Closed

Docs feedback: Scrape jobs can't authenticate with K8s #827

vnugent opened this issue May 11, 2024 · 1 comment · Fixed by #829
Labels
type/docs Docs Squad label across all Grafana Labs repos

Comments

@vnugent
Copy link

vnugent commented May 11, 2024

URL

https://grafana.com/docs/alloy/latest/tasks/configure/configure-kubernetes/

Feedback

I’m following the Kubernetes docs to deploy Alloy on a k8s cluster. The alloy pods are running ok but they can’t authenticate with k8s.

ts=2024-05-10T17:24:12.68722559Z level=debug msg="Scrape failed" 
component_path=/ component_id=prometheus.scrape.default scrape_pool=prometheus.scrape.default 
target=http://172.31.5.182:10250/metrics err="server returned HTTP status 400 Bad Request

This article helps a lot. It's not documented anywhere in the official docs.

discovery.relabel "metrics_kubelet" {
...
}

prometheus.scrape "kubelet" {
        scheme = "https"
        tls_config {
            server_name = "kubernetes"
            ca_file = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
            insecure_skip_verify = false
        }
        bearer_token_file = "/var/run/secrets/kubernetes.io/serviceaccount/token"
 ...       
}
@vnugent vnugent added the type/docs Docs Squad label across all Grafana Labs repos label May 11, 2024
@hainenber
Copy link
Contributor

I made a PR to add an prometheus.scrape example for K8s auth. Let me know if it's looks good to you :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants