Deploying a sample application
We are going to deploy the nginx
web server sample application. It is software that responds to client requests via HTTP (Hypertext Transfer Protocol). The following command will deploy the nginx
web application:
kubectl create deployment nginx --image=nginx
The following command execution output indicates that there is no error in the deployment, and in the next steps, we can verify whether the Pods are created:
Check the pods
status to verify whether the application has been deployed and running:
kubectl get pods
The following command execution output indicates that Pods are created and in the Running
status:
The nginx
application has been deployed successfully, so it can be exposed with the following command:
kubectl expose deployment nginx \
--port 80 \
--target-port 80 \
--type ClusterIP \
--selector=run=nginx \
--name nginx
The following command...