Need help on setting up the ingress in K8S. Thank you in advance.
I have configured, NGINX Controller and Cert-Manager on the AKS cluster using Helm.
Next - deployed two pods, and respected services here are those names and can be found in the above-attached image.
- pod/rpe-delivers-orders-dcs-api*
- service/rpe-delivers-orders-dcs-api
- pod/rpe-delivers-orders-proxy-api*
- service/rpe-delivers-orders-proxy-api
Next - when I try to set up the ingress like below for the above two services.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rpe-delivers-orders-dcs-ingress
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: dcs-cluster-issuer
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
tls:
- hosts:
- raag.westus2.cloudapp.azure.com
secretName: dcs-tls-secret
rules:
- host: raag.westus2.cloudapp.azure.com
http:
paths:
- path: /orders-dcs(/|$)(.*)
pathType: Prefix
backend:
service:
name: rpe-delivers-orders-dcs-api
port:
number: 80
- path: /orders-proxy(/|$)(.*)
pathType: Prefix
backend:
service:
name: rpe-delivers-orders-proxy-api
port:
number: 80
- path: /(.*)
pathType: Prefix
backend:
service:
name: rpe-delivers-orders-dcs-api
port:
number: 80
- Working as expected - raag.westus2.cloudapp.azure.com
- Working as expected - raag.westus2.cloudapp.azure.com/rpe-delivers-orders-dcs-api
- Not working - raag.westus2.cloudapp.azure.com/rpe-delivers-orders-proxy-api
My goal is for the below URLs should redirect to two different web pages:
- raag.westus2.cloudapp.azure.com/rpe-delivers-orders-dcs-api
- raag.westus2.cloudapp.azure.com/rpe-delivers-orders-proxy-api
Please let me know if I'm missing any information or didn't do the setup right.
Thank you.
