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

Опубликовано: 04 Октябрь 2024
на канале: Techno Town Techie
6,904
102

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/installat...

Installation By Manifest

To install MetalLB, apply the manifest:

kubectl apply -f https://raw.githubusercontent.com/met...
kubectl apply -f https://raw.githubusercontent.com/met...
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

--------------------------

My Top Playlists:
Spring Boot with Angular :    • Spring Boot + Angular  

Spring Boot with Docker & Docker Compose :    • Spring Boot Docker & Docker Compose  

Spring Boot with Kubernetes :    • Spring Boot Docker Kubernetes  

Spring Boot with AWS :    • Spring Boot + AWS  

Spring Boot with Azure :    • Spring Boot Azure  

Spring Data with Redis :    • Spring Data with Redis  

Spring Boot with Apache Kafka :    • Apache kafka  

Spring Boot with Resilience4J :    • SpringBoot Resilience4j