기술 이모저모/[Ops] Devops

[AWS][istio] istio profile 지정 & client, control plane 버전

Kobby 2023. 11. 26. 15:30

이전 게시물에서 istio operator를 통합 배포를 알아보았다.

그리고 istio operator 배포 코드를 보면 profile 부분과 tag: 1.20으로 명시한것을 볼 수 있었다.

이번 게시물에서는 istio profile와 tag와 버전에 대한 자세한 정보를 살펴보고자 한다.

 

[AWS][istio] istio-operator를 통한 istio 배포

오늘은 istio 설치 방법에 대해 정리를 해보고자 한다. istio docs를 들어가보면 다양한 설치 방법이 있다. 그리고 현재 재직중인 회사에서는 helm을 기반으로 설치를 했다. helm을 통해 istiod, istio-base,

dobby-isfree.tistory.com

istio operator 심화학습

istio profile

istio profile은 쉽게 말해서, istio에서 제공하는 기본 컴포넌트 세트이고 helm 기준에서는 chart가 된다.

요구사항에 따라 istiod만 설치할 수도 있고, istio ingressgateway까지 설치할 수도 있다. 이때 어떤 profile을 선택할지에 따라 다르다.

아래 캡처는 istio docs에서 제공해주는 그림이며, 직관적으로 알 수 있듯이 각 profile에 대해 설치되는 컴포넌트가 다르다는것을 의미한다.

  • 예를들어) default profile을 선택할 경우에는 istiod + istio-ingressgateway가 설치된다.
  • 그리고 demo를 선택하는 경우에는 default + istio-egressgateway까지 같이 설치가 된다.

istio profile

내가 필요로 하는 컴포넌트에 따라서 profile에 선택을 하면 되고, profile에 정의되어 있는 것이 아니라면 empty를 선택해서 내가 원하는 컴포넌트를 조합해서 배포할 수도 있다. 그리고 아래와 같이 istioctl을 통해서 현재 제공하는 profile을 볼 수 있다.

  • 기본적으로는 default를 기반으로 설치하면 된다.
  • ambient는 최근에 istio에서 개발하고 있는 ambient-mesh에 대한 profile이므로 아직 사용할 일은 없을것 같다.
❯ istioctl profile list
Istio configuration profiles:
    ambient
    default
    demo
    empty
    external
    minimal
    openshift
    preview
    remote

그리고 profile dump를 통해서 해당 profile에서 설치되는 컴포넌트를 istio operator로 배포할 때 yaml을 볼 수 있다.

아래 yaml을 그대로 복사해서, 필요한 부분만 변경해서 istio operator를 배포해도 된다 또는 내가 작성한 istio operator yaml에서 어떤 값을 넣을 지 모를때 예시를 보고 참조하면 된다.

❯ istioctl profile dump default
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  components:
    base:
      enabled: true
    cni:
      enabled: false
    egressGateways:
    - enabled: false
      name: istio-egressgateway
    ingressGateways:
    - enabled: true
      name: istio-ingressgateway
    istiodRemote:
      enabled: false
    pilot:
      enabled: true
  hub: docker.io/istio
  meshConfig:
    defaultConfig:
      proxyMetadata: {}
    enablePrometheusMerge: true
'''

istio client, control plane 버전 업그레이드

아래 그림은 istio docs에서 제공해주는 각 k8s 버전별로 설치 가능한 istio 버전이다.

즉, k8s 버전에 따라 istio 버전은 종속적이다. 그말인즉슨, istio 버전을 주기적으로 올려줄 필요가 있다는뜻이다.

istio 버전 + k8s

istio-operator에서 tag 필드를 지정하지 않으면 현재 local pc의 client version을 기준으로 버전이 정해진다.

 

istio 버전에 따른 배포 실패

만약 local pc에서 client가 1.16인데 istio-operator에서 1.20으로 배포를 하면 아래와 같은 배포에러가 발생한다.

istio 버전 에러

 

처음에는 왜 안될까.. 왜 안될까.. 찾아봤는데 결국에는 istio 버전에 다른 문제였다.

현재 local client, control plane 모두 1.16 istio를 사용하고 있다. 근데 1.20을 배포하려고 하니 당연히 안되는것이였다.

istio 버전 확인

istio 버전 업그레이드

업그레이드 하는 방법은 간단하다. 먼저 client 버전을 올린 다음에 -> control plane 버전을 올리고 -> 배포하면 된다.

 

local pc client 버전 업그레이드

Mac 기준으로는 brew로 바로 업그레이드 가능하다. 그리고 업그레이드 이후 버전을 확인해보면 client는 올라갔다.

brew upgrade istioctl
---
❯ istioctl version
client version: 1.20.0
control plane version: 1.16.1
data plane version: 1.16.1 (6 proxies)

 

control plane 버전 업그레이드

istioctl로 간단하게 업그레이드 할 수 있고, 별도 옵션을 하지 않았기 때문에 default profile에 업그레이드가 된다.

  • 그리고 이렇게 업그레이드를 하면 istio-system에 istio-ingressgateway가 1개 배포되므로 지워주도록 하자.
❯ istioctl upgrade
This will install the Istio 1.20.0 "default" profile (with components: Istio core, Istiod, and Ingress gateways) into the cluster. Proceed? (y/N) y
✔ Istio core installed
✔ Istiod installed
✔ Ingress gateways installed
✔ Installation complete                                                                                                                                                                                                                     Made this installation the default for injection and validation.
---
❯ istioctl version
client version: 1.20.0
control plane version: 1.20.0
data plane version: 1.16.1 (1 proxies), 1.20.0 (1 proxies)

위 결과를 보면 data plane, 즉 k8s에 배포되어 있는 pod 정보를 나타나게 된다. 그리고 이는 1.16.1을 사용하는 pod 1개/1.20.0을 사용하는 pod 1개가 있음을 알려준다.

 

그리고 이 상태에서는 istio client, k8s control plane이 모두 1.20.0으로 업그레이드가 되었기 때문에 istio-operator yaml에서 tag: 1.20으로 배포해도 문제가 안생긴다.

 

회사에서 처음 istio를 접했을 때 k8s의 일반적인 kind가 아니라서, 좀 어려운점이 많았는데 조금만 Docs를 살펴보니 어렵지 않았다.

(아직 많이 모르고, 특히 EnvoyFilter는 거의..... 무지하다.)

 

잘 사용하는것과 단순히 설치하고/버전 업그레이드하는것은 별개의 문제겠지만, 설치하는것은 어협지 않다.

이렇게 하나씩 하나씩 발전해나가면 그것으로도 의미가 있다고 생각한다. 그럼 이만!!