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 have been created:
Figure 2.7 – Create the deployment
Check the pods
status to verify whether the application has been deployed and is running:
kubectl get pods
The following command execution output indicates that Pods have been created and in the Running
status:
Figure 2.8 – Check the status of the deployment
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 \ ...