|
| 1 | +# Managed Clusters (OKE) |
| 2 | +- **Feature status:** Experimental |
| 3 | +- **Feature gate:** OKE=true,MachinePool=true |
| 4 | + |
| 5 | +Cluster API Provider for OCI (CAPOCI) experimentally supports managing OCI Container |
| 6 | +Engine for Kubernetes (OKE) clusters. CAPOCI implements this with three |
| 7 | +custom resources: |
| 8 | +- `OCIManagedControlPlane` |
| 9 | +- `OCIManagedCluster` |
| 10 | +- `OCIManagedMachinePool` |
| 11 | + |
| 12 | +## Workload Cluster Parameters |
| 13 | + |
| 14 | +The following Oracle Cloud Infrastructure (OCI) configuration parameters are available |
| 15 | +when creating a managed workload cluster on OCI using one of our predefined templates: |
| 16 | + |
| 17 | +| Parameter | Default Value | Description | |
| 18 | +|---------------------------------------|---------------------|------------------------------------------------------------------------------------------------------------------------| |
| 19 | +| `OCI_COMPARTMENT_ID` | | The OCID of the compartment in which to create the required compute, storage and network resources. | |
| 20 | +| `OCI_MANAGED_NODE_IMAGE_ID` | | The OCID of the image for the Kubernetes worker nodes. Please read the [doc][node-images] for more details. | |
| 21 | +| `OCI_MANAGED_NODE_SHAPE ` | VM.Standard.E4.Flex | The [shape][node-images-shapes] of the Kubernetes worker nodes. | |
| 22 | +| `OCI_MANAGED_NODE_MACHINE_TYPE_OCPUS` | 1 | The number of OCPUs allocated to the worker node instance. | |
| 23 | +| `OCI_SSH_KEY` | | The public SSH key to be added to the Kubernetes nodes. It can be used to login to the node and troubleshoot failures. | |
| 24 | + |
| 25 | +## Pre-Requisites |
| 26 | + |
| 27 | +### Environment Variables |
| 28 | + |
| 29 | +Managed clusters also require the following feature flags set as environment variables before [installing |
| 30 | +CAPI and CAPOCI components using clusterctl][install-cluster-api]. |
| 31 | + |
| 32 | +```bash |
| 33 | +export EXP_MACHINE_POOL=true |
| 34 | +export EXP_OKE=true |
| 35 | +``` |
| 36 | + |
| 37 | +### OCI Security Policies |
| 38 | + |
| 39 | +Please read the [doc][oke-policies] and add the necessary policies required for the user group. |
| 40 | +Please add the policies for dynamic groups if instance principal is being used as authentication |
| 41 | +mechanism. Please read the [doc][install-cluster-api] to know more about authentication mechanisms. |
| 42 | + |
| 43 | +## Workload Cluster Templates |
| 44 | + |
| 45 | +Choose one of the available templates to create your workload clusters from the |
| 46 | +[latest released artifacts][latest-release]. The managed cluster templates is of the |
| 47 | +form `cluster-template-managed-<flavour>`.yaml . The default managed template is |
| 48 | +`cluster-template-managed.yaml`. Please note that the templates provided are to be considered |
| 49 | +as references and can be customized further as the [CAPOCI API Reference][api-reference]. |
| 50 | + |
| 51 | +## Supported Kubernetes versions |
| 52 | +The [doc][supported-versions] lists the Kubernetes versions currently supported by OKE. |
| 53 | + |
| 54 | +## Create a new OKE cluster. |
| 55 | + |
| 56 | +The following command will create an OKE cluster using the default template. The created node pool uses |
| 57 | +[VCN native pod networking][vcn-native-pod-networking]. |
| 58 | + |
| 59 | +```bash |
| 60 | +OCI_COMPARTMENT_ID=<compartment-id> \ |
| 61 | +OCI_MANAGED_NODE_IMAGE_ID=<ubuntu-custom-image-id> \ |
| 62 | +OCI_SSH_KEY=<ssh-key> \ |
| 63 | +KUBERNETES_VERSION=v1.24.1 \ |
| 64 | +NAMESPACE=default \ |
| 65 | +clusterctl generate cluster <cluster-name>\ |
| 66 | +--from cluster-template-managed.yaml | kubectl apply -f - |
| 67 | +``` |
| 68 | + |
| 69 | +## Create a new private OKE cluster. |
| 70 | + |
| 71 | +The following command will create an OKE private cluster. In this template, the control plane endpoint subnet is a |
| 72 | +private subnet and the API endpoint is accessible only within the subnet. The created node pool uses |
| 73 | +[VCN native pod networking][vcn-native-pod-networking]. |
| 74 | + |
| 75 | +```bash |
| 76 | +OCI_COMPARTMENT_ID=<compartment-id> \ |
| 77 | +OCI_MANAGED_NODE_IMAGE_ID=<ubuntu-custom-image-id> \ |
| 78 | +OCI_SSH_KEY=<ssh-key> \ |
| 79 | +KUBERNETES_VERSION=v1.24.1 \ |
| 80 | +NAMESPACE=default \ |
| 81 | +clusterctl generate cluster <cluster-name>\ |
| 82 | +--from cluster-template-managedprivate.yaml | kubectl apply -f - |
| 83 | +``` |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +[node-images-shapes]: https://docs.oracle.com/en-us/iaas/Content/ContEng/Reference/contengimagesshapes.htm |
| 88 | +[oke-policies]: https://docs.oracle.com/en-us/iaas/Content/ContEng/Concepts/contengpolicyconfig.htm |
| 89 | +[install-cluster-api]: ../gs/install-cluster-api.md |
| 90 | +[latest-release]: https://github.com/oracle/cluster-api-provider-oci/releases/latest |
| 91 | +[api-reference]: ../reference/api-reference.md |
| 92 | +[supported-versions]: https://docs.oracle.com/en-us/iaas/Content/ContEng/Concepts/contengaboutk8sversions.htm#supportedk8sversions |
| 93 | +[vcn-native-pod-networking]: https://docs.oracle.com/en-us/iaas/Content/ContEng/Concepts/contengpodnetworking_topic-OCI_CNI_plugin.htm |
0 commit comments