Deploying NGINX on Kubernetes using the Bitnami Helm Chart simplifies the deployment of the popular web server on a Kubernetes cluster. The Bitnami NGINX Helm Chart includes a single replica deployment of NGINX and a service to expose it to other Kubernetes resources. By using the Bitnami Helm Chart, you don't need to worry about configuring NGINX from scratch, and you can take advantage of the additional features and security patches provided by Bitnami. After installing the Helm chart, you can create Kubernetes ingress resources to route traffic to your services and take advantage of NGINX's capabilities as a reverse proxy and load balancer. Overall, using the Bitnami Helm Chart can help you deploy NGINX on Kubernetes more quickly and with less configuration.
In this tutorial, I'll show you how to deploy the NGINX helm chart on Kubernetes using a CD tool.
Prerequisites
- Free Harness cloud account (on-premise)
- A Kubernetes cluster access to deploy our Helm chart. You can use Minikube or Kind for a cluster access.
- Docker installed. Preferably Docker Desktop.
Tutorial
To deploy the Bitnami NGINX Helm chart, you need a continuous delivery platform, and we are making use of a best-in-class tool, Harness.
Signup to Harness and login to your account.
Add details for the project, name it as per your wish.
Invite collaborators if you want to your CD project.
Select the Continuous Delivery module for the project.
Start your CD journey from here
Select your deployment type and click on other deployment types. [We are focused on Helm deployment]
Start creating a pipeline for your project.
Select the deployment type as Native Helm
Create a service for the project
Add manifest details, select Helm Chart
Create a new HTTP Helm Repo Connector
Add the Helm repo connector details
Connect the Helm repo with the Harness Delegate.
So, what is Harness Delegate?
A Delegate is a service that runs on your infrastructure to execute tasks on behalf of the Harness platform.
Now, you need to install this Harness Delegate on your Kubernetes cluster.
Make sure you have a cluster access from any cloud provider.
Nothing to worry about if you don't have access to any cluster access. We will make use of Minikube.
Install Minikube on your local machine by following this link.
Once the installation is complete, start the Minikube cluster with the following command.
minikube start
You should see a successful output as shown below,
It is time to install our Harness Delegate
Run the commands as shown in the installation process
Once done, verify if the Delegate has been installed successfully.
Let's go back to the steps where we stopped previously (before installing the Harness Delegate).
Now you should see the Delegate we just installed. Select the same and continue.
You should see a successful connection between the helm repo and our Delegate.
Next, add the manifest details as shown
You should see the manifest details we added
You should see the service added; click continue.
Add new environment as pre-prod
Similarly, add a new infrastructure
Under cluster details, select the connector and add the cluster details.
Let's connect our infrastructure with our Delegate.
Make sure the connection is successful
You should see the cluster details and connector in the infrastructure
You should see the infrastructure we just added.
Click continue and you will go to the execution step where we should select the deployment type. We will select 'Rolling'.
Finally, this is how our Helm chart deployment looks like.
You should see a successful execution of all the steps.
Let's get to the console view for more clarity.
Let's verify if the NGINX deployment is done properly using the command
kubectl get deployment
You should see the following output
Let's expose the deployed NGINX to the outside world and see if we can access it.
As you can see, the external IP is pending.
We can expose the external IP using the below minikube command
minikube tunnel
You should see the following output
Now, open a new terminal window and run the following command
kubectl get service
You should see the external IP now.
We can access the NGINX using the externalip:port
Congratulations! We successfully deployed an NGINX helm chart on Kubernetes using Harness CD module.
This way, you can easily deploy any of the Helm charts listed here on Kubernetes using the Harness Continuous Delivery module.