Create a Cluster on OCI
Learn how to create a Kubernetes cluster on OCI.
When you create a cluster using the oci
provider, the following
occurs:
-
The CLI detects if a bootstrap cluster is available. If not, it starts an ephemeral cluster to act as a bootstrap cluster.
-
Any resources required to start the ephemeral cluster are fetched and installed.
-
When the bootstrap cluster is available, the configured OCI compartment is checked for compatible compute Oracle Container Host for Kubernetes (OCK) images. If no OCK images are available, they're generated, uploaded to an OCI Object Storage bucket, and imported into the bootstrap cluster. The OCK image is converted from Qcow2 format to a bootable compute image and saved as a custom compute image.
-
When this process is complete, all Kubernetes Cluster API providers are installed into the bootstrap cluster.
-
When the Kubernetes Cluster API providers are started, the Kubernetes Cluster API resources are installed into the bootstrap cluster.
-
When the bootstrap cluster is ready, the OCI cluster is created and set up, including the compute instances, networking, and a network load balancer.
-
If the OCI cluster is set to be self managed, the bootstrap cluster is deleted.
Creating an OCI Cluster
Create a Kubernetes cluster on OCI using the
oci
provider.
Creating a Kubernetes cluster on OCI using the
oci
provider requires that you first set up the localhost to create a
bootstrap cluster using the libvirt
provider, or have a cluster available
to use as the bootstrap cluster. For information on the bootstrap cluster, see OCI Provider.
You must also install and configure the OCI CLI on the localhost to enable access to the OCI compartment where the cluster is created.
You can optionally use a cluster configuration file to specify cluster information such as
the number of control plane and worker nodes, the cluster definition file that contains the
Cluster API CRs, the Object Storage bucket name (if the default of
ocne-images
isn't used), or any other number of configuration options.
If settings aren't provided in the cluster configuration file options, but are available in the Cluster API provider, create a cluster template file that contains the CRs for the cluster. You can then manually edit these CRs with the Cluster API options and include the template in the cluster configuration file.
Important:
The number of control plane nodes must be an odd number (1, 3, 5, and so on) to avoid split brain scenarios with High Availability. The default is 1 control plane node and 0 worker nodes.
Monitoring a Cluster Installation
View the logs for the Kubernetes Cluster API pods to monitor the creation of a Kubernetes cluster on OCI.
You can monitor the deployment of a Kubernetes cluster on OCI by reviewing the logs of several Kubernetes Cluster API pods that are created in the ephemeral (bootstrap) cluster.
Tip:
If you set the cluster to be self managed, the ephemeral cluster is deleted after
the deployment succeeds. To view the logs after the ephemeral cluster is
deleted, set the cluster's kubeconfig
file to the cluster
running on OCI, for example:
export KUBECONFIG=$HOME/.kube/kubeconfig.clustername