OpenMCF logoOpenMCF

Loading...

OCI Container Engine Cluster

Deploys an Oracle Cloud Infrastructure Container Engine for Kubernetes (OKE) cluster — a managed Kubernetes control plane with API server, etcd, scheduler, and controller manager. Supports basic and enhanced cluster types, VCN-native and flannel overlay CNI for pod networking, private or public API endpoints, OIDC authentication, KMS secrets encryption, and container image signature verification. Worker nodes are managed separately via OciContainerEngineNodePool.

What Gets Created

When you deploy an OciContainerEngineCluster resource, OpenMCF provisions:

  • OKE Cluster — an oci_containerengine_cluster resource in the specified compartment and VCN. The cluster runs a managed Kubernetes control plane at the requested version. Standard OpenMCF freeform tags are applied for resource tracking.

Prerequisites

  • OCI credentials configured via environment variables or OpenMCF provider config (API Key, Instance Principal, Security Token, Resource Principal, or OKE Workload Identity)
  • A compartment OCID where the cluster will be created — literal value or reference to an OciCompartment resource
  • A VCN OCID where the cluster will be deployed — literal value or reference to an OciVcn resource
  • A Kubernetes version string supported by OKE (e.g., v1.28.2) — run oci ce cluster-options list to see available versions
  • A subnet OCID for the API server endpoint if configuring endpointConfig — literal value or reference to an OciSubnet resource

Quick Start

Create a file cluster.yaml:

apiVersion: oci.openmcf.org/v1
kind: OciContainerEngineCluster
metadata:
  name: my-cluster
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.OciContainerEngineCluster.my-cluster
spec:
  compartmentId:
    value: "ocid1.compartment.oc1..example"
  vcnId:
    value: "ocid1.vcn.oc1.iad.example"
  kubernetesVersion: "v1.28.2"

Deploy:

openmcf apply -f cluster.yaml

This creates a basic OKE cluster with the default flannel overlay CNI in the specified VCN. OKE provisions the control plane with an API server, etcd, scheduler, and controller manager. The cluster ID, Kubernetes version, and API endpoint URLs are exported as stack outputs. Add OciContainerEngineNodePool resources to create worker nodes.

Configuration Reference

Required Fields

FieldTypeDescriptionValidation
compartmentIdStringValueOrRefOCID of the compartment where the cluster will be created. Changing this after creation forces cluster recreation. Can reference an OciCompartment resource via valueFrom.Required
vcnIdStringValueOrRefOCID of the VCN where the cluster will be deployed. Changing this after creation forces cluster recreation. Can reference an OciVcn resource via valueFrom.Required
kubernetesVersionstringKubernetes version to install on the control plane (e.g., v1.28.2). Use oci ce cluster-options list to see available versions.Minimum 1 character

Optional Fields

FieldTypeDefaultDescription
namestringmetadata.nameHuman-readable name shown in the OCI Console.
typeenumunspecified (OCI default)Cluster type. Values: basic_cluster (standard features), enhanced_cluster (virtual node pools, workload identity, cluster add-on management). Upgrading from basic to enhanced is one-way.
cniTypeenumcni_unspecified (OCI default)Container Network Interface plugin. Values: flannel_overlay (overlay network, simpler), oci_vcn_ip_native (pods get VCN IPs, enables network policies and NSGs on pods). Changing this after creation forces cluster recreation.
endpointConfigEndpointConfig—Network configuration for the Kubernetes API server endpoint. See endpointConfig fields.
optionsClusterOptions—Networking, service load balancer, persistent volume, and OIDC configuration. See options fields.
kmsKeyIdStringValueOrRef—OCID of a KMS key to encrypt Kubernetes secrets at rest. Requires kubernetesVersion >= v1.13.0. Changing this after creation forces cluster recreation.
imagePolicyConfigImagePolicyConfig—Container image signature verification policy. See imagePolicyConfig fields.

