I'm trying to deploy this ingress service on AWS EKS. it works locally, but not when deployed to EKS.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: 'true'
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: a16a5f3b82c3b4cf0a27a801c8b43788-1a53212dd4e2fc34.elb.ca-central-1.amazonaws.com
http:
paths:
- path: /?(.*)
pathType: Prefix
backend:
service:
name: store-cluster-ip-service
port:
number: 80
- path: /api/?(.*)
pathType: Prefix
backend:
service:
name: products-api-cluster-ip-service
port:
number: 5002
I'm getting the following errors.
Warning: annotation "kubernetes.io/ingress.class" is deprecated, please use 'spec.ingressClassName' instead
Warning: path /?(.*) cannot be used with pathType Prefix
Warning: path /api/?(.*) cannot be used with pathType Prefix
Error from server (BadRequest): error when creating "ingress-service.yaml": admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: ingress contains invalid paths: path /?(.*) cannot be used with pathType Prefix
path /api/?(.*) cannot be used with pathType Prefix
I'm following an outdated course on udemy so the first warning i'm aware i have to change to using an ingress class, but why are the second two errors happening? Are they related to the first issue (ingress Class)?