Skip to main content
Boost your DevOps efficiency! Dive into our latest white paper.Read Now

Tutorial: Deploying Nginx with Kapstan

This tutorial offers a practical, hands-on approach to deploying a docker Nginx image on your AWS EKS cluster using Kapstan. It will take you through each step required to deploy an Nginx image. Here are the list of steps we will follow:

  1. Login and create an organization
  2. Create an environment
  3. Deploy Nginx
  4. See It in Action

Login

  1. Log into your Kapstan account. Create an Organization or join in an existing one by an invite.

Environment Setup

Once connection creation is successful, we proceed with environment creation.

  1. You will be prompted to create an environment as a next step. Alternatively, click here to create a new environment. Read more about environments here.

  2. Provide the following information:

  • Environment Name: Give it a unique name; e.g. nginx-tutorial.
  • Environment Type: Choose desired type between Staging and Production environment.
  • Connection: Choose the cloud provider connection you've set up.
  • Region: Select the geographical region for your deployment.

Once you provide the above information, click on "Create" to create the new environment. An environment with a virtual network and kubernetes cluster will be setup.

Deploy Nginx

Create Application

  1. Navigate to the Applications on Kapstan.
  2. Open create application menu and select 'Container'.
  3. Fill in the following details:
  • Display Name: Provide a name for your custom application. e.g. nginx-app.
  • Cluster: Select the Kubernetes Cluster which you just created from the dropdown.
  1. Choose Public Repository in "Container registry" and fill nginx in the "Public repository URL".
  2. Select a desired image tag.
  3. Submit the form and the application will be created.

Deploy Container in your Application

  1. In the Application overview page click on the Unapplied changes if any and confirm the configurations.
  2. Select Deploy button to deploy the application.

See It in Action

  1. Install kubectl
  2. Install awscli
  3. Configure AWS Profile with AccessKeyID and SecretAccessKey used while creating a kapstan cloudprovider connection
  4. Set the kubectl context to use AWS cluster
aws eks update-kubeconfig --region us-west-2 --name prod_demo
  1. Get the pods in Nginx namespace
~ » kubectl get pods -n nginx-server -o json | jq -r '.items[0].metadata.name'
nginx-server-c5d594f7c-4rjlp
  1. Copy the pod name and proceed with port forwarding. Port forward Nginx port to local. kubectl port-forward <pod-name> 9000:8080

Port Forward 7. Open localhost:9000 in your browser.

Access localhost

Can't find what you need?