endpointConfig Fields

FieldTypeDescriptionValidation
subnetIdStringValueOrRefOCID of the regional subnet hosting the Kubernetes API server endpoint. Changing this after creation forces cluster recreation. Can reference an OciSubnet resource via valueFrom.Required
isPublicIpEnabledboolWhether to assign a public IP to the API server endpoint. Set to false for private clusters. Must be false when the subnet is private. When unset, uses the OCI default.Optional
nsgIdsStringValueOrRef[]OCIDs of network security groups applied to the API server endpoint. Can reference OciSecurityGroup resources via valueFrom.Optional

options Fields

FieldTypeDefaultDescription
kubernetesNetworkConfigKubernetesNetworkConfig—Pod and service CIDR configuration. Changing this after creation forces cluster recreation. See kubernetesNetworkConfig fields.
serviceLbSubnetIdsStringValueOrRef[]—OCIDs of subnets where Kubernetes Service load balancers will be placed. Typically one or two public subnets. Changing this after creation forces cluster recreation. Can reference OciSubnet resources via valueFrom.
ipFamiliesIpFamily[][ipv4]IP address families for the cluster. Values: ipv4, ipv6. Use [ipv4] for IPv4-only or [ipv4, ipv6] for dual-stack. Changing this after creation forces cluster recreation.
serviceLbConfigServiceLbConfig—Default configuration applied to load balancers created by Kubernetes Service resources. See serviceLbConfig fields.
persistentVolumeConfigPersistentVolumeConfig—Default tags applied to block volumes created by Kubernetes PersistentVolumeClaim resources. See persistentVolumeConfig fields.
openIdConnectTokenAuthenticationConfigOpenIdConnectTokenAuthenticationConfig—OIDC token authentication for the API server. See openIdConnectTokenAuthenticationConfig fields.
isOpenIdConnectDiscoveryEnabledboolfalseWhen true, enables the cluster-specific OIDC Discovery endpoint, allowing external systems to discover the cluster's public signing keys.

kubernetesNetworkConfig Fields

FieldTypeDefaultDescription
podsCidrstring10.244.0.0/16 (IPv4), fd00:eeee:eeee:0000::/96 (IPv6)CIDR block for Kubernetes pods. Must not overlap with the VCN CIDR or the services CIDR.
servicesCidrstring10.96.0.0/16 (IPv4), fd00:eeee:eeee:0001::/108 (IPv6)CIDR block for Kubernetes services (ClusterIP range). Must not overlap with the VCN CIDR or the pods CIDR.

serviceLbConfig Fields

FieldTypeDescription
backendNsgIdsStringValueOrRef[]OCIDs of NSGs applied to service load balancer backends. Can reference OciSecurityGroup resources via valueFrom.
freeformTagsmap<string, string>Freeform tags applied to service load balancers created by Kubernetes.
definedTagsmap<string, string>Defined tags applied to service load balancers. Keys use the format namespace.key (e.g., Operations.CostCenter).

persistentVolumeConfig Fields

FieldTypeDescription
freeformTagsmap<string, string>Freeform tags applied to block volumes created by Kubernetes PersistentVolumeClaim resources.
definedTagsmap<string, string>Defined tags applied to persistent volumes. Keys use the format namespace.key (e.g., Operations.CostCenter).

openIdConnectTokenAuthenticationConfig Fields

Two configuration modes are supported: inline (set individual fields) and configuration file (set configurationFile with a base64-encoded Kubernetes OIDC Auth Config). These modes are mutually exclusive.

