In this video , You will learn how to integrate spring boot with NGINX ingress controller on Kubernetes Cluster.

To install Nginx-ingress, apply the below commands

helm search nginx-ingress
Helm install stable/nginx-ingress --name=my-nginx --set rbc.create=true


MetalLB Installation: https://metallb.universe.tf/installation/

Installation By Manifest

To install MetalLB, apply the manifest:

kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.3/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.3/manifests/metallb.yaml

On first install only

kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey=“$(openssl rand -base64 128)”

The installation manifest does not include a configuration file. MetalLB’s components will still start, but will remain idle until you define and deploy a configmap.

apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 192.168.1.240-192.168.1.250


apiVersion: networking.k8s.io/v1beta1 # for versions before 1.14 use extensions/v1beta1
kind: Ingress
metadata:
name: example-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: springboot-ingress-k8s.info
http:
paths:
- path: /
backend:
serviceName: springboot-postgres-k8s
servicePort: 8080

#spring #spring-boot #nginx #kubernetes

Expose Spring Boot Micro Service Via NGINX ingress controller on Kubernetes Cluster
50.70 GEEK