Member-only story
In this article, we’ll walk through the steps to deploy a sample Nginx application on an Amazon Elastic Kubernetes Service (EKS) cluster. By following along, you’ll learn how to use kubectl
to apply Kubernetes resource configurations, validate deployments, and set up internal communication between services using a Kubernetes Service.
Prerequisites
Before we dive into deploying the application, ensure the following prerequisites are met:
- EKS Cluster: A Kubernetes cluster set up on Amazon EKS with at least one worker node.
- Kubectl Installed: The Kubernetes CLI (
kubectl
) installed on your local machine. If not, refer to the official guide to install it. - YAML Files: Deployment and Service YAML configuration files to define resources.
- Refer this Github repo
1. Understanding the Nginx Deployment
The deploy.yaml
file defines the namespace, deployment, and Docker image for the Nginx application. Below is an example of its contents
---
apiVersion: v1
kind: Namespace
metadata:
name: eks-sample-app
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: eks-sample-linux-deployment
namespace: eks-sample-app
labels:
app: eks-sample-linux-app
spec:
replicas: 3
selector:
matchLabels:
app: eks-sample-linux-app
template:
metadata:
labels…