Comments (3)
Hey, thanks for reaching out. Terraform cloud is something I very much want to support. However, I don't think it is currently possible. There are three potential blockers to investigate (that I know of):
-
Kubestack uses the
terraform-provider-kustomize
to integrate the cluster services into the Terraform plan/apply lifecycle. The provider is not available in the Terrafom registry yet. The recently announced support for community providers should solve this, but unfortunately I haven't been lucky enough to get access to the beta. So I wasn't able to work on this yet. -
The GKE module currently relies on a
external
data source that runs agcloud
CLI command to determine the current IAM account and ensure it hascluster-admin
ClusterRole. This may or may not work in Terraform cloud (untested). -
Terraform cloud, last time I checked, did not allow tags to trigger a run. Kubestack's GitOps flow relies on tags to promote a change from the ops environment to the critical apps environment.
I'll leave this issue open to track the requirements, so that support for Terraform cloud can be tested, as soon as the community provider feature is available.
from terraform-kubestack.
Thank you for the prompt response
- If I am honest kustomize is lesser of my concerns. I was able to compile it and TF Cloud picked it up from terraform.d/plugins/linux_amd64/ folder no problem. Where I am stuck is switching between ops and apps workspaces as TF Cloud always return "default" is something like terraform.workspace is used in the code. How can I work around it?
- We are on AWS so GKE is not relevant but point is valid for wider audience I guess;
- Is it not possible to use Run Triggers? Not the same as tag trigger deployment though.
It is basically hardcoded here - https://github.com/kbst/terraform-kubestack/blob/master/aws/cluster/configuration.tf:
locals {
apps config and merged ops config
workspaces = {
apps = var.configuration["apps"]
ops = merge(var.configuration["apps"], var.configuration["ops"])
}
TF Cloud returns default so it errors:
Error: Invalid index
on .terraform/modules/eks_zero/aws/cluster/configuration.tf line 9, in locals:
9: cfg = local.workspaces[terraform.workspace]
|----------------
| local.workspaces is object with 2 attributes
| terraform.workspace is "default"
The given key does not identify an element in this collection value.
from terraform-kubestack.
I think it's a bit confusing how Terraform cloud workspaces and terraform
cli workspaces have the same name but aren't quite the same thing.
But, a way I was able to make it work in a different context (application deployment) is to have workspaces in Terraform cloud with a prefix and then configuring the remote backend accordingly.
Here's the corresponding HCL. This example was for a hackathon and I only used Terraform cloud to store the state. But if you have the provider in the repository it should also work when you have workspaces that run remotely.
Here's the documentation regarding this prefix behavior, were you use a prefix when creating the cloud workspace, but terraform.workspace
will be the value without the prefix. So for Kubestack you would probably need to call the workspaces in Terraform cloud myprefix-ops
and myprefix-apps
, then configure the remote backend with myprefix
as the prefix.
I hope this helps. Let me know how it goes.
from terraform-kubestack.
Related Issues (20)
- GKE: Allow disabeling Nat Gateways Endpoint Independent mapping
- EKS: Allow setting enable_dns_hostnames for AWS VPCs
- EKS: EC2 volume type HOT 3
- AKS: end_date_relative error on latest azuread terraform module
- GKE: Egress IP Changes on cluster recreate HOT 5
- AKS: disable log analytics HOT 2
- Error using latest azuread provider HOT 4
- GKE: Investigate activating APIs in new accounts
- Deploying clusters into existing environment HOT 3
- azure aks default node pool availability_zones HOT 2
- GKE: Enable cluster Load Balacing - Can't use Container Native Load Balancer in GKE HOT 1
- Bare metal support? HOT 3
- enable private cluster on aks
- How can I set node kernel params on aks? (or any cloud) HOT 1
- EKS: Support labels and tags for default worker nodes HOT 1
- Any plans to support OCI (Oracle Cloud Infrastructure) / OKE (Oracle Kubernetes Engine)? HOT 2
- Cert-Manager Module: Wait for Resources HOT 1
- Deprecation message when running fresh quick-start with EKS
- Add support for kustomize replacements when creating custom-manifest HOT 5
- EKS: Support metadata IMDSv2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-kubestack.