edit

Deleting CFCR

This topic describes how to delete your Cloud Foundry Container Runtime (CFCR) deployment and destroy your BOSH environment.

Note

CFCR was formerly known as Kubo, and many CFCR assets described in this topic still use the Kubo name.

Delete CFCR

To delete your CFCR deployment, perform the following steps:

  1. Log in to your BOSH Director with bosh-cli -e BOSH-ENV log-in, where BOSH-ENV is the name of your BOSH environment. For example:

    $ bosh-cli -e my-bosh log-in User (): admin Password ():

    When prompted, enter admin for the user name and the admin password located in KUBO_ENV/creds.yml.
  2. Delete your CFCR deployment. Run the following command:
    bosh-cli -e BOSH-ENV -d KUBO-DEPLOYMENT delete-deployment

    Where:

    • BOSH-ENV: This is the name of your BOSH environment.
    • KUBO-DEPLOYMENT: This is the name of your CFCR deployment. To list your deployments, run bosh-cli -e BOSH-ENV deployments.

    For example:

    $ bosh-cli -e my-bosh -d my-kubo delete-deployment

Destroy BOSH Environment

To destroy all of the resources you created when deploying CFCR, perform the procedures below for your IaaS.

Note

This section is still under development.

Google Cloud Platform

Perform the following steps to destroy your BOSH environment on Google Cloud Platform (GCP):

  1. Log in to your bastion VM from the Google Cloud Shell. Follow the steps in the (Optional) Step 1: Set Up Your Environment section of the Configuring IaaS Routing for GCP topic.
  2. Change into the root of the kubo-deployment repo. Enter the following command:

    $ cd /share/kubo-deployment

  3. Execute the destroy_bosh script to destroy all of the VMs in your BOSH environment. Run the following command: ./bin/destroy_bosh KUBO_ENV SERVICE_ACCOUNT_KEY

    Where:

    • KUBO_ENV is the directory that contains your CFCR configuration.
    • SERVICE_ACCOUNT_KEY is your GCP service account key. If you followed the procedures in Deploying BOSH for CFCR on GCP, this is ~/terraform.key.json.

    For example:

    $ ./bin/destroy_bosh ~/kubo-env/kubo ~/terraform.key.json

  4. Change into the directory that contains the GCP Terraform templates. This directory must also contain your terraform.tfstate file. Enter the following command:

    $ cd ~/kubo-deployment/docs/terraform/gcp/platform

  5. Use Terraform to destroy the resources created by infrastructure paving. You must have set the same environment variables as in Deploying BOSH for CFCR on GCP. Enter the following command:

    $ docker run -i -t \ -e CHECKPOINT_DISABLE=1 \ -e "GOOGLE_CREDENTIALS=${GOOGLE_CREDENTIALS}" \ -v $(pwd):/$(basename $(pwd)) \ -w /$(basename $(pwd)) \ hashicorp/terraform:light destroy \ -var service_account_email=${service_account_email} \ -var projectid=${project_id} \ -var network=${network} \ -var region=${region} \ -var prefix=${prefix:-cfcr} \ -var zone=${zone} \ -var subnet_ip_prefix=${subnet_ip_prefix}

  6. Remove the Identity and Access Management (IAM) policy binding. Enter the following command:

    $ gcloud projects remove-iam-policy-binding ${project_id} \ --member serviceAccount:${service_account_email} \ --role roles/owner

  7. Remove the service account. Enter the following command:

    $ gcloud iam service-accounts delete ${service_account_email}

  8. Remove the service account key JSON from the bastion VM. Enter the following command:

    $ rm ~/terraform.key.json