-
Notifications
You must be signed in to change notification settings - Fork 988
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
.kubeconfig file current context used for auth instead of static values #1037
Comments
@allymparker can you tell us a bit more about your environment so we can try to reproduce this? Are Cluster A and Cluster B both on AKS? |
Check to see if any kubernetes-related environment variables are set in your shell. Variables like I also noticed that your secret block in your example does not specify a provider alias. It might be best to be more explicit, so you can be sure which cluster the resource will land on. I'll give you an example I used for testing:
|
Yes but....
Yep, that sorts it 🤦 (Well |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Terraform Version and Provider Version
Windows
Terraform v0.13.4
Affected Resource(s)
kubernetes_secrets - potentially all kubernetes resources
Terraform Configuration Files
Expected Behavior
The statically defined credentials passed to the k8s provider should be used instead of the current context found inside .kubeconfig
As per the docs:
Actual Behavior
The current credentials/context from my .kubeconfig file are used.
Steps to Reproduce
Given 2 clusters
cluster-a
andcluster-b
Use a kubernetes provider with statically provided creds to
cluster-a
Create a kubernetes_secret resource
secret
that doesn't exist on eithercluster-a
orcluster-b
Set your current context to
cluster-b
:kubectl config set-context cluster-b
Run
terraform apply
The secret will have been created on
cluster-b
instead ofcluster-a
Community Note
The text was updated successfully, but these errors were encountered: