Giter Site home page Giter Site logo

somrajroy / opensourceproject-aws-elastickubernetesservice-ingress-nginx Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 45 KB

AWS EKS Ingress with NGINX Ingress Controller. POC/Demo

aws-eks aws-eks-cluster ingress ingress-controller kubernetes kubernetes-cluster load-balancing nginx-ingress-controller elastic-kubernetes-service eksctl

opensourceproject-aws-elastickubernetesservice-ingress-nginx's Introduction

AWS EKS Ingress with NGINX Ingress Controller & eksctl

  • Kubernetes supports a high-level abstraction called Ingress, which allows host- or URL-based routing. An Ingress is a core concept of Kubernetes. It is always implemented by a third party proxy; these implementations are known as ingress controllers. An ingress controller is responsible for reading the ingress resource information and processing that data accordingly. Different ingress controllers have extended the specification in different ways to support additional use cases.
  • Ingress can route traffic to multiple services inside the cluster
    image
    image
  • Clone the repository and navigate to the folder lab-05
  • Open CLI in administrator mode and login
    $ aws configure
  • Create an EKS cluster
    $ eksctl create cluster --name k8sdemo --version 1.23 --region us-west-2 --nodegroup-name k8snodes --node-type t3.medium --nodes 2
  • Switch context
    $ aws eks --region us-west-2 update-kubeconfig --name k8sdemo
  • Refer below commands for verification of contexts. $ kubectl config view
    $ kubectl config current-context (output should be k8sdemo).
    $ kubectl config get contexts
    $ kubectl config use-context <<-context name->>
  • Check nodes and pods in the EKS cluster.
    $ kubectl get nodes -o wide
    $ kubectl get pods
  • Install Helm and update the repo. Then install the NGINX inngress controller without customizing the defaults.
    $ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
    $ helm repo update
    $ helm install nginx-ingress ingress-nginx/ingress-nginx --create-namespace --namespace ingress-basic --set controller.replicaCount=2 --set controller.nodeSelector."kubernetes.io/os"=linux --set defaultBackend.nodeSelector."kubernetes.io/os"=linux
  • Verify NGINX controller installation
    $ kubectl get pods -n ingress-basic -l app.kubernetes.io/name=ingress-nginx --watch
  • Inspect the ingress controller Service & pods
    $ kubectl get svc -n ingress-basic
    image
    $ kubectl get pods -n ingress-basic -l app.kubernetes.io/name=ingress-nginx
    image
  • Deploy the applications (pods and ClusterIP services)
    $ kubectl apply -f cats.yaml
    $ kubectl apply -f dogs.yaml
    $ kubectl apply -f birds.yaml
  • Create the ingress resource
    $ kubectl apply -f ingress.yaml
  • List existing pods & services
    $ kubectl get pods
    $ kubectl get svc
  • List existing ingress
    $ kubectl get ingress
  • Access the application - Get the ingress controller External IP (type LoadBalancer). AWS gives the DNS name and not the IP and it will come under "External IP" column. It can be also found in EC2 console under "Load Balancers".
    $ kubectl get svc -n ingress-basic image
  • Browse to the cats, dogs and birds service
    $ http://<<-DNS name as given under external ip column->>/cats
    $ http://<<-DNS name as given under external ip column->>/dogs
    $ http://<<-DNS name as given under external ip column->>/birds
  • Clean up resources
    $ kubectl get all
    $ kubectl delete all --all
    $ kubectl delete ingress --all
    $ kubectl delete all --all -n ingress-basic
    $ kubectl delete namespace ingress-basic
    $ kubectl delete ingressclass nginx
  • List existing resources
    $ kubectl get all
  • Clean up AWS enviornment
    $ eksctl delete cluster --name k8sdemo

    $ kubectl get -A ValidatingWebhookConfiguration
    $ kubectl delete ValidatingWebhookConfiguration nginx-ingress-ingress-nginx-admission

Further references :

opensourceproject-aws-elastickubernetesservice-ingress-nginx's People

Contributors

somrajroy avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.