Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

nginx - Path wildcard not working in kubernetes ingress

I have installed Ingress and linked my service to it (usign metallb).

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
     nginx.ingress.kubernetes.io/rewrite-target: /
spec:
   rules:
   - http:
       paths:
       - path: /api/tasks/*
         # pathType: Exact
         backend:
           serviceName: tasks-service
           servicePort: 5004

The thing is this, I set up the default prefix of the paths in the deployment to be

/api/tasks/

where /api/tasks/tasks shows the service is up while /api/tasks/tasks_count gives the total number. However in my k8s cluster, I cannot redirect to the different paths within the service. What could be the problem?

question from:https://stackoverflow.com/questions/65861282/path-wildcard-not-working-in-kubernetes-ingress

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...