TKG Series-Part 4: Deploy Sample Workload/Application

In last post I completed the workload cluster deployment. The deployed cluster is now ready to be consumed. In this post I will show how we can deploy a sample application/workload in the newly provisioned kubernetes cluster.

If you have missed earlier post of this series, you can read them from below links:

1: TKG Infrastructure Setup

2: TKG Management Cluster Deployment

3: TKG Workload Cluster Deployment

To deploy any application in the kubernetes cluster, we first have to connect to the workload cluster context.

Below command shows that I am currently connected to cluster “mj-tkgc01”, which is my workload cluster.

Note: We can use command kubectl config use-context <cluster-context-name> to switch between the clusters.

Deploy Sample Nginx Web Server

In my environment I have deployed nginx web server using below command

kubectl get all command can be used to verify status of deployed application.

Create Service for Nginx

Verify Service Details

When we create a service for an application, kubernetes assigns a system generated port for the service. 

Since no external ip address is configured for nginx, it can be accessed by connecting to any of the worker node IP on port 31693

MJ-TKG-Lab05

And that’s it for this post. In next post I will cover how to scale up/scale down application running inside kubernetes cluster.

I hope you enjoyed reading the post. Feel free to share this on social media if it is worth sharing 🙂

Leave a Reply