Overview

This guide provides step-by-step instructions for uninstalling Develocity.

Standalone Uninstall

To remove all components associated with Develocity, uninstall the Helm chart.

Example:
$ helm uninstall --namespace develocity ge-standalone (1)
1 The name of your release, for example ge-standalone.

Kubernetes Uninstall

For StorageClasses with a 'delete' reclaim policy this will mean that all data will also be lost.

First, remove all components associated with Develocity, uninstall the Helm chart.

Example:
$ helm uninstall --namespace develocity ge (1)
1 The name of your release, for example ge.

Second, check for remaining PVs:

If you’re using StorageClasses with a 'retain' reclaim policy, you will need to review remaining Persistent Volumes (PVs) in your cluster after uninstalling to reclaim the space used.

Use the following kubectl command:

$ kubectl get pv --namespace develocity.

Consult the Kubernetes documentation about Persistent Volumes for more information.

When you’ve used helm template to generate Kubernetes manifests and applied them manually to a cluster, Develocity can be deleted a number of ways:

Develocity is the only application in the namespace

If you have installed Develocity into a Kubernetes namespace, and it’s the only resource in that namespace, you can delete the entire namespace. Deleting the namespace will also delete all resources within it, such as deployments, services, configmaps, secrets, etc.

To delete the namespace, use:

$ kubectl delete namespace develocity

Delete individual resources using a manifest file

If you don’t want to delete the entire namespace (maybe because there are other resources in the same namespace that you don’t want to remove), you can delete the resources that were created by the Helm-generated manifest.

When you use helm template, it generates a manifest file (for example, develocity.yaml) that contains all the Kubernetes resources necessary for installing Develocity. You can delete these resources by pointing kubectl to this generated manifest file.

To delete the resources that were created in the generated manifest from the last install or upgrade use:

$ kubectl --namespace develocity delete -f develocity.yaml

Provider based Uninstall

For uninstallation steps based on your cloud provider of choice, select from your options below:

Deleting your AWS EC2 Instance

This section will walk you through tearing down Develocity and deleting any resources on AWS EC2.

To delete your instance, run:

$ INSTANCE_ID=$(
    aws ec2 describe-instances \
    --filters Name=tag-key,Values=gradle-enterprise \
    --query Reservations[0].Instances[0].InstanceId \
    --output text
  )
$ aws ec2 terminate-instances --instance-ids ${INSTANCE_ID}
This command assumes that only one instance was created. If you have other instances with the tag develocity, you may need to alter the Reservations index.

To also remove the security group you created, run:

$ SECURITY_GROUP_ID=$(
    aws ec2 describe-security-groups \
    --filters Name=group-name,Values=ge-sg \
    --query 'SecurityGroups[0].GroupId' --output text
  )
$ aws ec2 delete-security-group --group-id ${SECURITY_GROUP_ID}
This will fail until deletion of the EC2 instance has finished.

And for the SSH key pair:

$ aws ec2 delete-key-pair --key-name DevelocityKeyPair

If you have other resources such as a user-managed database or S3 Build Scan storage, teardown instructions are in their respective sections below.

RDS Teardown

To delete the RDS instance, run:

Deleting an RDS instance also deletes any automated backups of its database. However, by default, the deletion command will create a final snapshot of the database.
$ aws rds delete-db-instance \
    --db-instance-identifier develocity-database \
    --final-db-snapshot-identifier develocity-db-snapshot
The delete-db-instance command requires that your instance is running so that it can create a final snapshot. You can skip the final snapshot and avoid this by passing --skip-final-snapshot instead of --final-db-snapshot-identifier develocity-db-snapshot.

The command will complete immediately, but deletion will likely take some time.

For more details on RDS instance deletion, consult AWS’s guide.

To also delete the security group, run:

$ RDS_SECURITY_GROUP_ID=$(
    aws ec2 describe-security-groups \
    --filters Name=group-name,Values=ge-db-sg \
    --query 'SecurityGroups[0].GroupId' --output text
  )
