-
Notifications
You must be signed in to change notification settings - Fork 48
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
Is there a reason to not use the "kubernetes" tfstate backend? #3
Comments
I believe that the kubernetes backend is only available with Terraform >= 0.13.0. This project supports >= 0.11.9 (or something like that) so it would make the default backend incompatible with earlier versions. There is a # rbac role rules for the tf-runner pod
rules:
- apiGroups:
- ""
resources:
- configmaps
- secrets # needs to be added
verbs:
- '*'
# and leases needs to be added
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- '*' limitationsI could see some limitations in the kubernetes backend since it requires Secrets permissions to access tfstate. Hypothetically, If state data needs to be read from another namespace for a certain module, there would be an issue getting access to it. solution?I think I might make some changes to read for
|
Hello @isaaguilar and kudos for this nice project!
This is an information I failed to find. I must be missing something here since it is possible to specify the Terraform version in the CRD (https://github.com/isaaguilar/terraform-operator/blob/master/deploy/crds/tf.isaaguilar.com_terraforms_crd.yaml#L333). Edit: ok, just found out you are building tf runners by iterating on available HashiCorp's Terraform image tags (https://github.com/isaaguilar/terraform-operator/blob/master/docker/terraform/build.sh#L11) |
@asaintsever FWIW we're migrating our BDD terraform testing on the Jenkins X project over to using this most excellent operator - totally loving it so far. We're currently using the kubernetes back end - as it was the simplest thing to do to start with. The only thing to be careful of is make sure the backend namespace is the same as the namespace you are creating the e.g. here's our templated Terraform we're using: https://github.com/jstrachan/jxr-versions/blob/tf-operator/.lighthouse/jenkins-x/bdd/terraform.yaml#L37-L44 Though the main downside is k8s clusters ideally would be cattle not pets; so using (say) a bucket is easier to backup + survives your k8s cluster being recreated (e.g. if you change region or something) |
@jstrachan interesting to know you are more than giving a try to this operator. I am also on the verge of starting a PoC to assess it. Thanks for your template. I will likely also make use of the k8s backend as a starting point but will quickly change to S3. |
Hi,
I love the idea behind a terraform CRD (I'm watching this space and just discovered your project).
I'm wondering if there is a reason for not chosing https://www.terraform.io/docs/backends/types/kubernetes.html as a default backend? Is this because of the secret-size limit (1MB) ?
Thanks!
The text was updated successfully, but these errors were encountered: