我正在使用 istio 虚拟服务配置纸浆,但我遇到了一些路由问题

问题描述 投票:0回答:0
  • 我正在使用 istio 虚拟服务配置纸浆
    但我遇到了一些路由问题 错误 podman 登录 -u 管理员 -p ZN3C85JoxCWapBr3JZm2CffDxrzRu https://artifacts.bac.tech 错误:验证“artifacts.abc.tech”的信用:获取“http://pulp-api-svc.pulp.svc.cluster.local:24817/token/?account=admin&service=artifacts.314ecorp.tech”:拨号tcp:在 10.10.12.11:53 上查找 pulp-api-svc.pulp.svc.cluster.local:没有这样的主机
This is my VS 
```apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: pulp-vs
  namespace: pulp
spec:
  gateways:
  - istio-system/istiogateway
  hosts:
  - artifacts.314ecorp.tech
  http:
  - match:
    - uri:
        prefix: /pulp/content/
    - uri: 
        prefix: /pulp/container/
    route:
    - destination:
        host: pulp-content-svc
        port:
          number: 24816
  - match:
    - uri:
        prefix: /token/                                          
    route:
    - destination:
        host: pulp-api-svc
        port:
          number: 24817       
  - match:
    - uri:
        prefix: /pulp/api/v3/                                   
    route:
    - destination:
        host: pulp-api-svc
        port:
          number: 24817  
  - match:
    - uri:
        prefix: /auth/login/                                      
    route:
    - destination:
        host: pulp-api-svc
        port:
          number: 24817  
  - match:
    - uri:
        prefix: /pulp_ansible/galaxy/                                    
    route:
    - destination:
        host: pulp-api-svc
        port:
          number: 24817  
  - match:
    - uri:
        prefix: /v2/                                        
    route:
    - destination:
        host: pulp-api-svc
        port:
          number: 24817  
  - match:
    - uri:
        prefix: /extensions/v2/                                        
    route:
    - destination:
        host: pulp-api-svc
        port:
          number: 24817  
  - match:
    - uri:
        prefix: /pypi/                                             
    route:
    - destination:
        host: pulp-api-svc
        port:
          number: 24817  
  - match:
    - uri:
        prefix: /                                   
    route:
    - destination:
        host: pulp-api-svc
        port:
          number: 24817                                                                        


基于这个Ingress转换

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: pulp
spec:
  rules:
  - http:
      paths:
      - backend:
          service:
            name: pulp-content-svc
            port:
              name: content-24816
        path: /pulp/content/
        pathType: Prefix
      - backend:
          service:
            name: pulp-api-svc
            port:
              name: api-24817
        path: /pulp/api/v3/
        pathType: Prefix
      - backend:
          service:
            name: pulp-api-svc
            port:
              name: api-24817
        path: /auth/login/
        pathType: Prefix
      - backend:
          service:
            name: pulp-api-svc
            port:
              name: api-24817
        path: /
        pathType: Prefix
      - backend:
          service:
            name: pulp-api-svc
            port:
              name: api-24817
        path: /pulp_ansible/galaxy/
        pathType: Prefix
      - backend:
          service:
            name: pulp-api-svc
            port:
              name: api-24817
        path: /v2/
        pathType: Prefix
      - backend:
          service:
            name: pulp-api-svc
            port:
              name: api-24817
        path: /extensions/v2/
        pathType: Prefix
      - backend:
          service:
            name: pulp-content-svc
            port:
              name: content-24816
        path: /pulp/container/
        pathType: Prefix
      - backend:
          service:
            name: pulp-api-svc
            port:
              name: api-24817
        path: /token/
        pathType: Prefix
      - backend:
          service:
            name: pulp-api-svc
            port:
              name: api-24817
        path: /pypi/
        pathType: Prefix```
kubernetes istio pulp istio-gateway pulpcore
© www.soinside.com 2019 - 2024. All rights reserved.