网站首页 文章专栏 05ingress.md
05ingress.md
创建于:2021-07-04 07:51:33 更新于:2024-11-23 08:24:43 羽瀚尘 373

最简配置

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test
spec:
  rules:
  - host: foo.bar.com
    http:
      paths:
      - backend:
          serviceName: s1
          servicePort: 80
  - host: bar.foo.com
    http:
      paths:
      - backend:
          serviceName: s2
          servicePort: 80
  • spec.rules[].host指定访问的域名
  • spec.rules[].http.paths[].backend.serviceName筛选指定的service
  • spec.rules[].http.paths[].backend.servicePort 指定service端口
  • spec.rules[].http.paths[].backend指定访问的path,需要web程序确实存在相应路径,可选