码迷,mamicode.com
首页 > Web开发 > 详细

kubernetes集群边界路由Ingress的管理

时间:2019-04-22 09:17:42      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:不同   harbor   sla   api   pat   ingress   epo   cat   rod   

1.将请求转发到单个后端服务上
#cat traefik-ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: traefik-web-ui
  namespace: c7n-system
spec:
  rules:
  - host: traefik.maimailoan.cn
    http:
      paths:
      - path: /
        backend:
          serviceName: traefik-ingress-service
          servicePort: 8080

2.将同一个域名不同的URL请求转发到不同的后端服务上(微服务)
#cat traefik-ingress-server.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: choerodon-xiongxj
  namespace: c7n-system
spec:
  rules:
  - host: choerodon.maimailoan.cn
    http:
      paths:
      - path: /api-gateway
        backend:
          serviceName: api-gateway
          servicePort: 8080
      - path: /c7n-slaver
        backend:
          serviceName: c7n-slaver
          servicePort: 80
      - path: /chartmuseum-chartmuseum 
        backend:
          serviceName: chartmuseum-chartmuseum 
          servicePort: 8080 

3.将不同的域名域名请求转发到后端不同的服务上
#cat traefik-ingress-test.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: choerodon-xiongxj
  namespace: c7n-system
spec:
  rules:
  - host: choerodon.maimailoan.cn
    http:
      paths:
      - path: /api-gateway
        backend:
          serviceName: api-gateway
          servicePort: 8080
  - host: harbor.xxj.cn
    http:
      paths:
      - path: /harbor
        backend:
          serviceName: harbor-ui
          servicePort: 80

kubernetes集群边界路由Ingress的管理

标签:不同   harbor   sla   api   pat   ingress   epo   cat   rod   

原文地址:https://blog.51cto.com/whitehat/2382370

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!