4.4. Istio 앰비언트 모드에서 Bookinfo 애플리케이션 배포
ZTunnel 프록시를 사용하여 사이드카 삽입 없이 Istio 앰비언트 모드에서 info 샘플 애플리케이션을 배포할 수 있습니다. bookinfo 애플리케이션에 대한 자세한 내용은 " Bookinfo 애플리케이션 정보"를 참조하십시오.
사전 요구 사항
- Istio 앰비언트 모드에 필요한 지원되는 Kubernetes Gateway API CRD(사용자 정의 리소스 정의)를 포함하는 OpenShift Container Platform 4.15 이상에 클러스터를 배포했습니다.
-
설치 방법에 따라
cluster-admin역할의 사용자로 웹 콘솔을 통해 또는oc login명령을 사용하여 OpenShift Container Platform 클러스터에 로그인했습니다. - Red Hat OpenShift Service Mesh Operator를 설치하고 Istio 리소스를 생성했으며 Operator에서 Istio를 배포했습니다.
-
IstioCNI리소스를 생성했으며 Operator에서 필요한IstioCNIPod를 배포했습니다. -
Ztunnel리소스를 생성했으며 Operator에서 필요한ZtunnelPod를 배포했습니다.
프로세스
다음 명령을 실행하여
info네임스페이스를 생성합니다.$ oc create namespace info다음 명령을 실행하여
istio-discovery=enabled레이블을info네임스페이스에 추가합니다.$ oc label namespace info istio-discovery=enabled다음 명령을 실행하여
bookinfo애플리케이션을 배포하도록infoYAML 파일을 적용합니다.$ oc apply -n info -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo.yaml다음 명령을 실행하여
bookinfo애플리케이션을 배포하도록info-versionsYAML 파일을 적용합니다.$ oc apply -n info -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo-versions.yaml다음 명령을 입력하여
정보pod가 실행 중인지 확인합니다.$ oc -n info get pods출력 예
NAME READY STATUS RESTARTS AGE details-v1-54ffdd5947-8gk5h 1/1 Running 0 5m9s productpage-v1-d49bb79b4-cb9sl 1/1 Running 0 5m3s ratings-v1-856f65bcff-h6kkf 1/1 Running 0 5m7s reviews-v1-848b8749df-wl5br 1/1 Running 0 5m6s reviews-v2-5fdf9886c7-8xprg 1/1 Running 0 5m5s reviews-v3-bb6b8ddc7-bvcm5 1/1 Running 0 5m5s다음 명령을 입력하여
info애플리케이션이 실행 중인지 확인합니다.$ oc exec "$(oc get pod -l app=ratings -n info \ -o jsonpath='{.items[0].metadata.name}')" \ -c ratings -n info \ -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>"전체 네임스페이스 또는 개별 Pod에 레이블을 지정하여 info 애플리케이션을 Istio 앰비언트 메시에 추가합니다.
정보 네임스페이스에 모든 워크로드를 포함하려면 다음 명령을 실행하여
istio.io/dataplane-mode=앰비 레이블을bookinfo네임스페이스에 적용합니다.$ oc label namespace info istio.io/dataplane-mode=ambient-
특정 워크로드만 포함하려면
istio.io/dataplane-mode=앰비 레이블을개별 Pod에 직접 적용합니다. 메시에서 워크로드를 추가하거나 제외하는 데 사용되는 라벨에 대한 자세한 내용은 "추가 리소스" 섹션을 참조하십시오.
참고앰비언트 메시에 워크로드를 추가하는 경우 애플리케이션 Pod를 다시 시작하거나 재배포할 필요가 없습니다. 사이드카 모드와 달리 각 Pod의 컨테이너 수는 변경되지 않습니다.
다음 명령을 실행하여 Ztunnel 프록시가 Pod 네트워크 네임스페이스에서 수신 대기 소켓을 성공적으로 열었습니다.
$ istioctl ztunnel-config workloads --namespace ztunnel출력 예
NAMESPACE POD NAME ADDRESS NODE WAYPOINT PROTOCOL info details-v1-54ffdd5947-cflng 10.131.0.69 ip-10-0-47-239.ec2.internal None HBONE info productpage-v1-d49bb79b4-8sgwx 10.128.2.80 ip-10-0-24-198.ec2.internal None HBONE info ratings-v1-856f65bcff-c6ldn 10.131.0.70 ip-10-0-47-239.ec2.internal None HBONE info reviews-v1-848b8749df-45hfd 10.131.0.72 ip-10-0-47-239.ec2.internal None HBONE info reviews-v2-5fdf9886c7-mvwft 10.128.2.78 ip-10-0-24-198.ec2.internal None HBONE info reviews-v3-bb6b8ddc7-fl8q2 10.128.2.79 ip-10-0-24-198.ec2.internal None HBONE istio-cni istio-cni-node-7hwd2 10.0.61.108 ip-10-0-61-108.ec2.internal None TCP istio-cni istio-cni-node-bfqmb 10.0.30.129 ip-10-0-30-129.ec2.internal None TCP istio-cni istio-cni-node-cv8cw 10.0.75.71 ip-10-0-75-71.ec2.internal None TCP istio-cni istio-cni-node-hj9cz 10.0.47.239 ip-10-0-47-239.ec2.internal None TCP istio-cni istio-cni-node-p8wrg 10.0.24.198 ip-10-0-24-198.ec2.internal None TCP istio-system istiod-6bd6b8664b-r74js 10.131.0.80 ip-10-0-47-239.ec2.internal None TCP ztunnel ztunnel-2w5mj 10.128.2.61 ip-10-0-24-198.ec2.internal None TCP ztunnel ztunnel-6njq8 10.129.0.131 ip-10-0-75-71.ec2.internal None TCP ztunnel ztunnel-96j7k 10.130.0.146 ip-10-0-61-108.ec2.internal None TCP ztunnel ztunnel-98mrk 10.131.0.50 ip-10-0-47-239.ec2.internal None TCP ztunnel ztunnel-jqcxn 10.128.0.98 ip-10-0-30-129.ec2.internal None TCP