1. 程式人生 > >kubernetes集群邊界路由Ingress的管理

kubernetes集群邊界路由Ingress的管理

rules sla ice serve 後端 esp 將不 -s ext

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的管理