spec fix
Murat Karakas authored
c38b2745
Name Last commit Last update
img nginx ingress
setup nginx ingress
yaml upgrade ingress spec
README.md spec fix
ingress.yaml spec fix

Load Balancing With Ingress

Index

Requirements

If you have already `microservices` namespace from the previous lab, please remove it and run the commands below for fresh start IN THE ROOT FOLDER. 

kubectl delete ns microservices

bash ./yaml/preload-docker-image.sh

Deploy Nginx Ingress

https://kubernetes.github.io/ingress-nginx/deploy/

Deploying Ingress Rules

  1. Define the rules with the given yaml files below;

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-service
  namespace: microservices
spec:
  ingressClassName: nginx
  rules:
  -  host: localhost
     http:
      paths:
      - pathType: Prefix
        path: "/orders"
        backend:
          service:
            name: order-service
            port:
              number: 8080
      - pathType: Prefix
        path: "/customers"
        backend:
          service:
            name: customer-service
            port:
              number: 8080
      - pathType: Prefix
        path: "/products"
        backend:
          service:
            name: product-service
            port:
              number: 8080   

command

kubectl apply -f ./ingress.yaml
  1. After deploying ingress definition you can send request with your favorite client as below;

Product Service product-jpg

Customer Service customer-jpg

Order Service order-jpg