GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to add a new cluster to the GitLab instance via the Admin API endpoint `/api/v4/admin/clusters/add`. It is useful for administrators who want to programmatically manage Kubernetes clusters or other cluster resources within GitLab. Typical use cases include automating cluster registration and management in GitLab CI/CD environments or infrastructure automation workflows.

Use Case Examples

  1. An admin automates the addition of a new Kubernetes cluster to GitLab for deployment pipelines.
  2. A DevOps engineer integrates cluster management into an infrastructure-as-code pipeline using this node.

Properties

Name Meaning
Skip Authentication Determines whether to skip API authentication for the request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication. Hidden if Skip Authentication is true.
baseUrl The base URL of the GitLab instance to which the API request is sent, defaulting to https://gitlab.com.
Method HTTP method to use for the request, defaulting to POST for this operation.
Parameter Schema Defines the schema for the request body parameters required to add a cluster. This is a hidden property used internally for validation.
Request Body Schema Schema for the request body, if any, used internally and hidden.
Request Path The API endpoint path for adding a cluster, fixed to `/api/v4/admin/clusters/add` and hidden from the user.

Output

JSON

  • id - The unique identifier of the newly added cluster.
  • name - The name of the cluster.
  • provider_type - The provider type of the cluster (e.g., Kubernetes).
  • enabled - Indicates whether the cluster is enabled.
  • created_at - Timestamp when the cluster was created.
  • platform_kubernetes_api_url - The API URL of the Kubernetes platform associated with the cluster.

Dependencies

  • GitLab API key credential for authentication unless Skip Authentication is enabled.

Troubleshooting

  • Ensure the GitLab API key has admin privileges to add clusters; otherwise, the request will fail with authorization errors.
  • Verify the baseUrl is correct and accessible from the n8n environment to avoid connection errors.
  • If Skip Authentication is enabled, ensure the GitLab instance allows unauthenticated API access, which is uncommon and may cause failures.
  • Check that the request body matches the expected schema for adding a cluster to avoid validation errors from the API.

Links

Discussion