이 절차에서는 Apigee Hybrid 설치에 Cloud Service Mesh 게이트웨이를 추가하는 방법을 설명합니다.
추가 Cloud Service Mesh 게이트웨이 설치
Cloud Service Mesh overlay.yaml 파일에서 아래와 비슷한 패턴을 따라 더 많은 인그레스 게이트웨이를 추가할 수 있습니다. spec.components[].label 및 spec.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 인그레스를 가상 호스트에 타겟팅
라벨이 지정된 Cloud Service Mesh/istio 인그레스 게이트웨이를 재정의 파일의 특정 가상 호스트로 타겟팅할 수 있습니다.
이 구성은 Apigee에서 가상 호스트 구성을 적용할 인그레스 게이트웨이를 지정합니다. 다음 예시에서 가상 호스트 milk-vh의 트래픽은 dairy 라벨이 지정된 인그레스를 통해 전달되고 다른 두 가상 호스트의 트래픽은 vegetables 인그레스를 통해 전달됩니다. 추가 Apigee 인그레스 게이트웨이 설치의 설명대로 인그레스에 라벨을 올바르게 지정해야 합니다.
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