Create OCI Kubernetes Cluster (OKE)

Anas Darkal Nov 20, 2025 6:51:53 PM

Introduction:

  • Oracle Cloud Infrastructure Kubernetes Engine (OKE) is a fully-managed, scalable, and highly available service for deploying containerized applications to the cloud.
  • With OKE, you can build, deploy, and manage cloud-native applications using open source Kubernetes that is certified as conformant by the Cloud Native Computing Foundation (CNCF).
  • OKE supports a range of deployment options. You can choose to run applications on virtual nodes for serverless operation, on managed nodes for shared responsibility between you and Oracle, or on self-managed nodes when you require advanced customization or specific compute resources, such as GPU or high-performance networking.
  • OKE supports multiple compute shapes, including bare metal and virtual machine types, and enables you to select the configuration that best fits your cost, performance, or hardware needs.
  • You manage clusters through the OCI Console, REST API, and CLI, and you can access Kubernetes clusters using standard Kubernetes tools such as kubectl, the Kubernetes Dashboard, and the Kubernetes API.
 
In this blog, I'll demonstrate the following:
  • Create OKE cluster 
  • Access the OKE in the Oracle Cloud shell using the kubectl tool
  • Deploy a WebLogic application 
 

Prerequisites: 

  • A free tier or paid Oracle Cloud account
  • OCI IAM Compartment
 

Task #1: Create OCI OKE Cluster

1. Open the navigation menu and select Developer Services > Kubernetes Clusters (OKE).
 

 
2. On the Kubernetes Clusters (OKE) window, select the right compartment, then click Create cluster.
 
 
3. On the Create Cluster page, the Quick Create pane is pre-selected. Keep the default selection and click Submit. The Quick Create option will create network resources required for OKE deployment (VCN, IG, NAT, SGW).
 
 
4. On the Create Cluster (quick) window, name the cluster and select the compartment & Kubernetes version.
  • Kubernetes API endpoint: select the Public endpoint pane. The Kubernetes cluster will be hosted on a public subnet with a public IP address auto-generated. 
  • Node type: select Managed pane. The Kubernetes nodes are provisioned as compute instances in your tenancy.
  • Kubernetes worker nodes: select the Private workers pane. The Kubernetes worker nodes will be hosted in a private subnet.
  • The number of nodes in the node pool: select 1
 







 
5. This will start to create a cluster, and takes 7 to 10 minutes to complete.
 
 
6. You can view the Kubernetes private nodes under Compute instances. It is only one VM instance in our workshop, as the OKE cluster was created with one worker node.
 
 

Task #2: Access the OKE in the Cloud shell

1. On the cluster details page, click Access Cluster from the Actions menu.
 
 
2. Make sure the Cloud Shell Access is selected. Click the Copy link from the command to access the kubeconfig for the cluster. Then click Launch Cloud Shell.
 
 
3. Paste the copied command into the command shell prompt. Then hit enter.
 
oci ce cluster create-kubeconfig \
--cluster-id ocid1.cluster.oc1.ca-toronto-1.aaaaaaaaih5bnpzon36xbckvstvx6ejb5zkgbqkbwmqxkwbumcbibec7ngpq \
--file $HOME/.kube/config --region ca-toronto-1 --token-version 2.0.0  \
--kube-endpoint PUBLIC_ENDPOINT
 


 
 

Task #3: Set up WebLogic Domain and Demo Application on OKE

1. Download the WebLogic Domain and Application demo zip file to the home directory in the Cloud Shell using the command below.
 
wget https://objectstorage.us-phoenix-1.oraclecloud.com/n/axfo51x8x2ap/b/apmocw-bucket-2022/o/wls-hol.zip
 
2. Unzip the file. This will create a directory wls-hol.
 
unzip ~/wls-hol.zip
 
3. Add executable permission to the shell script files in the folder by running the following command.
 
chmod +x ~/wls-hol/*.sh
 
4. Execute the command below to run a shell script from the wls-hol directory. This will create a WebLogic domain on the OKE in your tenancy. The process may take a few minutes to complete.
 
cd ~/wls-hol; ./deployWls.sh
 
Ensure that you see the message 'Cluster configuration complete!' and the URL to launch a demo application (http://<Public-IP>/opdemo/?dsname=testDatasource)
 
5.  Run the kubectl command below to display the information about the services created.
The namespace of the WebLogic Server services in this workshop is sample-domain1-ns.
 
From the command output from output above, locate the LoadBalancer service. Note down the External-IP.
 
kubectl get svc --all-namespaces
kubectl get pod -n sample-domain1-ns
 
 
 
6. On your computer, open a new browser tab and access the application with the following URL
 
http://<External IP of the Load Balancer>/opdemo/?dsname=testDatasource
 
That completes the workshop.
Thanks for reading !!!