Helm으로 설치하기

Helm으로 설치하기 (Install with Helm)

운영 환경에서 앰비언트 모드로 Istio를 설치할 때는 Helm 사용을 권장해요. 통제된 업그레이드를 허용하기 위해 컨트롤 플레인과 데이터 플레인 컴포넌트를 별도로 패키징하고 설치해요. (앰비언트 데이터 플레인은 두 컴포넌트, 즉 ztunnel과 웨이포인트로 나뉘기 때문에, 업그레이드는 이 컴포넌트들에 대해 별도의 단계로 진행돼요.)

출처: Istio 문서

본문

사전 요구사항 (Prerequisites)

  1. 플랫폼별 사전 요구사항을 확인하세요.
  2. 버전 3.6 이상의 Helm 클라이언트를 설치하세요. Helm 4도 지원돼요.
  3. Helm 저장소를 구성하세요:
$ helm repo add istio https://blob.istio.io/istio-release/charts
$ helm repo update

컨트롤 플레인 설치하기 (Install the control plane)

기본 구성 값은 하나 이상의 --set <parameter>=<value> 인자로 바꿀 수 있어요. 또는 --values <file> 인자를 사용해 커스텀 values 파일에 여러 파라미터를 지정할 수 있어요.

Helm 설치를 사용하고 커스터마이즈하는 방법에 대한 자세한 내용은 사이드카 설치 문서에서 확인할 수 있어요.

설치·제거할 컴포넌트를 함께 묶는 istioctl 프로파일과 달리, Helm 프로파일은 단지 구성 값 그룹을 설정해요.

Base 컴포넌트 (Base components)

base 차트는 Istio를 설정하는 데 필요한 기본 CRD와 클러스터 역할을 포함해요. 다른 Istio 컴포넌트보다 먼저 설치해야 해요.

$ helm install istio-base istio/base -n istio-system --create-namespace --wait

쿠버네티스 Gateway API CRD 설치·업그레이드하기 (Install or upgrade the Kubernetes Gateway API CRDs)

쿠버네티스 Gateway API CRD는 대부분의 쿠버네티스 클러스터에 기본으로 설치되어 있지 않다는 점을 명심하세요. Gateway API를 사용하기 전에 설치되어 있는지 확인하세요:

$ kubectl get crd gateways.gateway.networking.k8s.io &> /dev/null || \
  kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.6.0/experimental-install.yaml

istiod 컨트롤 플레인 (istiod control plane)

istiod 차트는 한 버전(revision)의 Istiod를 설치해요. Istiod는 메시 안에서 트래픽을 라우팅하도록 프록시를 관리하고 구성하는 컨트롤 플레인 컴포넌트예요.

$ helm install istiod istio/istiod --namespace istio-system --set profile=ambient --wait

CNI 노드 에이전트 (CNI node agent)

cni 차트는 Istio CNI 노드 에이전트를 설치해요. 이것은 앰비언트 메시에 속한 파드를 감지하고, (나중에 설치될) 파드와 ztunnel 노드 프록시 사이의 트래픽 리디렉션을 구성하는 역할을 해요.

$ helm install istio-cni istio/cni -n istio-system --set profile=ambient --wait

데이터 플레인 설치하기 (Install the data plane)

ztunnel DaemonSet

ztunnel 차트는 ztunnel DaemonSet을 설치해요. 이는 Istio 앰비언트 모드의 노드 프록시 컴포넌트예요.

$ helm install ztunnel istio/ztunnel -n istio-system --wait

인그레스 게이트웨이 (Ingress gateway, 선택사항)

인그레스 게이트웨이를 설치하려면 아래 명령을 실행하세요:

$ helm install istio-ingress istio/gateway -n istio-ingress --create-namespace --wait

쿠버네티스 클러스터가 적절한 외부 IP가 할당된 LoadBalancer 서비스 타입(type: LoadBalancer)을 지원하지 않는다면, 무한 대기를 피하기 위해 위 명령을 --wait 파라미터 없이 실행하세요. 게이트웨이 설치에 대한 심층 문서는 게이트웨이 설치를 참조하세요.

구성 (Configuration)

지원되는 구성 옵션과 문서를 보려면 다음을 실행하세요:

$ helm show values istio/istiod

설치 검증하기 (Verify the installation)

