November 2017
Intermediate to advanced
388 pages
8h 46m
English
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=80deployment "webapp" created
This command is basically running an nginx image, whose deployment name is webapp with two replicas, means two pods will be created. The container is running itself on port 80.
To see running pods in a cluster, run the following command:
$ kubectl get deploy,podsNAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGEdeploy/webapp 2 2 2 2 34sNAME READY STATUS RESTARTS AGEpo/webapp-4079742498-ggxq6 1/1 Running 0 33spo/webapp-4079742498-hl329 1/1 Running 0 33s ...
Read now
Unlock full access