clusters

Create an instance cluster

Creates an instance cluster by adding an existing Kubernetes cluster.

post/api/v4/admin/clusters/add

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Request body

namestring required

Cluster name

enabledboolean

Determines if cluster is active or not, defaults to true

environment_scopestring

The associated environment to the cluster

namespace_per_environmentboolean

Deploy each environment to a separate Kubernetes namespace

domainstring

Cluster base domain

management_project_idinteger

The ID of the management project

managedboolean

Determines if GitLab will manage namespaces and service accounts for this cluster, defaults to true

Response

Create an instance cluster

idstring required
namestring required
created_atstring required
domainstring required
enabledstring required
managedstring required
provider_typestring required
platform_typestring required
environment_scopestring required
cluster_typestring required
namespace_per_environmentstring required

Example response

{
  "user": {
    "id": 1,
    "username": "admin",
    "public_email": "john@example.com",
    "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"
  },
  "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:17.016Z"
  }
}

Changes

No recorded changes to this operation across all 5 revisions of this API.