Oracle Container Engine for Kubernetes (OKE)— Lets get started

This article records my experience of running Oracle live lab — which is a good starting point of anyone’s cloud journey. The objective is to provision Oracle Container Engine for Kubernetes (OKE) service and deploy application on it.

The OKE is a managed service, which means you don’t need to worry about the maintenance activities and therefore focus more on the application. More information about OKE can be found here.

Here’s what we are gong to do.

  1. Provision OKE cluster
  2. Download application, prepare deployment and access
Figure 1: Plan

Step 1: Provision OKE Cluster

Login to Oracle console and navigate to Developer Services -> Containers & Artifacts -> Kubernetes Clusters (OKE). Once you click on the link it will take you to the provisioning page.

Figure 2: Finding OKE service on OCI Console

There you can see ‘Create Cluster’ button to start the provisioning. There we have two options, ‘quick create’ and ‘Customer create’. In this exercise we pick ‘Quick create’ as our intention to see the functionality of the application deployment. This option will create all the necessary resources required to run the OKE.

Figure 3: Provisioning Options

Next step is to provide the deployment details of the cluster. Our preference for this exercise are as follows;

  • API Endpoint: Public (can access API from public network)
  • Worker nodes : Private (Cluster instances are private and cannot access from public network)
  • Shape: VM.Standard.A1.Flex ( This is ARM based architecture)
  • Image : Oracle Linux 8
Figure 4: Details Page

Evaluate the details and click ‘Create cluster’ button to begin the process.

Figure 5: Review Page

Once the provisioning is completed, you can see the cluster home page as shown in Figure 6.

Figure 6: OKE Page

Now we need to configure access to the cluster. In order to get the necessary details, click on the ‘Access Cluster’ button on home page. As you can see from figure 7 there’re two options to access the cluster and for this exercise we choose access from shell.

Figure 7: Access Information

Cloud shell is access platform integrated into Oracle cloud and it comes with all basic installations and configuration to run cloud commands.

Figure 8: Cloud Shell

Copy the access information as shown on figure 7 and paste it to the cloud shell as below.

Figure 9: Creating Access

Now you have access to the OKE cluster created. In order to verify that lets run a command to get the node details.

Figure 10: Checking nodes

This concludes the provisioning part of OKE cluster.

Step 2: Download application and prepare deployment

We’ll download and deploy Apache tomcat — a popular Java web container. Download file will save on a private space provided by the cloud shell.

Figure 11: Download Tomcat

In this exercise we’ll mount the application as a ‘configmap’. However, this method should not be use in production environments and using here only for the convenience.

Figure 12: Creating configmap

Next we need to create ‘deployment manifest’ which describes the deployment details such as deployment label, service creation.etc. Oracle live labs suggested to create one ‘yaml’ file for the deployment and service creation. However, in my deployment it started giving unknown errors, so I split them into two files.

First file ‘deployment.yaml’ will do the deployment and second file ‘service.yaml’ will take care of creating the necessary services on OKE. Contents of the ‘deployment.yaml’ shown in figure 13.

Figure 13: Deployment.yaml

Deployment can be carried out as below (Figure 14). This will do the application deployment on Kubernetes cluster.

Figure 14: Deployment

Once that’s done we need to create services on OKE, so that users can access it. Figure 15 showing the yaml file which can assist on that.

Figure 15: Service.yaml

Once service.yaml file is created we can create the services as below.

Figure 16: Service Creation

That’s it ! Now we can verify the deployment and services created as below. As you can see there’s deployment called ‘tomcat’ and service created with the name of ‘tomcat’ again.

Figure 17: Verify Deployment

Finally we need to verify the application we just deployed. The OKE cluster can be accessed via load balancer which is created along with OKE. You can find the public IP of load balancer and verify the deployment as;

http://<your_loadbalancer_ip_address>/sample

Figure 18: Application Verification

In conclusion, this article discussed the provisioning of the OKE cluster and deploying simple application on it. This is a reproduction of Oracle live labs exercise.

References

https://apexapps.oracle.com/pls/apex/r/dbpm/livelabs/run-workshop?p210_wid=824&p210_wec=&session=21452910532126