Code Monkey home page Code Monkey logo

ingress-nginx's Introduction

How to install and setup Ingress-Nginx Controller

###Setp by Step Guide

###Step 1: Configure Metallb load balancer

  • To install MetalLB, apply the manifest:
    kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.5/config/manifests/metallb-native.yaml
  • Defining The IPs To Assign To The Load Balancer Services ###First you need to identify your node IP :
    kubectl get node -o wide

###In order to assign an IP to the services, MetalLB must be instructed to do so via the IPAddressPool CR. ###All the IPs allocated via IPAddressPools contribute to the pool of IPs that MetalLB uses to assign IPs to services.

  • vim metal-lb-config.yml
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: first-pool
  namespace: metallb-system
spec:
  addresses:
  - 172.18.0.1-172.18.0.5
  - fc00:f853:0ccd:e799::/124

Apply the the manifest

###Step 2: Install the Nginx Ingress Controller

  • Apply the the manifest for Bare metal clusters
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.1/deploy/static/provider/baremetal/deploy.yaml
  • Check the configuration of Ingress-Nginx controller
kubectl -n ingress-nginx get all
  • To Change the Service from NodePort to LoadBalancer, edit the ingress-nginx-controller service
kubectl -n ingress-nginx edit svc ingress-nginx-controller

###To make sure service is shfited from NodePort to LoadBalancer

kubectl -n ingress-nginx get all

###Step 3: Apply the Nginx Ingress Resource

###make sure to populate the correct ingress-nginx class name

kubectl -n ingress-nginx get ingressclass

###to check the ingress resource

kubectl -n app-space get ingress
  • To see the more detail about ingress
kubectl -n app-space desribe ingress
  • To see the detail about ingress service
kubectl -n ingress-nginx get svc 
  • If, you are using Kind Cluster you need to port forward
kubectl port-forward -n ingress-nginx service/ingress-nginx-controller 8080:80
  • To check and confirm, Whatever individual Deployment and service is wokring fine using ClusterIP under kind cluster
kubectl get node
###then enter the
docker exec -it prod-worker sh
###Curl <Service IP>:Port

###Note: Customize the ingress resource manifest as per your requirements

ingress-nginx's People

Contributors

aadevcloud 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.