將多個入口閘道新增至客戶安裝的 Anthos 服務網格

本程序說明如何在 Apigee 混合式安裝中新增其他 Anthos 服務網格 (ASM) 閘道。

安裝其他 Anthos 服務網格閘道

在 ASM 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

請按照 Anthos 服務網格說明文件中的指示,為您的平台套用變更。

將 ASM/istio 輸入指定至虛擬主機

您可以在覆寫檔案中,將標示為 ASM/istio 入口網站閘道的特定虛擬主機設為目標。這項設定會指定 Apigee 會套用虛擬主機設定的入口閘道。在以下範例中,系統會將流量導向至標示為 dairy 的虛擬主機 milk-vh,並將流量導向至其他兩個虛擬主機的 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