워크로드 상태 검증하기 (Verify the workload status)

모든 컴포넌트를 설치한 후, 다음으로 Helm 배포 상태를 확인할 수 있어요:

$ helm ls -n istio-system
NAME            NAMESPACE       REVISION    UPDATED                                 STATUS      CHART           APP VERSION
istio-base      istio-system    1           2024-04-17 22:14:45.964722028 +0000 UTC deployed    base-1.31.1     1.31.1
istio-cni       istio-system    1           2024-04-17 22:14:45.964722028 +0000 UTC deployed    cni-1.31.1      1.31.1
istiod          istio-system    1           2024-04-17 22:14:45.964722028 +0000 UTC deployed    istiod-1.31.1   1.31.1
ztunnel         istio-system    1           2024-04-17 22:14:45.964722028 +0000 UTC deployed    ztunnel-1.31.1  1.31.1

배포된 파드의 상태는 다음으로 확인할 수 있어요:

$ kubectl get pods -n istio-system
NAME                             READY   STATUS    RESTARTS   AGE
istio-cni-node-g97z5             1/1     Running   0          10m
istiod-5f4c75464f-gskxf          1/1     Running   0          10m
ztunnel-c2z4s                    1/1     Running   0          10m

샘플 애플리케이션으로 검증하기 (Verify with the sample application)

Helm으로 앰비언트 모드를 설치한 후, 샘플 애플리케이션 배포 가이드를 따라 샘플 애플리케이션과 인그레스 게이트웨이를 배포하고, 그런 다음 애플리케이션을 앰비언트 메시에 추가할 수 있어요.

제거하기 (Uninstall)

위에서 설치한 차트들을 제거함으로써 Istio와 그 컴포넌트를 제거할 수 있어요.

  1. istio-system 네임스페이스에 설치된 모든 Istio 차트를 나열하세요:
$ helm ls -n istio-system
NAME            NAMESPACE       REVISION    UPDATED                                 STATUS      CHART           APP VERSION
istio-base      istio-system    1           2024-04-17 22:14:45.964722028 +0000 UTC deployed    base-1.31.1     1.31.1
istio-cni       istio-system    1           2024-04-17 22:14:45.964722028 +0000 UTC deployed    cni-1.31.1      1.31.1
istiod          istio-system    1           2024-04-17 22:14:45.964722028 +0000 UTC deployed    istiod-1.31.1   1.31.1
ztunnel         istio-system    1           2024-04-17 22:14:45.964722028 +0000 UTC deployed    ztunnel-1.31.1  1.31.1
  1. (선택사항) Istio 게이트웨이 차트 설치를 삭제하세요:
$ helm delete istio-ingress -n istio-ingress
$ kubectl delete namespace istio-ingress
  1. ztunnel 차트를 삭제하세요:
$ helm delete ztunnel -n istio-system
  1. Istio CNI 차트를 삭제하세요:
$ helm delete istio-cni -n istio-system
  1. istiod 컨트롤 플레인 차트를 삭제하세요:
$ helm delete istiod -n istio-system
  1. Istio base 차트를 삭제하세요:
$ helm delete istio-base -n istio-system
  1. (선택사항) Istio가 설치한 CRD를 삭제하세요:
$ kubectl get crd -oname | grep --color=never 'istio.io' | xargs kubectl delete
  1. istio-system 네임스페이스를 삭제하세요:
$ kubectl delete namespace istio-system

설치 전에 매니페스트 생성하기 (Generate a manifest before installation)

Istio를 설치하기 전에 helm template 하위 명령을 사용해 각 컴포넌트에 대한 매니페스트를 생성할 수 있어요. 예를 들어 istiod 컴포넌트에 대해 kubectl로 설치할 수 있는 매니페스트를 생성하려면:

$ helm template istiod istio/istiod -n istio-system --kube-version {Kubernetes version of target cluster} > istiod.yaml

생성된 매니페스트는 정확히 무엇이 설치되는지 검사하고 시간이 지나며 매니페스트의 변경 사항을 추적하는 데 사용할 수 있어요.

위에서 생성한 매니페스트를 설치하면 대상 클러스터에 istiod 컴포넌트가 생성돼요:

$ kubectl apply -f istiod.yaml

더 알아보기 (Learn more)