terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
Unable to Retrieve List of Secrets from the kubernetes_secret Data Source
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" {
│
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.
Facing same issue.