---
title: "Create Kubernetes cloud"
method: POST
path: "/clouds/kubernetes"
---

# Create Kubernetes cloud

`POST /clouds/kubernetes`

## Request

- Base URL: `https://app.aikido.dev/api/public/v1`
- URL: `https://app.aikido.dev/api/public/v1/clouds/kubernetes`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://app.aikido.io/api/oauth/token` scopes: `clouds:write`

Connect your Kubernetes cluster to Aikido. This will register a cluster and return the agent token needed for installation. https://github.com/AikidoSec/helm-charts

## Request body

- object
  - `name` string, required: A name for this Kubernetes cluster.
  - `environment` 'production' | 'staging' | 'development' | 'mixed', required: Indicates for what environment this cloud is responsible.
  - `excluded_namespaces` string[]: List of Kubernetes namespaces to exclude from monitoring (optional). Mutually exclusive with included_namespaces.
  - `included_namespaces` string[]: List of Kubernetes namespaces to include for monitoring (optional). Mutually exclusive with excluded_namespaces.
  - `enable_image_scanning` boolean: Whether to enable container image scanning for this cluster (optional, defaults to false)

## Response `200`

The Kubernetes cloud environment has been successfully created

- object
  - `id` integer: The ID of the newly created cloud environment in Aikido.
  - `endpoint` string: The endpoint where the agent should send the data.
  - `agent_token` string: The token needed to install the Kubernetes agent.
  - `created_at` integer: Unix timestamp when the cluster was created.

## Other responses

- `400`: Could not create Kubernetes cloud

---

[API](https://skmtc.dev/aikido/apis/aikido-security-api-documentation.md) - [All operations](https://skmtc.dev/aikido/apis/aikido-security-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/aikido/apis/aikido-security-api-documentation/revisions/da8691338133?raw)
