Edit instance cluster
This feature was introduced in GitLab 13.2. Updates an existing instance cluster.
Body
-
Cluster name
-
Enable or disable Gitlab's connection to your Kubernetes cluster
-
The associated environment to the cluster
-
Deploy each environment to a separate Kubernetes namespace
Default value is
true
. -
Cluster base domain
-
The ID of the management project
-
Determines if GitLab will manage namespaces and service accounts for this cluster
-
URL to access the Kubernetes API
-
Token to authenticate against Kubernetes
-
TLS certificate (needed if API is using a self-signed TLS certificate)
-
Unique namespace related to Project
PUT
/admin/clusters/{cluster_id}
curl \
--request PUT 'https://www.gitlab.com/api/v4/admin/clusters/{cluster_id}' \
--header "Private-Token: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"name":"string","enabled":true,"environment_scope":"string","namespace_per_environment":true,"domain":"string","management_project_id":42,"managed":true,"platform_kubernetes_attributes[api_url]":"string","platform_kubernetes_attributes[token]":"string","platform_kubernetes_attributes[ca_cert]":"string","platform_kubernetes_attributes[namespace]":"string"}'
Request examples
{
"name": "string",
"enabled": true,
"environment_scope": "string",
"namespace_per_environment": true,
"domain": "string",
"management_project_id": 42,
"managed": true,
"platform_kubernetes_attributes[api_url]": "string",
"platform_kubernetes_attributes[token]": "string",
"platform_kubernetes_attributes[ca_cert]": "string",
"platform_kubernetes_attributes[namespace]": "string"
}
Response examples (200)
{
"id": "string",
"name": "string",
"created_at": "string",
"domain": "string",
"enabled": "string",
"managed": "string",
"provider_type": "string",
"platform_type": "string",
"environment_scope": "string",
"cluster_type": "string",
"namespace_per_environment": "string",
"user": {
"id": 1,
"username": "admin",
"name": "Administrator",
"state": "active",
"avatar_url": "https://gravatar.com/avatar/1",
"avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
"custom_attributes": [
{
"key": "foo",
"value": "bar"
}
],
"web_url": "https://gitlab.example.com/root",
"email": "string"
},
"platform_kubernetes": {
"api_url": "string",
"namespace": "string",
"authorization_type": "string",
"ca_cert": "string"
},
"provider_gcp": {
"cluster_id": "string",
"status_name": "string",
"gcp_project_id": "string",
"zone": "string",
"machine_type": "string",
"num_nodes": "string",
"endpoint": "string"
},
"management_project": {
"id": 1,
"description": "desc",
"name": "project1",
"name_with_namespace": "John Doe / project1",
"path": "project1",
"path_with_namespace": "namespace1/project1",
"created_at": "2020-05-07T04:27:17Z"
}
}