terraform-provider-kubernetes: v2.0.1: Resources cannot be created. Does kubectl refference to kube config properly?
Terraform version: v0.14.4
Kubernetes provider version: v2.0.1
Helm provider version: v1.3.2
Steps to Reproduce
I use a GitLab pipeline to deploy helm charts on my Kubernetes cluster by using the helm terraform provider.
provider "helm" {
kubernetes {
config_path = "~/.kube/config"
}
}
Since version v2.0.1 of the Kubernetes provider the Helm provider is not able to access to the kube config file properly. The error message looks like:
module.helm.helm_release.nginx-ingress-internal: Creating...
Error: configmaps is forbidden: User "system:serviceaccount:gitlab-prod:default" cannot create resource "configmaps" in API group "" in the namespace "nginx-ingress"
Error: namespaces is forbidden: User "system:serviceaccount:gitlab-prod:default" cannot create resource "namespaces" in API group "" at the cluster scope
Error: namespaces is forbidden: User "system:serviceaccount:gitlab-prod:default" cannot create resource "namespaces" in API group "" at the cluster scope
Error: namespaces is forbidden: User "system:serviceaccount:gitlab-prod:default" cannot create resource "namespaces" in API group "" at the cluster scope
Error: namespaces is forbidden: User "system:serviceaccount:gitlab-prod:default" cannot create resource "namespaces" in API group "" at the cluster scope
Error: namespaces is forbidden: User "system:serviceaccount:gitlab-prod:default" cannot create resource "namespaces" in API group "" at the cluster scope
The reason why I use Helm provider v1.3.2 is described in this bug report: https://github.com/hashicorp/terraform-provider-helm/issues/662
Temporary solution
Revert back to version v1.13.3
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 15 (7 by maintainers)
@jrhouston you said you didn’t change “anything about the way the kubeconfig gets loaded”. But the changelog says something different:
2.0.0 (January 21, 2021)
BREAKING CHANGES:
Remove default of ~/.kube/config for config_path (#1052)
Honestly I don’t understand that. ~/.kube/config is the standard! So why removing a standard that everyone is actually using?
@tantweiler In your example I see your
provider kubernetesblock is empty, but yourprovider helmblock has aconfig_pathset. You need to set it in both provider blocks as both providers need to know the path to the kubeconfig. Did you try that?