> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aviatrix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Cluster Configuration

> Creates a new ClusterConfig



## OpenAPI

````yaml /openapi/8.2/aviatrix-api.json post /v2.5/api/k8s/clusters
openapi: 3.1.0
info:
  title: Aviatrix Controller API
  version: '8.2'
  description: >-
    Aviatrix Controller API — version 8.2. Selected operations with Mintlify
    metadata.
servers: []
security: []
tags:
  - name: policies
    x-group: Policies
  - name: authentication
    x-group: Authentication
  - name: account-management
    x-group: Account Management
  - name: rbac
    x-group: RBAC & Permissions
  - name: gateways
    x-group: Gateways
  - name: transit
    x-group: Transit
  - name: nat
    x-group: NAT
  - name: app-domains
    x-group: SmartGroups
  - name: certificates
    x-group: Certificates
  - name: mitm
    x-group: MITM
  - name: monitoring
    x-group: Monitoring & Diagnostics
  - name: fqdn
    x-group: FQDN
  - name: logging
    x-group: Logging
  - name: vpn
    x-group: UserVPN
  - name: site-to-cloud
    x-group: Site-to-Cloud
  - name: controller
    x-group: Controller
  - name: bgp
    x-group: BGP
  - name: general
    x-group: General
  - name: firenet
    x-group: FireNet
  - name: networking
    x-group: Networking
  - name: tgw
    x-group: AWS TGW
  - name: ips
    x-group: IPS
  - name: saml
    x-group: SAML
paths:
  /v2.5/api/k8s/clusters:
    post:
      tags:
        - general
      summary: Create a ClusterConfig
      description: Creates a new ClusterConfig
      operationId: k8s_create_cluster_configs
      parameters:
        - name: Authorization
          in: header
          required: true
          description: 'Controller ID in the format: cid <CID>.'
          schema:
            type: string
            example: cid <CID>
            default: cid <CID>
          example: cid <CID>
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClusterConfig'
        description: ClusterConfig object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClusterConfig'
          description: Successful operation
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
          description: Bad request.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: |
            Another cluster configuration with the same cluster_id and
             account_name exists already
        default:
          $ref: '#/components/responses/general_response_v25'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -sk -X POST "https://<controller>/v2.5/api/k8s/clusters" \
              -H "Authorization: cid <CID>"
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://<controller>/v2.5/api/k8s/clusters"
            headers = {"Authorization": "cid <CID>"}

            response = requests.post(url, headers=headers)
            print(response.text)
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
            )

            func main() {
              req, _ := http.NewRequest("POST", "https://<controller>/v2.5/api/k8s/clusters", nil)
              req.Header.Set("Authorization", "cid <CID>")

              client := &http.Client{}
              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              fmt.Println(resp.Status)
            }
components:
  schemas:
    ClusterConfig:
      example:
        cluster_id: cluster_id
        credential:
          kube_config: kube_config
        gateway_tunnel_enabled: true
        id: id
        resource:
          account_id: account_id
          compartment: compartment
          name: name
          platform: platform
          project: project
          public: true
          region: region
          tags:
            - key: key
              value: value
            - key: key
              value: value
          version: version
          vpc_id: vpc_id
      properties:
        cluster_id:
          type: string
        credential:
          $ref: '#/components/schemas/ClusterCredential'
        gateway_tunnel_enabled:
          type: boolean
        id:
          type: string
        intra_cluster_inspection_enabled:
          type: boolean
        resource:
          $ref: '#/components/schemas/ClusterResource'
      required:
        - cluster_id
      type: object
    BadRequestResponse:
      example:
        errors:
          - message: message
            path: path
          - message: message
            path: path
        message: message
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ValidationErrorObject'
          type: array
        message:
          type: string
      type: object
    ErrorResponse:
      example:
        message: message
      properties:
        message:
          type: string
      type: object
    ClusterCredential:
      example:
        kube_config: kube_config
      properties:
        kube_config:
          type: string
        use_csp_credentials:
          type: boolean
      type: object
    ClusterResource:
      example:
        account_id: account_id
        account_name: account_name
        compartment: compartment
        name: name
        network_mode: OVERLAY
        platform: platform
        project: project
        public: true
        region: region
        tags:
          - key: key
            value: value
          - key: key
            value: value
        version: version
        vpc_id: vpc_id
      properties:
        account_id:
          type: string
        account_name:
          type: string
        compartment:
          type: string
        entra_id_authn:
          type: boolean
        name:
          type: string
        network_mode:
          enum:
            - OVERLAY
            - FLAT
          type: string
        platform:
          type: string
        project:
          type: string
        public:
          type: boolean
        region:
          type: string
        tags:
          items:
            $ref: '#/components/schemas/Tag'
          type: array
        version:
          type: string
        vpc_id:
          type: string
      required:
        - account_id
        - name
        - platform
        - public
        - region
        - version
        - vpc_id
      type: object
    ValidationErrorObject:
      example:
        message: message
        path: path
      properties:
        message:
          type: string
        path:
          type: string
      type: object
    general_response_v25:
      description: A generic API response container for v2.5 style APIs.
      properties:
        message:
          description: A human-readable message.
          type: string
      title: General Response v2.5
      type: object
    Tag:
      example:
        key: key
        value: value
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
      type: object
  responses:
    general_response_v25:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/general_response_v25'
      description: General v2.5 API response schema.

````