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

List of all secrets does not work in restricted cluster - SSL Exporter needs to scope secret listing to a single namespace where possible #159

Open
deviarchscs opened this issue Feb 16, 2024 · 0 comments · May be fixed by #179

Comments

@deviarchscs
Copy link

We are running the SSL Exporter in a restricted k8s cluster where we don't have access to all namespaces and all resources.
When we try monitoring a certificate in a k8s secret, the script first try to list every secrets in the cluster. This step is failing with a Forbidden message by the API server.
Listing is done by following line:

secrets, err := client.CoreV1().Secrets("").List(ctx, metav1.ListOptions{FieldSelector: "type=kubernetes.io/tls"})

A solution would be to list secrets ONLY in the particular namespace when it is possible (ie: when the namespace is complete and does not contain any wildcards/regex).

@ribbybibby ribbybibby linked a pull request Apr 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant