These certificate-based cluster endpoints are deprecated.
Use this API to manage and discover the certificate-based Kubernetes clusters of an instance, a group, or a project. Connecting a cluster to a group or an instance lets you use the same cluster across multiple projects.
Instance endpoints require administrator access. Group and project endpoints require the Maintainer or Owner role.
List all instance clusters
GET /api/v4/admin/clusters
Lists all instance clusters for the instance.
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
403 | Forbidden | — |
Create an instance cluster
POST /api/v4/admin/clusters/add
Creates an instance cluster by adding an existing Kubernetes cluster.
Request body (application/json)
| Property | Type | Description |
|---|---|---|
domain | String | Base domain of the cluster |
enabled | Boolean | If true,Default: true |
environment_ | String | Associated environment to the cluster Default: * |
managed | Boolean | If true,Default: true |
management_ | Integer | ID of the management project for the cluster |
nameRequired | String | Name of the cluster |
namespace_ | Boolean | If true,Default: true |
platform_Required | Object | Platform Kubernetes data |
platform_Required | String | URL to access the Kubernetes API |
platform_ | String | Cluster authorization type Allowed values: unknown_,rbac,abacDefault: rbac |
platform_ | String | TLS certificate (needed if API is using a self- |
platform_ | String | Kubernetes namespace that environments deploy to.managed is false |
platform_Required | String | Token to authenticate against Kubernetes |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Validation error | — |
403 | Forbidden | — |
404 | Not found | — |
Retrieve a single instance cluster
GET /api/v4/admin/clusters/{cluster_id}
Retrieves a specified instance cluster.
Parameters
| Name | Type | Description |
|---|---|---|
cluster_Path, | Integer | ID of the cluster |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Update an instance cluster
PUT /api/v4/admin/clusters/{cluster_id}
Updates an existing instance cluster.
Parameters
| Name | Type | Description |
|---|---|---|
cluster_Path, | Integer | ID of the cluster |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
domain | String | Base domain of the cluster |
enabled | Boolean | If true, |
environment_ | String | Associated environment to the cluster |
managed | Boolean | If true, |
management_ | Integer | ID of the management project for the cluster |
name | String | Name of the cluster |
namespace_ | Boolean | If true,Default: true |
platform_ | Object | Platform Kubernetes data |
platform_ | String | URL to access the Kubernetes API |
platform_ | String | TLS certificate (needed if API is using a self- |
platform_ | String | Kubernetes namespace that environments deploy to.managed is false |
platform_ | String | Token to authenticate against Kubernetes |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Validation error | — |
403 | Forbidden | — |
404 | Not found | — |
Delete instance cluster
DELETE /api/v4/admin/clusters/{cluster_id}
Deletes an existing instance cluster. Does not remove existing resources in the connected Kubernetes cluster.
Parameters
| Name | Type | Description |
|---|---|---|
cluster_Path, | Integer | ID of the cluster |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
List all certificate-based clusters
GET /api/v4/discover-cert-based-clusters
Lists all certificate-based clusters associated with a project. This feature was introduced in GitLab 17.9.
Parameters
| Name | Type | Description |
|---|---|---|
group_Query, | Integer | ID of the group to find all certificate- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
List all group clusters
GET /api/v4/groups/{id}/clusters
Lists all group clusters for a specified group.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or URL- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not Found | — |
Create a group cluster
POST /api/v4/groups/{id}/clusters/user
Creates a group cluster for a specified group by adding an existing Kubernetes cluster.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
domain | String | Base domain of the cluster |
enabled | Boolean | If true,Default: true |
environment_ | String | Associated environment to the cluster. Default: * |
managed | Boolean | If true,Default: true |
management_ | Integer | ID of the management project for the cluster |
nameRequired | String | Name of the cluster |
namespace_ | Boolean | If true,Default: true |
platform_Required | Object | Platform Kubernetes data |
platform_Required | String | URL to access the Kubernetes API |
platform_ | String | Cluster authorization type Allowed values: unknown_,rbac,abacDefault: rbac |
platform_ | String | TLS certificate (needed if API is using a self- |
platform_ | String | Kubernetes namespace that environments deploy to.managed is false |
platform_Required | String | Token to authenticate against Kubernetes |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Validation error | — |
403 | Forbidden | — |
404 | Not found | — |
Retrieve a group cluster
GET /api/v4/groups/{id}/clusters/{cluster_id}
Retrieves a specified group cluster.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or URL- |
cluster_Path, | Integer | ID of the cluster |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Update a group cluster
PUT /api/v4/groups/{id}/clusters/{cluster_id}
Updates a specified group cluster.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or URL- |
cluster_Path, | Integer | ID of the cluster |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
domain | String | Base domain of the cluster |
enabled | Boolean | If true, |
environment_ | String | Associated environment to the cluster. |
managed | Boolean | If true, |
management_ | Integer | ID of the management project for the cluster |
name | String | Name of the cluster |
namespace_ | Boolean | If true,Default: true |
platform_ | Object | Platform Kubernetes data |
platform_ | String | URL to access the Kubernetes API |
platform_ | String | TLS certificate (needed if API is using a self- |
platform_ | String | Kubernetes namespace that environments deploy to.managed is false |
platform_ | String | Token to authenticate against Kubernetes |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Validation error | — |
403 | Forbidden | — |
404 | Not found | — |
Delete a group cluster
DELETE /api/v4/groups/{id}/clusters/{cluster_id}
Deletes a specified group cluster. Does not remove existing resources in the connected Kubernetes cluster.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or URL- |
cluster_Path, | Integer | ID of the cluster |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
List all clusters in a project
GET /api/v4/projects/{id}/clusters
Lists all clusters in a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not Found | — |
Add a cluster to a project
POST /api/v4/projects/{id}/clusters/user
Adds a cluster to a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
domain | String | Base domain of the cluster |
enabled | Boolean | If true,Default: true |
environment_ | String | Associated environment to the cluster. Default: * |
managed | Boolean | If true,Default: true |
management_ | Integer | ID of the management project for the cluster |
nameRequired | String | Name of the cluster |
namespace_ | Boolean | If true,Default: true |
platform_Required | Object | Platform Kubernetes data |
platform_Required | String | URL to access the Kubernetes API |
platform_ | String | Cluster authorization type Allowed values: unknown_,rbac,abacDefault: rbac |
platform_ | String | TLS certificate (needed if API is using a self- |
platform_ | String | Kubernetes namespace that environments deploy to.managed and namespace_ are true, |
platform_Required | String | Token to authenticate against Kubernetes |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Validation error | — |
403 | Forbidden | — |
404 | Not found | — |
Retrieve a cluster from a project
GET /api/v4/projects/{id}/clusters/{cluster_id}
Retrieves a specified cluster in a project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
cluster_Path, | Integer | ID of the cluster |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Update a cluster in a project
PUT /api/v4/projects/{id}/clusters/{cluster_id}
Updates a cluster in a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
cluster_Path, | Integer | ID of the cluster |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
domain | String | Base domain of the cluster |
enabled | Boolean | If true, |
environment_ | String | Associated environment to the cluster. |
managed | Boolean | If true, |
management_ | Integer | ID of the management project for the cluster |
name | String | Name of the cluster |
namespace_ | Boolean | If true,Default: true |
platform_ | Object | Platform Kubernetes data |
platform_ | String | URL to access the Kubernetes API |
platform_ | String | TLS certificate (needed if API is using a self- |
platform_ | String | Kubernetes namespace that environments deploy to.managed and namespace_ are true, |
platform_ | String | Token to authenticate against Kubernetes |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Validation error | — |
403 | Forbidden | — |
404 | Not found | — |
Delete cluster from a project
DELETE /api/v4/projects/{id}/clusters/{cluster_id}
Deletes a specified cluster from a project. Does not remove existing resources in the connected Kubernetes cluster.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
cluster_Path, | Integer | ID of the cluster |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesBasicGroupDetails
| Property | Type | Description |
|---|---|---|
id | Integer (int64) | — |
name | String | Example:Diaspora |
web_ | String | Example:http: |
APIEntitiesBasicProjectDetails
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:http: |
created_ | String (date- | Example:2020- |
custom_ | APIEntities | — |
default_ | String | Example:main |
description | String | Example:desc |
forks_ | Integer | Example:1 |
http_ | String | Example:https: |
id | Integer (int64) | Example:1 |
last_ | String (date- | Example:2013- |
license | APIEntities | — |
license_ | String | Example:https: |
name | String | Example:project1 |
name_ | String | Example:John Doe / |
namespace | APIEntities | — |
path | String | Example:project1 |
path_ | String | Example:namespace1/ |
readme_ | String | Example:https: |
repository_ | String | Example:default |
ssh_ | String | Example:git@gitlab. |
star_ | Integer | Example:1 |
tag_ | Array of strings | Example:["tag"] |
topics | Array of strings | Example:["topic"] |
visibility | String | Example:public |
web_ | String | Example:https: |
APIEntitiesCluster
| Property | Type | Description |
|---|---|---|
cluster_ | String | — |
created_ | String | — |
domain | String | — |
enabled | String | — |
environment_ | String | — |
id | String | — |
managed | String | — |
management_ | APIEntities | — |
name | String | — |
namespace_ | String | — |
platform_ | APIEntities | — |
platform_ | String | — |
provider_ | APIEntities | — |
provider_ | String | — |
user | APIEntities | — |
APIEntitiesClusterGroup
| Property | Type | Description |
|---|---|---|
cluster_ | String | — |
created_ | String | — |
domain | String | — |
enabled | String | — |
environment_ | String | — |
group | APIEntities | — |
id | String | — |
managed | String | — |
management_ | APIEntities | — |
name | String | — |
namespace_ | String | — |
platform_ | APIEntities | — |
platform_ | String | — |
provider_ | APIEntities | — |
provider_ | String | — |
user | APIEntities | — |
APIEntitiesClusterProject
| Property | Type | Description |
|---|---|---|
cluster_ | String | — |
created_ | String | — |
domain | String | — |
enabled | String | — |
environment_ | String | — |
id | String | — |
managed | String | — |
management_ | APIEntities | — |
name | String | — |
namespace_ | String | — |
platform_ | APIEntities | — |
platform_ | String | — |
project | APIEntities | — |
provider_ | APIEntities | — |
provider_ | String | — |
user | APIEntities | — |
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesDiscoveredClusters
| Property | Type | Description |
|---|---|---|
groups | Object | — |
projects | Object | — |
APIEntitiesLicenseBasic
| Property | Type | Description |
|---|---|---|
html_ | String | Example:http: |
key | String | Example:gpl- |
name | String | Example:GNU General Public License v3. |
nickname | String | Example:GNU GPLv3 |
source_ | String | — |
APIEntitiesNamespaceBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:https: |
full_ | String | Example:group/ |
id | Integer (int64) | Example:2 |
kind | String | Example:project |
name | String | Example:project |
parent_ | Integer (int64) | Example:1 |
path | String | Example:my_ |
web_ | String | Example:https: |
APIEntitiesPlatformKubernetes
| Property | Type | Description |
|---|---|---|
api_ | String | — |
authorization_ | String | — |
ca_ | String | — |
namespace | String | — |
APIEntitiesProjectIdentity
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2020- |
description | String | Example:desc |
id | Integer (int64) | Example:1 |
name | String | Example:project1 |
name_ | String | Example:John Doe / |
path | String | Example:project1 |
path_ | String | Example:namespace1/ |
APIEntitiesProviderGcp
| Property | Type | Description |
|---|---|---|
cluster_ | String | — |
endpoint | String | — |
gcp_ | String | — |
machine_ | String | — |
num_ | String | — |
status_ | String | — |
zone | String | — |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | Example:https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | Example:1 |
locked | Boolean | — |
name | String | Example:Administrator |
public_ | String | Example:john@example. |
state | String | Example:active |
username | String | Example:admin |
web_ | String | Example:https: |