在客戶安裝的 Cloud Service Mesh 中新增多個入口閘道

本程序說明如何在 Apigee 混合式安裝中新增其他 Cloud Service Mesh 閘道。

安裝其他 Cloud Service Mesh 閘道

在 Cloud Service Mesh overlay.yaml 檔案中,您可以按照以下類似的模式新增更多入口閘道。請注意,spec.components[].labelspec.components[].k8s.service.selector 元素可讓您將命名入口網關與特定虛擬主機建立關聯,如「將入口網關指定為虛擬主機」一文所述。

  apiVersion: install.istio.io/v1alpha1
  kind: IstioOperator
  spec:
    profile: asm-gcp
    # hub: gcr.io/gke-release/asm # {"$ref":"#/definitions/io.k8s.cli.setters.anthos.servicemesh.hub"}
    components:
      ingressGateways:
      - name: istio-ingressgateway-dairy
        enabled: true
        label:
          app: istio-ingressgateway
          ingress_name: dairy
        k8s:
          service:
            selector:
              app: istio-ingressgateway
              ingress_name: dairy
            type: LoadBalancer
            ports:
            - name: status-port
              port: 15021
            - name: http2
              port: 80
              targetPort: 8080
            - name: https
              port: 443
              targetPort: 8443
          hpaSpec:
            minReplicas: 1
            maxReplicas: 10
      - name: istio-ingressgateway-vegetables
        enabled: true
        label:
          app: istio-ingressgateway
          ingress_name: vegetables
        k8s:
          service:
            selector:
              app: istio-ingressgateway
              ingress_name: vegetables
            ports:
            - name: http2
              port: 80
              targetPort: 8080
            - name: status-port
              port: 15020
            - name: https
              port: 443
              targetPort: 8443
          hpaSpec:
            minReplicas: 1
            maxReplicas: 10
          resources:
            requests:
              cpu: 300m
              memory: 128Mi
  

請按照 Cloud Service Mesh 說明文件 (適用於您的平台) 套用變更。

將 Cloud Service Mesh/istio ingress 指定為虛擬主機

您可以在覆寫檔案中,將標示為 Cloud Service Mesh/istio 的入口網頁閘道指定為特定虛擬主機。這項設定會指定 Apigee 會套用虛擬主機設定的入口閘道。在以下範例中,系統會將導向虛擬主機 milk-vh 的流量經由標示為 dairy 的輸入端導向,而導向其他兩個虛擬主機的流量則會經由 vegetables 輸入端導向。如安裝其他 Apigee Ingress Gateway 閘道一文所述,Ingress 必須正確標示。

virtualhosts:
  - name: milk-vh
    sslCertPath: cert-milk.crt
    sslKeyPath: cert-milk.key
    selector:
      app: istio-ingressgateway
      ingress_name: dairy

  - name: carrots-vh
    sslCertPath: cert-carrots.crt
    sslKeyPath: cert-carrots.key
    selector:
      app: istio-ingressgateway
      ingress_name: vegetables

  - name: ginger-vh
    sslCertPath: cert-ginger.crt
    sslKeyPath: cert-ginger.key
    selector:
      app: apigee-ingressgateway
      ingress_name: vegetables