這項程序說明如何將其他 Cloud Service Mesh 閘道新增至 Apigee Hybrid 安裝作業。
安裝其他 Cloud Service Mesh 閘道
在 Cloud Service Mesh 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
請按照平台適用的 Cloud Service Mesh 說明文件,套用變更。
將 Cloud Service Mesh/Istio Ingress 設為虛擬主機的目標
您可以在覆寫檔案中,將標示的 Cloud Service Mesh/Istio Ingress 閘道指定至特定虛擬主機。
這項設定會指定 Apigee 要套用虛擬主機設定的 Ingress 閘道。在下列範例中,虛擬主機 milk-vh 的流量會透過標示為 dairy 的 Ingress 導向,其他兩個虛擬主機的流量則會透過 vegetables Ingress 導向。如「安裝額外的 Apigee Ingress 閘道」一文所述,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