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 essentials 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
$ oks-cli cluster create \
--project-name NAME_OF_PROJECT \
--cluster-name NAME_OF_CLUSTER \
--admin "1.2.3.4/32,5.6.7.8/32" \
--control-plane "cp.mono.master" \
--version VERSION_NUMBER

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 not start or end with a dash, and it must be unique within the project.

  • (optional) project-name: The name of the project where the cluster will be created.

  • admin: The CIDRs to be whitelisted, 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) version: One of the supported versions of Kubernetes. For more information about the supported versions, see About OKS.

  • (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 About OKS.

  • (optional) zone: The zone in which the cluster will be started. You can specify one or more zones in order to have a mono-Subregion or multi-Subregion cluster.

    Currently, the High Availability control planes must be deployed in a mono-Subregion cluster (zonal mode). The multi-Subregion (regional) mode will be implemented soon.

  • (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) quirk: The keys and parameters to pass to the cluster. This option is required for feature requests.

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

  • (optional) dry-run: Enables the process to simulate the command and preview requirements.

  • (optional) output: The name of the YAML or JSON file you want to generate with the cluster definition. This file can be edited and applied by using the -f --filename …​ command.

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

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