kubectl create namespace nginx-api
kubectl create namespace nginx-front
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install nginx-api ingress-nginx/ingress-nginx \
--namespace nginx-api \
--set controller.ingressClassResource.name=nginx-api \
--set controller.replicaCount=2 \
--set defaultBackend.nodeSelector."kubernetes\.io/os"=linux \
--set defaultBackend.image.digest=""
helm install nginx-front ingress-nginx/ingress-nginx \
--namespace nginx-front \
--set controller.ingressClassResource.name=nginx-front \
--set controller.replicaCount=2 \
--set defaultBackend.nodeSelector."kubernetes\.io/os"=linux \
--set defaultBackend.image.digest=""
Feito agora temos dois nginx controller como ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example
namespace: foo
spec:
ingressClassName: nginx-api
rules:
- host: www.example.com
http:
paths:
- backend:
service:
name: exampleService
port:
number: 80
path: /
# This section is only required if TLS is to be enabled for the Ingress
tls:
- hosts:
- www.example.com
secretName: example-tls
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example
namespace: foo
spec:
ingressClassName: nginx-api
rules:
- host: www.example.com
http:
paths:
- backend:
service:
name: exampleService
port:
number: 80
path: /
# This section is only required if TLS is to be enabled for the Ingress
tls:
- hosts:
- www.example.com
secretName: example-tls