Deploying a sample application on Kubernetes
Once we have a running K8s cluster, we can run our containerized application. To do so, we can either use a command-line option or we have to create deployment configuration file, where we mention all the details to create the application instance or how to update the instance. First, we will deploy the application using the command line; later, we will use the deployment configuration file to deploy the application.
Getting ready
Basically, there are two things that concern us, one is deployment of application on the K8s cluster and another is accessing the application. To deploy and expose the application, we will be using the kubectl
command.
How to do it...
To deploy a containerized application in the command line, run the following command:
Syntax: kubectl run <deployment name> --image=<repo/image> --replicas=<No of replicas> --port=<container port>
$ kubectl run webapp --image=nginx --replicas=2 --port=80 deployment "webapp...