We are working on several kubernetes EKS clusters with a kubectl configuration with several contexts
they are named cluster-A and cluster-B
We have a deployment (a namespace for the example) on the 2 clusters.
The deployment on booth cluster has been done via terraform with the provider kubectl
sample code :
No worries, that's the point :)
Switch kubectl config and check
kubectl config use-context cluster-A
Switched to context cluster-A
kubectl get namespace | grep dada1a24
dada1a24 Active 62m
Strange, after applying the terraform, the namespace is still present on the cluster-A
check on cluster-B
kubectl config use-context cluster-B
Switched to context cluster-B
kubectl get namespace | grep dada1a24
==> nothing
kubectl get namespace | grep dada1a24 | wc -l
0
namespace has been deleted from cluster-B not cluster-A.
I think it's related to the fact that the default value of the load_config_file property is true. So when deleting the provider the local configuration is loaded and so can lead to unexpected behavior .
Wouldn't it be safer to change the default value to avoid this kind of behavior?
We are working on several kubernetes EKS clusters with a kubectl configuration with several contexts
they are named cluster-A and cluster-B
We have a deployment (a namespace for the example) on the 2 clusters. The deployment on booth cluster has been done via terraform with the provider kubectl sample code :
For a test, we remove the provider kubectl and the resource kubectl_manifest to apply it on the cluster-A.
My local kubectl configuration is on cluster-B
I launch my terraform apply
No worries, that's the point :) Switch kubectl config and check
Strange, after applying the terraform, the namespace is still present on the cluster-A
check on cluster-B
namespace has been deleted from cluster-B not cluster-A.
I think it's related to the fact that the default value of the load_config_file property is true. So when deleting the provider the local configuration is loaded and so can lead to unexpected behavior .
Wouldn't it be safer to change the default value to avoid this kind of behavior?