FieldTypeDescription
isOpenIdConnectAuthEnabledboolWhether OIDC token authentication is enabled.
configurationFilestringBase64-encoded Kubernetes OIDC Auth Config file. Mutually exclusive with the inline fields below.
issuerUrlstringURL of the OIDC identity provider. Must use https://. The API server uses this to discover signing keys.
clientIdstringClient ID that all tokens must be issued for.
caCertificatestringBase64-encoded public RSA or ECDSA certificate of the identity provider.
usernameClaimstringJWT claim to use as the Kubernetes username. Default: sub.
usernamePrefixstringPrefix prepended to username claims to prevent collisions with existing names (e.g., oidc:).
groupsClaimstringJWT claim to use as the user's group. Must be an array of strings in the token.
groupsPrefixstringPrefix prepended to group claims.
signingAlgorithmsstring[]Accepted signing algorithms for tokens. Default: ["RS256"].
requiredClaimsRequiredClaim[]Key-value pairs that must be present in the ID token. Each entry has key and value fields. If any required claim is missing or has a different value, authentication is rejected.

imagePolicyConfig Fields

FieldTypeDescription
isPolicyEnabledboolWhether the image verification policy is enabled.
keyDetailsImagePolicyKeyDetail[]KMS keys used for image signature verification. Each entry has a kmsKeyId field (StringValueOrRef) — the OCID of the KMS key used to verify image signatures.

Examples

Minimal Basic Cluster

A basic OKE cluster with only the required fields — the simplest path to a running Kubernetes control plane:

apiVersion: oci.openmcf.org/v1
kind: OciContainerEngineCluster
metadata:
  name: dev-cluster
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.OciContainerEngineCluster.dev-cluster
spec:
  compartmentId:
    value: "ocid1.compartment.oc1..example"
  vcnId:
    value: "ocid1.vcn.oc1.iad.example"
  kubernetesVersion: "v1.28.2"

Production Private Cluster with VCN-Native CNI

An enhanced cluster with VCN-native pod networking, a private API endpoint protected by NSGs, dedicated service load balancer subnets, and custom pod/service CIDRs. All infrastructure references use valueFrom for declarative composition:

apiVersion: oci.openmcf.org/v1
kind: OciContainerEngineCluster
metadata:
  name: prod-cluster
  org: acme
  env: prod
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: acme
    pulumi.openmcf.org/project: oke-platform
    pulumi.openmcf.org/stack.name: prod.OciContainerEngineCluster.prod-cluster
spec:
  compartmentId:
    valueFrom:
      kind: OciCompartment
      name: prod-compartment
      fieldPath: status.outputs.compartmentId
  vcnId:
    valueFrom:
      kind: OciVcn
      name: prod-vcn
      fieldPath: status.outputs.vcnId
  kubernetesVersion: "v1.28.2"
  type: enhanced_cluster
  cniType: oci_vcn_ip_native
  endpointConfig:
    subnetId:
      valueFrom:
        kind: OciSubnet
        name: api-endpoint-subnet
        fieldPath: status.outputs.subnetId
    isPublicIpEnabled: false
    nsgIds:
      - valueFrom:
          kind: OciSecurityGroup
          name: api-endpoint-nsg
          fieldPath: status.outputs.networkSecurityGroupId
  options:
    kubernetesNetworkConfig:
      podsCidr: "10.244.0.0/16"
      servicesCidr: "10.96.0.0/16"
    serviceLbSubnetIds:
      - valueFrom:
          kind: OciSubnet
          name: lb-subnet
          fieldPath: status.outputs.subnetId
    serviceLbConfig:
      backendNsgIds:
        - valueFrom:
            kind: OciSecurityGroup
            name: worker-nsg
            fieldPath: status.outputs.networkSecurityGroupId

Enhanced Cluster with OIDC Authentication

An enhanced cluster integrated with an external OIDC identity provider for kubectl and API access. Inline OIDC fields configure the issuer, client, and claim mappings directly:

apiVersion: oci.openmcf.org/v1
kind: OciContainerEngineCluster
metadata:
  name: sso-cluster
  org: acme
  env: prod
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: acme
    pulumi.openmcf.org/project: oke-platform
    pulumi.openmcf.org/stack.name: prod.OciContainerEngineCluster.sso-cluster
