Amazon web services 流量路由在AWS上有问题,但在Minikube上使用以下配置

Amazon web services 流量路由在AWS上有问题,但在Minikube上使用以下配置,amazon-web-services,istio,Amazon Web Services,Istio,使用此配置无法获得健康的上游Http 503。如果我只是删除子集,一切都很好 来源:ccgf helm伞形图/图表/ccgf cdlg应用程序/模板/service.yaml 来源:ccgf helm伞形图/图表/ccgf cdlg应用程序/模板/部署.yaml 来源:ccgf helm伞形图/图表/ccgf cdlg应用程序/模板/部署.yaml #虚拟服务 #目的地规则 来源:ccgf头盔伞形图/图表/ccgf网关/templates/gateway.yaml 我根据你的YAML做了一个

使用此配置无法获得健康的上游Http 503。如果我只是删除子集,一切都很好

来源:ccgf helm伞形图/图表/ccgf cdlg应用程序/模板/service.yaml 来源:ccgf helm伞形图/图表/ccgf cdlg应用程序/模板/部署.yaml
来源:ccgf helm伞形图/图表/ccgf cdlg应用程序/模板/部署.yaml #虚拟服务 #目的地规则
来源:ccgf头盔伞形图/图表/ccgf网关/templates/gateway.yaml
我根据你的YAML做了一个复制品,一切都很好,我唯一拥有的是基本的istio入口网关,而不是定制的


对于开始,请您更换主机,然后检查它是否工作

应该是

ccgf-cdlg-app.cdlg-edc-devci.svc.cluster.local
而不是
ccgf-cdlg-app


您是否在cdlg edc devci命名空间中启用了

您可以使用
kubectl get namespace-L istio injection

应该是

NAME             STATUS   AGE   ISTIO-INJECTION
cdlg-edc-devci   Active   37m   enabled

以及复制YAML










ubuntupod的一些结果


CULL-v外部入口网关ip/cdlg edc设备/前端

curl-v外部入口网关ip/s


我希望它能回答你的问题。如果您还有任何问题,请告诉我。

经过更多的讨论,我们发现问题出在飞行员吊舱上。它有一些过时的路由条目。重启吊舱后,一切正常。无论如何,感谢你调试了这个。
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ccgf-cdlg-app-production
  namespace: cdlg-edc-devci
  labels:
    app: ccgf-cdlg-app
    version: production
spec:
  replicas: 1

  selector:
    matchLabels:
      app: ccgf-cdlg-app
      version: production
  template:
    metadata:
      labels:
        app: ccgf-cdlg-app
        version: production
    spec:
      containers:
      - image: edc-ccgf-ui-app:1.37
        imagePullPolicy: Always
        name: ccgf-cdlg-app
        ports:
        - name: ccgf-cdlg-app
          containerPort: 80
        readinessProbe:
          httpGet:
            path: /
            port: 80
          initialDelaySeconds: 20
          periodSeconds: 20
      imagePullSecrets:
      - name: spinnakerrepoaccess
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ccgf-cdlg-app-canary
  namespace: cdlg-edc-devci
  labels:
    app: ccgf-cdlg-app
    version: canary
spec:
  replicas: 1

  selector:
    matchLabels:
      app: ccgf-cdlg-app
      version: canary
  template:
    metadata:
      labels:
        app: ccgf-cdlg-app
        version: canary
    spec:
      containers:
      - image: edc-ccgf-ui-app:1.38
        imagePullPolicy: Always
        name: ccgf-cdlg-app
        ports:
        - name: ccgf-cdlg-app
          containerPort: 80
        readinessProbe:
          httpGet:
            path: /
            port: 80
          initialDelaySeconds: 20
          periodSeconds: 20
      imagePullSecrets:
      - name: spinnakerrepoaccess
kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: ccgf-cdlg-app
  namespace: cdlg-edc-devci
