Creating a Cluster

You can create managed Kubernetes clusters for the deployment of your containerized applications. OKS enables you to start Kubernetes clusters with a predefined configuration and pre-installed essential services, so that you do not have to manage unnecessary deployments.

Creating a Cluster Using OKS CLI

Before you begin:

To create a cluster, use the cluster create command following this syntax:

Request sample: Creating a single Subregion cluster
$ oks-cli cluster create \
    --cluster-name NAME_OF_CLUSTER \
    --project-name NAME_OF_PROJECT \
    --admin "1.2.3.4/32,5.6.7.8/32" \
    --version VERSION_NUMBER \
    --control-plane "cp.3.masters.small" \
    --zone 2b
Request sample: Creating a multi-Subregion cluster
$ oks-cli cluster create \
    --cluster-name NAME_OF_CLUSTER \
    --project-name NAME_OF_PROJECT \
    --admin "1.2.3.4/32,5.6.7.8/32" \
    --version VERSION_NUMBER \
    --control-plane "cp.3.masters.small" \
    --cp-multi-az

This command contains the following options that you need to specify:

  • cluster-name: The name of the cluster, with a maximum length of 40 alphanumeric characters and dashes (-). This name must start with a lowercase letter and must not end with a dash. It must be unique within the project.

  • (optional) description: The description of the cluster you want to create.

  • (optional) project-name: The name of the project in which you want to create the cluster.

  • admin: The IPs to be whitelisted, in CIDR notation and separated by commas. This range of one or multiple IPs is empty by default, and should be specified in order to manage the cluster after creation.

  • (optional) cidr-pods: The /16 CIDR to be used internally for pods. The project’s CIDR, the pods' CIDRs and the services' CIDR’s should not overlap.

  • (optional) cidr-service: The /16 CIDR to be used internally for services. The project’s CIDR, the pods' CIDRs and the services' CIDR’s should not overlap.

  • (optional) control-plane: The desired control plane sizing. For more information, see Control Planes.

  • (optional) cp-multi-az: Enables the multi-Subregion control plane option, to create a multi-Subregion cluster.

    • When using this option, the control plane is deployed on three different Subregions to provide high availability.

    • Only high availability control planes can be deployed in a multi-Subregion cluster.

  • (optional) enable-admission-plugins: The list of additional admission plugins you want to enable on the cluster. For more information about the admissions plugins, see the Kubernetes documentation.

  • (optional) disable-admission-plugins: The list of admission plugins from the default list that you want to disable.

  • (optional) disable-api-termination: The ability to delete the cluster through the API. If true, cluster deletion is disabled. If false, it is enabled.

  • (optional) dryrun: Provides an overview of the operations performed by the command without actually running it. You can use this as a safety measure to review the impact of a command before executing it.

  • (optional) filename: The name of the definition file that you want to create the cluster from.

  • (optional) output: The output format for the response (json | yaml). By default, the response format is JSON. The file generated with the cluster definition can be edited and applied by using the -f --filename …​ command.

  • (optional) quirk: Advanced keys and parameters to pass to the control panel of the project. This option is required for feature requests.

  • (optional) tags: The tags that you want to apply to cluster nodes.

  • (optional) version: One of the supported versions of Kubernetes. For more information about the supported versions, see About OKS > Kubernetes Versions Support.

  • (optional) zone: The Subregion in which you want to deploy the cluster’s control plane.

You can display all the available options using the cluster create command following this syntax:

$ oks-cli cluster create --help

You can use the cluster list command to check the cluster’s status. Your cluster is created when its status changes from deploying to ready.

Related Pages

Corresponding API Method