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 kubectl tool
- Deploy a WebLogic application
Prerequisites:
- A free tire 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, Quick Create pane is pre-selected. Keep the default selection and click Submit. Quick Create option will create network resources required for OKE deployment (VCN, IG, NAT, SGW).
4. On the Create Cluster (quick) window, name cluster and select compartment & Kubernetes version.
- Kubernetes API endpoint: select 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 compute instances in your tenancy.
- Kubernetes worker nodes: select 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 Actions menu.
2. Make sure the Cloud Shell Access is selected. Click the Copy link from the command to access kubeconfig for the cluster. Then click Launch Cloud Shell.
3. Paste the copied command to 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: Setup WebLogic Domain and Demo Application on OKE
1. Download WebLogic Domain and Application demo zip file to the home directory in the Cloud Shell using below command.
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 of the services created.
The namespace of the WebLogic Server services in this workshop is sample-domain1-ns.
From the command output from the 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 !!!
















