---
title: "Create Cluster"
method: POST
path: "/ocean/azure/np/cluster"
tags: ["Ocean AKS"]
---

# Create Cluster

`POST /ocean/azure/np/cluster`

Creates an Ocean entity according to a given specification.

<p>Notes:<br></p>

It is recommended to import all necessary information from the existing AKS cluster using the Ocean [AKS Cluster Import](https://spec.dev.spot.io/#operation/oceanAKSClusterImport) API call and use its output to create a fully configured Ocean cluster.

<p>The Ocean Controller is used to monitor the cluster resources and report back to Ocean SaaS. <b>A properly functioning controller is mandatory for Ocean to operate.</b>

Installing the controller can be easily done by Helm, Terraform or a script using the [guide](https://docs.flexera.com/spot/ocean/tutorials/spot-kubernetes-controller/ocean-controller-two-install?id=new-clusters-install-the-ocean-controller-version-2).</p>

## Parameters

- `#/paths/~1azure~1costs/get/parameters/0` — unresolved $ref

## Request body

- object
  - `cluster` object, required — The Ocean cluster.
    - `id` string — Ocean cluster identifier.
    - `name` string, required — Add a name for the Ocean cluster.
    - `controllerClusterId` string, required — Enter a unique Ocean cluster identifier. Cannot be updated.
    - `aks` object, required — AKS cluster configuration. Cannot be updated.
      - `clusterName` string, required — The name of the AKS Cluster.
      - `resourceGroupName` string, required — The name of the cluster's resource group.
      - `region` string, required — The cluster's region.
      - `infrastructureResourceGroupName` string, required — The name of the cluster's infrastructure resource group.
    - `autoScaler` object — The Ocean Kubernetes Autoscaler object.
      - `isEnabled` boolean — Enable the Ocean Kubernetes Autoscaler.
      - `resourceLimits` object — Optionally set upper and lower bounds on the resource usage of the cluster.
        - `maxVCpu` integer — The maximum cpu in vCpu units that can be allocated to the cluster.
        - `maxMemoryGib` integer — The maximum memory in GiB units that can be allocated to the cluster.
      - `down` object — Autoscaling scale down operations.
        - `maxScaleDownPercentage` number, double — The maximum percentage allowed to scale down in a single scaling action.
      - `enableAutomaticAndManualHeadroom` boolean — Enable mixed mode for manual and automatic headroom. Relevant only when `headroom.automatic.isEnabled` is set to true. If false, Ocean manages headroom automatically without combining with manual VNG headrooms.
      - `headroom` object — Spare resource capacity management enabling fast assignment of pods without waiting for new resources to launch.
        - `automatic` object — Automatic headroom configuration.
          - `isEnabled` boolean — Enable automatic headroom. When set to True, Ocean configures and optimizes headroom automatically.
          - `percentage` integer — Optionally set a number between 0-200 to control the percentage of total cluster resources dedicated to headroom.
    - `scheduling` object — An object used to specify times when the cluster will turn off. Once the shutdown time will be over, the cluster will return to its previous state.
      - `shutdownHours` object — An object used to specify times that the nodes in the cluster will be taken down.
        - `timeWindows` string[] — The times that the shutdown hours will apply. Required if isEnabled is true.
        - `isEnabled` boolean — Flag to enable or disable the shutdown hours mechanism. When False, the mechanism is deactivated, and the cluster remains in its current state.
      - `tasks` object[] — A list of scheduling tasks to preform on the cluster at a specific cron time.
        - `isEnabled` boolean, required — Flag to enable or disable the scheduling task.
        - `cronExpression` string, required — A valid cron expression. The cron is running in UTC time zone and is in Unix cron format of Cron Expression Validator Script.
        - `taskType` 'clusterRoll' | 'autoUpgradeVersion', required — The type of the scheduling task.
        - `parameters` object — The parameters of the cluster roll scheduling task.
          - `batchSizePercentage` integer — The percentage of the cluster that will be rolled at each batch.
          - `comment` string — A comment to be added to the cluster roll.
          - `respectPdb` boolean — During the roll, if the parameter is set to true we honor PDB during the instance replacement.
          - `respectRestrictScaleDown` boolean — During the roll, if the parameter is set to true we honor Restrict Scale Down label during the nodes replacement.
          - `batchMinHealthyPercentage` integer — The minimum percentage of the scaled nodes that should be healthy at each batch.
          - `vngIds` string[] — List of Virtual Node Group IDs to be rolled. If not set or set to null, cluster roll will be applied.
      - `suspensionHours` object — An object used to specify times that the cluster should be exempted from Ocean's scaling-down activities to ensure uninterrupted operations during critical periods.
        - `timeWindows` string[] — The times that the suspension hours will apply. Required if isEnabled is true.
        - `isEnabled` boolean — Flag to enable or disable the suspension hours mechanism. When False, the mechanism is deactivated, and the cluster remains in its current state.
    - `logging` object — The Ocean AKS Logging object.
      - `export` object, required — The Ocean AKS Logging Export object.
        - `azureBlob` object, required — Exports your cluster's logs to the storage account and container configured on the storage account [data integration](https://docs.flexera.com/spot/ocean/features/log-integration-with-azure-blob?id=log-integration-with-azure-blob) given. Each file contains logs of 3 minutes where each log is separated by a new line and saved as a JSON. The file formats are `container`/`accountId`_`oceanId`_`oceanName`_`startTime`.log
          - `id` string, required — The identifier of The Azure Blob data integration to export the logs to.
    - `health` object — The Ocean AKS Health object.
      - `shouldReplaceUnhealthyInstances` boolean — 'Indicates whether Ocean automatically replaces nodes that remain in a NotReady or Unschedulable state. When false, unhealthy nodes are detected but not replaced. When true, unhealthy nodes are automatically replaced.
      - `gracePeriod` integer — The amount of time, in seconds, from the moment the node is registered and observed by Ocean until health checks for replacement purposes begin. Defines a grace period during which health checks are suppressed for newly observed nodes.
      - `healthCheckUnhealthyDurationBeforeReplacement` integer — The amount of time, in seconds, a node is allowed to remain unhealthy after the grace period has elapsed before Ocean automatically replaces it.
    - `virtualNodeGroupTemplate` object, required
      - `availabilityZones` string[], required — An Array holding Availability Zones, this configures the availability zones the Ocean may launch nodes in per VNG.\ Select zone 0 if you have a workload that requires no availability zone redundancy (AZ=null). You can select this option either alone or together with other availability zones.\ In case zone 0 is selected together with other availability zones, nodes of zone 0 will be scaled only for workloads that demand it.
      - `nodePoolProperties` NodePoolProperties — unresolved $ref
      - `nodeCountLimits` NodeCountLimits — unresolved $ref
      - `strategy` Strategy — unresolved $ref
      - `autoScale` AutoScale — unresolved $ref
      - `labels` object — key-value pairs of labels to add to the virtual node group.\ Only custom user labels are allowed, and not Kubernetes built-in labels or Spot internal labels.\ The following are not allowed: * "kubernetes.azure.com/agentpool" * "kubernetes.io/arch"* "kubernetes.io/os" * "node.kubernetes.io/instance-type" * "topology.kubernetes.io/region" * "topology.kubernetes.io/zone" * "kubernetes.azure.com/cluster" * "kubernetes.azure.com/mode" * "kubernetes.azure.com/role" * "kubernetes.azure.com/scalesetpriority" * "kubernetes.io/hostname" * "kubernetes.azure.com/storageprofile" * "kubernetes.azure.com/storagetier" * "kubernetes.azure.com/instance-sku" * "kubernetes.azure.com/node-image-version" * "kubernetes.azure.com/subnet" * "kubernetes.azure.com/vnet" * "kubernetes.azure.com/ppg" * "kubernetes.azure.com/encrypted-set" * "kubernetes.azure.com/accelerator" * "kubernetes.azure.com/fips_enabled" * "kubernetes.azure.com/os-sku"
      - `taints` object[] — Add taints to a virtual node group.
        - `key` string — Set taint key. The following are not allowed: * "kubernetes.azure.com/scalesetpriority"
        - `value` string — Set taint value.
        - `effect` 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute' | 'PreferNoExecute' — Set taint effect.
      - `tags` object — A maximum of 20 unique key-value pairs for VM tags in the virtual node group. Note: Azure has a tag limit of 50 per node pool.
      - `vmSizes` VmSizes — unresolved $ref
      - `scheduling` Scheduling — unresolved $ref
      - `restrictScaleDown` boolean — When set to True, VNG nodes will be treated as if all pods running have the [restrict-scale-down label](https://docs.flexera.com/spot/ocean/features/labels-and-taints). Therefore, Ocean will not scale nodes down unless they are empty.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/spot/apis/spot-by-flexera-api.md) · [All operations](https://skmtc.net/spot/apis/spot-by-flexera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spot/spot-by-flexera-api/revisions/72813baf8d47/schema)