$ aws ec2 delete-security-group --group-id ${RDS_SECURITY_GROUP_ID}
This will fail until deletion of the database instance has finished.

S3 Teardown

To delete your S3 bucket, run:

$ ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
$ aws s3 rb s3://develocity-build-scans-${ACCOUNT_ID} --force
Deleting your S3 bucket will delete all stored Build Scans. Develocity features that rely on historical analysis (e.g. test analytics, predictive test selection) will fail or will provide less useful information.

Once you have deleted your EC2 instance, you can also delete your IAM resources by running the following commands:

$ aws iam remove-role-from-instance-profile \
    --instance-profile-name "Develocity_BuildScans_S3_InstanceProfile" \
    --role-name "eksctl-managed-Develocity_Application_Role"
$ aws iam delete-instance-profile --instance-profile-name Develocity_BuildScans_S3_InstanceProfile
$ ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
$ aws iam detach-role-policy \
    --role-name "Develocity_BuildScans_S3_Role" \
    --policy-arn "arn:aws:iam::${ACCOUNT_ID}:policy/develocity-s3-access" (1)
1 The ARN of the policy you created.
$ aws iam delete-role --role-name eksctl-managed-Develocity_Application_Role
$ aws iam delete-policy --policy-arn "arn:aws:iam::${ACCOUNT_ID}:policy/develocity-s3-access" (1)
1 The ARN of the policy you created.
If you didn’t get full IAM permissions, you may not be able to do this yourself.

Deleting your AWS EKS Cluster

This section will walk you through tearing down Develocity and deleting any resources on AWS EKS.

To start, uninstall the Develocity helm chart:

$ helm uninstall --develocity gradle-enterprise ge

If you have other resources such as a user-managed database or S3 Build Scan storage, teardown instructions are in their respective sections below.

If you are using other resources in the cluster’s VPC (such as an RDS instance), eksctl will fail to delete the VPC unless you delete those resources first. If this happens, the VPC and CloudFormation stack can be manually deleted. However, it’s generally easier to delete those resources first.

Then you can delete your cluster by running:

$ eksctl delete cluster --name develocity

RDS Teardown

To delete the RDS instance, run:

Deleting an RDS instance also deletes any automated backups of its database. However, by default, the deletion command will create a final snapshot of the database.
$ aws rds delete-db-instance \
    --db-instance-identifier develocity-database \
    --final-db-snapshot-identifier develocity-db-snapshot
The delete-db-instance command requires that your instance is running so that it can create a final snapshot. You can skip the final snapshot and avoid this requirement by passing --skip-final-snapshot instead of --final-db-snapshot-identifier develocity-db-snapshot.

The command will complete immediately, but deletion will likely take some time.

For more details on RDS instance deletion, consult AWS’s guide.

To also delete the security group, run:

$ RDS_SECURITY_GROUP_ID=$(
    aws ec2 describe-security-groups \
    --filters Name=group-name,Values=ge-db-sg \
    --query 'SecurityGroups[0].GroupId' --output text
  )
$ aws ec2 delete-security-group --group-id ${RDS_SECURITY_GROUP_ID}
This will fail until deletion of the database instance has finished.

And for the subnet group, run:

$ aws rds delete-db-subnet-group --db-subnet-group-name ge-db-subnet-group
This will fail until deletion of the database instance has finished.

S3 Teardown

To delete your S3 bucket, run:

$ ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
$ aws s3 rb s3://develocity-${ACCOUNT_ID} --force

The role you created will be deleted when you delete the cluster.

Deleting your S3 bucket will delete all stored Build Scans. Develocity features that rely on historical analysis (e.g. test analytics, predictive test selection) will fail or will provide less useful information.

Once the cluster is deleted, you can also delete your IAM policy by running the following commands:

$ ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
$ POLICY_ARN="arn:aws:iam::${ACCOUNT_ID}:policy/develocity-s3-access" (1)
1 The ARN of the policy you created.
$ aws iam delete-policy --policy-arn ${POLICY_ARN}

If you have any questions or need any assistance please contact the Develocity support team or your customer success representative.