Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 2.35 KB

aws-k8s-steps.asciidoc

File metadata and controls

63 lines (49 loc) · 2.35 KB

Kubernetes Deployment in AWS EKS (Elastic Kubernetes Service)

Pre-requisites

  • AWS EKS Cluster is required to be up and running for this deployment. In case, you need to create new EKS Cluster, please refer this link.

  • AWS CLI is to be installed. For installing, please refer this link.

Steps

Here are the high level steps which are followed by AWS CLI Commands.

  • Connect to AWS EKS Cluster.

  • Create one Ingress Controller in the Cluster.

  • Update the Ingress YAML file.

  • Execute/Apply the YAML files and test the application.

#Connect to AWS from CLI (either local machine or VM) - in case, AWS CLI not present, install
aws --version

#Check if it is connected
aws sts get-caller-identity

#If connected to AWS, skip this command or else, use this and connect
aws configure

#Connect to AWS EKS Cluster
aws eks --region <region> update-kubeconfig --name <clusterName>

#Sample
aws eks --region eu-west-1 update-kubeconfig --name hangar-test-eks


#Install Ingress Controller by Nginx using helm command - in case, helm not present, install
helm upgrade --install nginx-ingress nginx-ingress-controller --set ingressClassResource.default=true --set containerSecurityContext.allowPrivilegeEscalation=false --repo https://charts.bitnami.com/bitnami --namespace nginx-ingress --create-namespace
#Get the DomainName/HostName from the below command - Nginx Ingress Controller's LoadBalancer
kubectl get svc --all-namespaces
  • Update the Ingress YAML File present in the k8s folder with the DomainName came as the output of the above command

...
spec:
  tls:
    - hosts:
        - ab1c2d1001xxxxxxxxxxxxxxxxxxx101-1000000001.eu-west-1.elb.amazonaws.com
  rules:
    - host: ab1c2d1001xxxxxxxxxxxxxxxxxxx101-1000000001.eu-west-1.elb.amazonaws.com
...
#Execute the Kubernetes YAML Files
kubectl apply -f ./

#Check the status of the Deployments, Services, Pods
kubectl get all