4.2 Adding Kubernetes to an Environment

After you create the environment, you should add any modules you want in the deployment. A base deployment requires Kubernetes to be deployed to the environment. This is done by adding the kubernetes module to the environment.

You can see a list of the available modules for an environment using the olcnectl module list command. For example:

$ olcnectl --api-server 127.0.0.1:8091 module list --environment-name myenvironment

Use the olcnectl module create command to add modules to an environment. For example, to add the kubernetes module to the myenvironment environment, with one master and two worker nodes:

$ olcnectl --api-server 127.0.0.1:8091 module create --environment-name myenvironment \
  --module kubernetes --name mycluster \
  --container-registry container-registry.oracle.com/olcne \
  --apiserver-advertise-address 192.0.2.100 \
  --master-nodes master1.example.com:8090 \
  --worker-nodes worker1.example.com:8090,worker2.example.com:8090

The --apiserver-advertise-address option specifies the IP address of the interface on the master node to use when communicating with the worker nodes. This option makes sure that if there are multiple network interfaces on the master node, the one specified with this option is used.

The --container-registry option specifies the container registry from which to pull the Kubernetes images. This example uses the Oracle Container Registry, but you may also use a local registry, with the Kubernetes images mirrored from the Oracle Container Registry. For information on creating a local registry, see Section 2.2, “Accessing the Container Registry”.

If you do not include all the required options when adding the kubernetes module, you are prompted to provide them.

For the full list of the options available for the kubernetes module, see Section 5.1, “Platform CLI Syntax”.

For information on creating a multi-master highly available deployment, see Section 4.6, “Creating a Multi-Master (HA) Kubernetes Cluster”.