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

Unable to Retrieve List of Secrets from the kubernetes_secret Data Source #2135

Closed
hsalluri259 opened this issue Jun 7, 2023 · 3 comments
Closed
Labels

Comments

@hsalluri259
Copy link

hsalluri259 commented Jun 7, 2023

As per the documentation, this data source should give list of secrets associated with the service account, but it is still looking for default secrets not the custom ones because of the kubernetes 1.24 version change.

# data source to get SA account
data "kubernetes_service_account" "customer_namespace_sa" {
  metadata {
    name      = "deployment"
    namespace = var.namespace_name
  }
}

output "sa_secret_name" {
  value = data.kubernetes_service_account.customer_namespace_sa.secret.0.name
}
Error: Failed to discover the default service account token: Unable to find any service accounts tokens which could have been the default one


│ 


│   with module.helm_sco_onboard.data.kubernetes_service_account.customer_namespace_sa,


│   on namespace/main.tf line 81, in data "kubernetes_service_account" "customer_namespace_sa":


│   81: data "kubernetes_service_account" "customer_namespace_sa" {


│ 
@arybolovlev
Copy link
Contributor

Hi @hsalluri259,

Please update the issue description and provide all information that is requested by the template. In addition to that, please share the following commands output of the service account you are working with:

$ kubectl get sa ...
$ kubectl describe sa ...

Thank you.

@agiwalpooja20
Copy link

Facing same issue.

Copy link

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

@github-actions github-actions bot added the stale label Oct 27, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2024
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

3 participants