kubernetes - 在 Kubernetes 入口中具有基于路径的路由的多路径应用程序
问题描述
我想通过具有多条路径的入口运行 Spring Boot 应用程序
http://localhost:8888/login
http://localhost:8888/client/dev
在本地主机上,当我运行此应用程序时,它会自动重定向到 /login
我正在使用 traefik 入口控制器。pod 和服务正在运行。入口配置如下。
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/redirect-entry-point: https
traefik.ingress.kubernetes.io/rewrite-target: /
name: config
namespace: default
spec:
rules:
- host: config.example.com
http:
paths:
- backend:
service:
name: config
port:
number: 8888
path: /config
pathType: ImplementationSpecific
status:
loadBalancer: {}
当我打开https://config.example.com/config时 ,它会重定向到https://config.example.com/login并且出现 404 错误。
可以使用哪些注释,以便允许我进行进一步的子路径路由。
解决方案
推荐阅读
- string - “借来的价值不够长”,在循环中使用时被丢弃
- python - 如何根据列索引将字符串 True / False Pandas 列转换为 int?
- android - Android - 应用 TextStyle“粗体”删除自定义字体设置
- javascript - 如何跟踪按钮的点击?
- reactjs - 网络离线时使用反应排队请求
- visual-studio-code - VSCode 抱怨解决我的环境需要太长时间
- apache-spark - 从 spark 调用 elasticsearch“_count”端点
- javascript - HTML/JavaScript 禁用元素
- optaplanner - 限制车辆路线问题中每辆车的访问次数
- text - 自动填充空间到每行上固定的列宽