Deploy Nginx Web Server to Kubernetes

In this article, I will show you how I deploy Nginx web server to Kubernetes on Docker for Windows with to simple commands.

The process below involved two steps, the first step will deploy a Nginx container into my Kubernetes cluster with port 80 open.

The second step will expose, the container on port 80 and make it available for external access.

It is important to note that by default Kubernetes doesn’t allow external access to containers without running the Expose command.

Get started

To get started, I will first run the run command and create a deployment with Nginx and allow port 80.

kubectl run --image=nginx nginx-app --port=80 --env="DOMAIN=cluster"

Once my command has run, I will expose port 80 and make port 80 available for external access on my network.

kubectl expose deployment nginx-app --type=LoadBalancer --name=nginx-app

Below, you can see that my Nginx container is up and running and available for access.

About Kubernetes

Kubernetes is an open-source system for automating deployment, scaling and management of containerized applications that was originally designed by Google and donated to the Cloud Native Computing Foundation.

This article was first published on DeployContainers.com


Posted

in

by