この手順では、Apigee ハイブリッド インストールに Anthos Service Mesh(ASM)ゲートウェイを追加する方法について説明します。
追加の Anthos Service Mesh ゲートウェイをインストールする
ASM overlay.yaml ファイルで、次のようなパターンに従って Ingress ゲートウェイを追加できます。spec.components[].label および spec.components[].k8s.service.selector の要素を使用すると、名前付き Ingress ゲートウェイを特定の仮想ホストに関連付けることができます。詳しくは、Ingress のターゲットを仮想ホストに設定するをご覧ください。
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 Service Mesh のドキュメントに従って、変更を適用します。
ASM / Istio Ingress のターゲットを仮想ホストに設定する
オーバーライド ファイルで、ラベル付きの ASM / Istio Ingress ゲートウェイのターゲットを特定の仮想ホストに設定できます。この構成により、Apigee が仮想ホストの構成を適用する Ingress ゲートウェイが指定されます。次の例では、仮想ホスト milk-vh へのトラフィックは dairy というラベルが付いた Ingress を経由し、他の 2 つの仮想ホストへのトラフィックは vegetables Ingress を経由します。Ingress には適切なラベルを付ける必要があります。詳しくは、追加の Apigee 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