spec:
  compartmentId:
    value: "ocid1.compartment.oc1..example"
  vcnId:
    value: "ocid1.vcn.oc1.iad.example"
  kubernetesVersion: "v1.28.2"
  type: enhanced_cluster
  cniType: oci_vcn_ip_native
  endpointConfig:
    subnetId:
      value: "ocid1.subnet.oc1.iad.example"
    isPublicIpEnabled: false
  options:
    openIdConnectTokenAuthenticationConfig:
      isOpenIdConnectAuthEnabled: true
      issuerUrl: "https://idp.example.com"
      clientId: "oke-cluster-client"
      usernameClaim: "email"
      usernamePrefix: "oidc:"
      groupsClaim: "groups"
      groupsPrefix: "oidc:"
      signingAlgorithms:
        - "RS256"
      requiredClaims:
        - key: "aud"
          value: "oke-cluster-client"
    isOpenIdConnectDiscoveryEnabled: true

KMS-Encrypted Cluster with Image Policy

A cluster with KMS-encrypted Kubernetes secrets and container image signature verification — all images deployed to the cluster must be signed with an approved KMS key:

apiVersion: oci.openmcf.org/v1
kind: OciContainerEngineCluster
metadata:
  name: secure-cluster
  org: acme
  env: prod
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: acme
    pulumi.openmcf.org/project: oke-platform
    pulumi.openmcf.org/stack.name: prod.OciContainerEngineCluster.secure-cluster
spec:
  compartmentId:
    value: "ocid1.compartment.oc1..example"
  vcnId:
    value: "ocid1.vcn.oc1.iad.example"
  kubernetesVersion: "v1.28.2"
  type: enhanced_cluster
  kmsKeyId:
    value: "ocid1.key.oc1.iad.example"
  imagePolicyConfig:
    isPolicyEnabled: true
    keyDetails:
      - kmsKeyId:
          value: "ocid1.key.oc1.iad.examplesigningkey1"
      - kmsKeyId:
          value: "ocid1.key.oc1.iad.examplesigningkey2"
  endpointConfig:
    subnetId:
      value: "ocid1.subnet.oc1.iad.example"
    isPublicIpEnabled: false

Stack Outputs

After deployment, the following outputs are available in status.outputs:

OutputTypeDescription
cluster_idstringOCID of the OKE cluster.
kubernetes_versionstringKubernetes version running on the cluster control plane.
kubernetes_endpointstringKubernetes API server endpoint URL (non-native networking).
private_endpointstringPrivate native networking Kubernetes API server endpoint URL.
public_endpointstringPublic native networking Kubernetes API server endpoint URL. Empty when the cluster endpoint is private-only.

Related Components

  • OciCompartment — provides the compartment referenced by compartmentId via valueFrom
  • OciVcn — provides the VCN referenced by vcnId via valueFrom
  • OciSubnet — provides subnets for the API endpoint (endpointConfig.subnetId) and service load balancers (options.serviceLbSubnetIds) via valueFrom
  • OciSecurityGroup — manages network security rules for the API endpoint (endpointConfig.nsgIds) and service load balancer backends (options.serviceLbConfig.backendNsgIds) via valueFrom
  • OciContainerEngineNodePool — creates worker nodes for this cluster using the cluster_id output

Next article

OCI Container Engine Node Pool

OCI Container Engine Node Pool Deploys an Oracle Cloud Infrastructure Container Engine for Kubernetes (OKE) node pool — a managed set of worker nodes attached to an OKE cluster. Supports flex and fixed compute shapes, placement across multiple availability domains and fault domains, preemptible (spot) instances, VCN-native pod networking with per-pod NSGs, boot volume encryption via KMS, and rolling upgrade strategies. Worker nodes are managed independently of the cluster control plane, which...
Read next article
Presets
3 ready-to-deploy configurationsView presets →