Aggiunta di più gateway in entrata ad Anthos Service Mesh installato dal cliente

Questa procedura descrive l'aggiunta di altri gateway Anthos Service Mesh (ASM) alla tua installazione ibrida di Apigee.

Installazione di gateway Anthos Service Mesh aggiuntivi

Nel file overlay.yaml di ASM puoi aggiungere altri gateway in entrata seguendo un pattern simile a quello mostrato di seguito. Tieni presente che gli elementi spec.components[].label e spec.components[].k8s.service.selector consentono di associare un gateway in entrata denominato a un host virtuale specifico, come spiegato in Targeting di un traffico in entrata a un host virtuale.

  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
  

Per applicare le modifiche, segui la documentazione di Anthos Service Mesh per la tua piattaforma.

Scegliere un host virtuale come target di un traffico ASM/istio in entrata

Puoi scegliere come target un gateway ASM/istio in entrata etichettato a un host virtuale specifico nel file di override. Questa configurazione specifica il gateway in entrata in cui Apigee applicherà la configurazione dell'host virtuale. Nell'esempio seguente, il traffico verso l'host virtuale milk-vh viene indirizzato attraverso il traffico in entrata con etichetta dairy, mentre il traffico verso gli altri due host virtuali passa attraverso il traffico in entrata vegetables. I gateway in entrata devono essere etichettati correttamente, come spiegato in Installazione di gateway gateway in entrata Apigee aggiuntivi.

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