spec:
  hosts:
    - '*'
  gateways:
    - ccgf-gateway
  http:
    - match:
        - uri:
            prefix: /cdlg-edc-devci/frontend
      rewrite:
        uri: /
      route:
        - destination:
            host: ccgf-cdlg-app.cdlg-edc-devci.svc.cluster.local
            subset: production
          retries:
            attempts: 3
            perTryTimeout: 2s
            retryOn: 'gateway-error,connect-failure,refused-stream'
          weight: 50
        - destination:
            host: ccgf-cdlg-app.cdlg-edc-devci.svc.cluster.local
            subset: canary
          retries:
            attempts: 3
            perTryTimeout: 2s
            retryOn: 'gateway-error,connect-failure,refused-stream'
          weight: 50
    - match:
        - uri:
            prefix: /static
      rewrite:
        uri: /static
      route:
        - destination:
            host: ccgf-cdlg-app.cdlg-edc-devci.svc.cluster.local
          retries:
            attempts: 3
            perTryTimeout: 2s
            retryOn: 'gateway-error,connect-failure,refused-stream'
kind: DestinationRule
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: ccgf-cdlg-app
  namespace: cdlg-edc-devci
spec:
  host: ccgf-cdlg-app
  subsets:
    - labels:
        version: canary
      name: canary
    - labels:
        version: production
      name: production
kind: Gateway
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: ccgf-gateway
  namespace: namespace
spec:
  servers:
    - hosts:
        - '*'
      port:
        name: http
        number: 80
        protocol: HTTP
  selector:
    release: istio-custom-ingress-gateways
NAME             STATUS   AGE   ISTIO-INJECTION
cdlg-edc-devci   Active   37m   enabled
kubectl create namespace cdlg-edc-devci
kubectl label namespace cdlg-edc-devci istio-injection=enabled
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx1
  namespace: cdlg-edc-devci
spec:
  selector:
    matchLabels:
      app: ccgf-cdlg-app
      version: production
  replicas: 1
  template:
    metadata:
      labels:
        app: ccgf-cdlg-app
        version: production
    spec:
      containers:
      - name: nginx1
        image: nginx
        ports:
        - name: http-dep1
          containerPort: 80
        lifecycle:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "echo Hello nginx1 > /usr/share/nginx/html/index.html"]
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx2
  namespace: cdlg-edc-devci
spec:
  selector:
    matchLabels:
      app: ccgf-cdlg-app
      version: canary
  replicas: 1
  template:
    metadata:
      labels:
        app: ccgf-cdlg-app
        version: canary
    spec:
      containers:
      - name: nginx2
        image: nginx
        ports:
        - name: http-dep2
          containerPort: 80
        lifecycle:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "echo Hello nginx2 > /usr/share/nginx/html/index.html"]
apiVersion: v1
kind: Service
metadata:
  name: nginx
  namespace: cdlg-edc-devci
  labels:
    app: ccgf-cdlg-app
spec:
  ports:
  - name: http-svc
    port: 80
    protocol: TCP
  selector:
    app: ccgf-cdlg-app
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: nginxvirt
  namespace: cdlg-edc-devci
spec:
  gateways:
  - ccgf-gateway
  hosts:
  - '*'
  http:
  - name: production
    match:
    - uri:
        prefix: /cdlg-edc-devci/frontend
    rewrite:
      uri: /
    route:
    - destination:
        host: nginx.cdlg-edc-devci.svc.cluster.local
        port:
          number: 80
        subset: can
      weight: 50
    - destination:
        host: nginx.cdlg-edc-devci.svc.cluster.local
        port:
          number: 80
        subset: prod
      weight: 50
  - name: canary
    match:
    - uri:
        prefix: /s
    rewrite:
      uri: /
    route:
    - destination:
        host: nginx.cdlg-edc-devci.svc.cluster.local
        port:
          number: 80
        subset: can
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: nginxdest
  namespace: cdlg-edc-devci
spec:
  host: nginx.cdlg-edc-devci.svc.cluster.local
  subsets:
  - name: prod
    labels:
      version: production
  - name: can
    labels:
      version: canary
kind: Gateway
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: ccgf-gateway
  namespace: namespace
spec:
  servers:
    - hosts:
        - '*'
      port:
        name: http
        number: 80
        protocol: HTTP
apiVersion: v1
kind: Pod
metadata:
  name: ubu
spec:
  containers:
  - name: ubu
    image: ubuntu
    command: ["/bin/sh"]
    args: ["-c", "apt-get update && apt-get install curl -y && sleep 3000"]
HTTP/1.1 200 OK
Hello nginx2

HTTP/1.1 200 OK
Hello nginx1
HTTP/1.1 200 OK
Hello nginx2