2020-05-24 23:13:21 +05:30
---
stage: Configure
group: Configure
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2020-05-24 23:13:21 +05:30
---
2021-09-30 23:02:18 +05:30
# Add a cluster using cluster certificates (DEPRECATED) **(FREE)**
2021-09-04 01:27:46 +05:30
2021-09-30 23:02:18 +05:30
> [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/327908) in GitLab 14.0.
2021-09-04 01:27:46 +05:30
WARNING:
2021-12-11 22:18:48 +05:30
This feature was [deprecated ](https://gitlab.com/gitlab-org/gitlab/-/issues/327908 ) in GitLab 14.0.
2022-07-23 23:45:48 +05:30
To create and manage a new cluster use [Infrastructure as Code ](../../infrastructure/iac/index.md ).
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
## Disable a cluster
2019-12-26 22:10:19 +05:30
2022-07-16 23:28:13 +05:30
When you successfully connect an existing cluster using cluster certificates, the cluster connection to GitLab becomes enabled. To disable it:
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
1. Go to your:
- Project's ** {cloud-gear}** **Infrastructure > Kubernetes clusters** page, for a project-level cluster.
2020-07-28 23:09:34 +05:30
- Group's ** {cloud-gear}** **Kubernetes** page, for a group-level cluster.
2022-10-11 01:57:18 +05:30
- **Main menu > Admin > Kubernetes** page, for an instance-level cluster.
2021-09-30 23:02:18 +05:30
1. Select the name of the cluster you want to disable.
1. Toggle **GitLab Integration** off (in gray).
2022-07-23 23:45:48 +05:30
1. Select **Save changes** .
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
## Remove a cluster
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/26815) in GitLab 12.6, you can remove cluster integrations and resources.
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
When you remove a cluster integration, you only remove the cluster relationship
2023-04-23 21:23:45 +05:30
to GitLab, not the cluster. To remove the cluster itself, go to your cluster's
2021-09-30 23:02:18 +05:30
GKE or EKS dashboard to do it from their UI or use `kubectl` .
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
You need at least Maintainer [permissions ](../../permissions.md ) to your
project or group to remove the integration with GitLab.
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
When removing a cluster integration, you have two options:
2020-03-13 15:44:24 +05:30
2021-09-30 23:02:18 +05:30
- **Remove integration**: remove only the Kubernetes integration.
- **Remove integration and resources**: remove the cluster integration and
all GitLab cluster-related resources such as namespaces, roles, and bindings.
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
To remove the Kubernetes cluster integration:
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
1. Go to your cluster details page.
1. Select the **Advanced Settings** tab.
1. Select either **Remove integration** or **Remove integration and resources** .
2022-08-27 11:52:29 +05:30
### Remove clusters by using the Rails console **(FREE SELF)**
[Start a Rails console session ](../../../administration/operations/rails_console.md#starting-a-rails-console-session ).
To find a cluster:
``` ruby
cluster = Clusters::Cluster.find(1)
cluster = Clusters::Cluster.find_by(name: 'cluster_name')
```
To delete a cluster but not the associated resources:
```ruby
# Find users who have administrator access
user = User.find_by(username: 'admin_user')
# Find the cluster with the ID
cluster = Clusters::Cluster.find(1)
# Delete the cluster
Clusters::DestroyService.new(user).execute(cluster)
```