Skip to content

Commit

Permalink
[install/infra] Add namespace/context to eks Terraform workspaces (#1…
Browse files Browse the repository at this point in the history
…0809)

At present we generate random 5 character workspace names for our
terraform code. While suitable for machine use, these terse names don't
provide execution context, making it difficult to locate relevant workspaces
and prune old namespaces.

```
$ terraform workspace list|wc -l
298
```

This commit addresses the issue by adding a prefix of the execution
context (EKS) and the current unix epoch to auto-generated terraform
workspace to assist identification of recent CI runs and remove stale
workspaces.

This commit doesn't address this issue in other environments (gke, k3s).
We can address that in a followup commit.
  • Loading branch information
adrienthebo authored and nandajavarma committed Jun 22, 2022
1 parent 7f850c5 commit f40f210
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .werft/eks-installer-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pod:
sudo chown -R gitpod:gitpod /workspace
sudo apt update && apt install gettext-base
export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)
export TF_VAR_TEST_ID="eks-$(date +%s)-$(echo $RANDOM | md5sum | head -c 5; echo)"
(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
printf '{{ toJson . }}' > context.json
Expand Down

0 comments on commit f40f210

Please sign in to comment.