Tweet
Logo
    Istio のバージョン更新について
    Istio のバージョン更新について

    Istio のバージョン更新について

    • はじめに
    • 準備を行う
    • operator のインストール
    • istiod and Gateway が動いている事を確認する
    • Istio Operator のバージョン更新
    • 結果を確認

    はじめに

    Istio のバージョンの更新についてまとめたので記載します

    istio は istio operator を使って install をして管理する前提とします (他のインストール方法ではバージョン更新の方法が変わるはずです)

    * istio operator とは kubernetes の operator pattern に準拠した istio 公式の operator です

    準備を行う

    operator のインストール

    公式のチュートリアルに従って istio operator を使って istio をインストールします

    https://istio.io/latest/docs/setup/install/operator/

    DROBE では ArgoCD を使っているので、直接 istioctl を叩かずに helm の chart から作った manifest を git にコミットして使います。まずは、helm chart を local 環境にダウンロードします

    https://istio.io/latest/docs/setup/getting-started/#download

    このような形でバージョンを指定してダウンロードしてください

    curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.8.2 TARGET_ARCH=x86_64 sh -
    helm chart をダウンロードするワンライナー

    ダウンロードしたフォルダの /manifests 以下が helm chart になっているので、下記コマンドで manifest を file に落としてコミット可能な状態にします

    helm template istio-1.8.2/manifests/charts/istio-operator/ \
      --set hub=docker.io/istio \
      --set tag=1.8.2 \
      --set operatorNamespace=istio-operator \
      --set watchedNamespaces=istio-system \
      --set enableCRDTemplates=true \
      > operator.yaml
    helm chart から manifest を作るコマンド

    ここで作られた operator.yaml を apply すれば namespace と同時に operator が作られます

    作られた operator は下記のコマンドで確認が可能です

    $ kubectl get po -n istio-operator

    また、operator が意図したバージョンのものかを下記コマンドで確認可能です https://istio.io/latest/docs/setup/install/operator/#in-place-upgrade

    kubectl get pods --namespace istio-operator \
      -o=jsonpath='{range .items[*]}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{"\n"}{end}'

    istiod and Gateway が動いている事を確認する

    istiod (istio の control plane) は profile が remote / empty 以外の場合は作れます https://istio.io/latest/blog/2020/istiod/

    istio ingress gateway は istio-system namespace に作られる pod と service (type = LoadBalancer) です

    IstioOperator で profile = default で install していると 1 台勝手に作られます https://istio.io/latest/docs/setup/additional-setup/config-profiles/

    // pod が動いている事を確認
    $ kubectl get po -n istio-system
    NAME                                     READY   STATUS    RESTARTS   
    istio-ingressgateway                     1/1     Running   0          
    istiod                                   1/1     Running   0          

    Istio Operator のバージョン更新

    アップグレードしたいバージョンを指定して istio を再度ダウンロードします

    curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.9.1 TARGET_ARCH=x86_64 sh -
    helm chart をダウンロードするワンライナー

    再度下記コマンドで manifest を file に落としてコミット可能な状態にします

    helm template istio-1.9.1/manifests/charts/istio-operator/ \
      --set hub=docker.io/istio \
      --set tag=1.9.1 \
      --set operatorNamespace=istio-operator \
      --set watchedNamespaces=istio-system \
      --set enableCRDTemplates=true \
      > operator.yaml
    helm chart から manifest を作るコマンド

    ArgoCD 管理下の operator の manifest にコミットします (下記は 1.8.2 と 1.9.1 の diff です)

    Istio operator 1.8.2 と 1.9.1 の diff

    更新したら apply します

    結果を確認

    apply すると、以下が順番に発生します

    • operator の更新
    • gateway の更新 (pod / service 共に更新される)

    以下のコマンドで各種バージョンチェックを行ってください

    operator のバージョンチェック

    https://istio.io/latest/docs/setup/install/operator/#in-place-upgrade

    kubectl get pods --namespace istio-operator \
      -o=jsonpath='{range .items[*]}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{"\n"}{end}'

    [注] istio 1.12 系から operator の namespace が default に移行したので、バージョンの確認は下記のコマンドになります

    kubectl get pods \
      -o=jsonpath='{range .items[*]}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{"\n"}{end}'

    gateway のバージョンチェック

    // version check
    kubectl get pods --namespace istio-system \
      -o=jsonpath='{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{"\n"}{end}'

    バージョンが意図したものになっていれば更新作業は完了です

    © 2025 DROBE All rights reserved.
    diff --git a/istio-operator/operator.yaml b/istio-operator/operator.yaml
    index 787ae3e..8b60283 100644
    --- a/istio-operator/operator.yaml
    +++ b/istio-operator/operator.yaml
    @@ -122,9 +122,7 @@ rules:
       - daemonsets
       - deployments
       - deployments/finalizers
    -  - ingresses
       - replicasets
    -  - statefulsets
       verbs:
       - '*'
     - apiGroups:
    @@ -156,6 +154,14 @@ rules:
       - rolebindings
       verbs:
       - '*'
    +- apiGroups:
    +  - coordination.k8s.io
    +  resources:
    +  - leases
    +  verbs:
    +  - get
    +  - create
    +  - update
     - apiGroups:
       - ""
       resources:
    @@ -222,7 +228,7 @@ spec:
           serviceAccountName: istio-operator
           containers:
             - name: istio-operator
    -          image: docker.io/istio/operator:1.8.2
    +          image: docker.io/istio/operator:1.9.1
               command:
               - operator
               - server