Skip to content
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

Automate deprovisioning of environments #56

Open
gnarea opened this issue Dec 11, 2020 · 0 comments
Open

Automate deprovisioning of environments #56

gnarea opened this issue Dec 11, 2020 · 0 comments
Labels
area/continuous-deployment Issue related to Continuous Deployment (or lack thereof) enhancement New feature or request

Comments

@gnarea
Copy link
Member

gnarea commented Dec 11, 2020

I didn't do it as part of the provisioning because deprovisioning is a risky endeavour and has to be considered properly.

I'm inclined to solve this in two steps:

  • Prepare the Terraform-managed cloud resources for removal. I.e.:
    • Disable prevent_destroy and resource-specific equivalents.
    • Disable the GCB trigger for k8s deployments.
    • Create (or enable) a new GCB trigger to be run before terraform destroy (see next step).
  • Run a GCB trigger to:
    • Deprovision k8s resources, including cloud resources managed by k8s (e.g., the LB).
    • Empty GCS buckets by creating a lifecycle rule that sets their objects' age to 0 days. This is much quicker and cheaper than deleting objects, especially in versioned buckets.

That way, deprovisioning an environment will involve the following steps:

  1. Turn on the flag to allow destruction of the environment in Terraform.
  2. Run the deprovisioning GCB trigger.
  3. Delete the Terraform-managed resources.
@gnarea gnarea added enhancement New feature or request area/continuous-deployment Issue related to Continuous Deployment (or lack thereof) labels Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/continuous-deployment Issue related to Continuous Deployment (or lack thereof) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant