3. アップグレード

3.1. 目的

本書では、Exastro システムのアップグレード方法について紹介します。

3.2. 前提条件

  • Exastro システムが導入済みであること

  • クライアント要件

    動作確認が取れているクライアントアプリケーションのバージョンは下記のとおりです。
    表 3.68 クライアント要件

    アプリケーション

    バージョン

    Helm

    v3.9.x

    kubectl

    1.23

3.3. アップグレードの準備

警告

アップグレード実施前に データバックアップ・リストア の手順に従い、バックアップを取得しておくことを推奨します。

3.3.1. Helm リポジトリの更新

Exastro システムの Helm リポジトリを更新します。
更新前のバージョンを確認します。
リスト 3.31 コマンド
1# リポジトリ情報の確認
2helm search repo exastro
リスト 3.32 実行結果
1helm search repo exastro
2NAME                            CHART VERSION   APP VERSION     DESCRIPTION
3exastro/exastro                 1.0.0           2.0.3           A Helm chart for Exastro. Exastro is an Open So...
4exastro/exastro-it-automation   1.2.0           2.0.3           A Helm chart for Exastro IT Automation. Exastro...
5exastro/exastro-platform        1.5.0           1.4.0           A Helm chart for Exastro Platform. Exastro Plat...
Helm リポジトリを更新します。
リスト 3.33 コマンド
1# リポジトリ情報の更新
2helm repo update
更新後のバージョンを確認します。
リスト 3.34 コマンド
1# リポジトリ情報の確認
2helm search repo exastro
リスト 3.35 実行結果
1helm search repo exastro
2NAME                            CHART VERSION   APP VERSION     DESCRIPTION
3exastro/exastro                 1.0.1           2.1.0           A Helm chart for Exastro. Exastro is an Open So...
4exastro/exastro-it-automation   1.2.0           2.0.3           A Helm chart for Exastro IT Automation. Exastro...
5exastro/exastro-platform        1.5.0           1.4.0           A Helm chart for Exastro Platform. Exastro Plat...

3.3.2. デフォルト設定値の更新の確認

デフォルト値の更新を確認します。
インストール時に作成した設定ファイル exastro.yaml とアップグレード後の設定ファイルを比較します。
リスト 3.36 コマンド
diff exastro.yaml <(helm show values exastro/exastro)
リスト 3.37 実行結果
exastro-platform:
  platform-api:
    image:
      repository: "exastro/exastro-platform-api"
       tag: ""

  platform-auth:
+    extraEnv:
+      # Please set the URL to access
+      EXTERNAL_URL: ""
+      EXTERNAL_URL_MNG: ""
    ingress:
      enabled: true
      hosts:
        - host: exastro-suite.example.local
          paths:

3.3.3. 設定値の更新

デフォルト設定値の比較結果から、項目の追加などにより設定値の追加が必要な場合は更新をしてください。
設定値の更新が不要であればこの手順はスキップしてください。
例えば下記の差分確認結果から、exastro-platform.platform-auth.extraEnv が追加されていますので、必要に応じて、exastro.yaml に項目と設定値を追加します。
リスト 3.38 実行結果
exastro-platform:
  platform-api:
    image:
      repository: "exastro/exastro-platform-api"
       tag: ""

  platform-auth:
+    extraEnv:
+      # Please set the URL to access
+      EXTERNAL_URL: ""
+      EXTERNAL_URL_MNG: ""
    ingress:
      enabled: true
      hosts:
        - host: exastro-suite.example.local
          paths:

3.4. アップグレード

3.4.1. サービス停止

  1. Pod 起動数の確認

    作業前の Pod 起動数の確認をし、状態を記録します。
    リスト 3.39 コマンド
    RS_AE=`kubectl get deploy ita-by-ansible-execute -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_ALRV=`kubectl get deploy ita-by-ansible-legacy-role-vars-listup -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_ATS=`kubectl get deploy ita-by-ansible-towermaster-sync -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_CS=`kubectl get deploy ita-by-conductor-synchronize -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_MC=`kubectl get deploy ita-by-menu-create -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_PA=`kubectl get deploy platform-auth -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    
    以下はITA2.1.0以降からITA2.1.1以降にバージョンアップする際に実行してください。
    RS_ALV=`kubectl get deploy ita-by-ansible-legacy-vars-listup -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_APV=`kubectl get deploy ita-by-ansible-pioneer-vars-listup -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_CFI=`kubectl get deploy ita-by-cicd-for-iac -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_CR=`kubectl get deploy ita-by-conductor-regularly -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_COL=`kubectl get deploy ita-by-collector -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_EEI=`kubectl get deploy ita-by-excel-export-import -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_HS=`kubectl get deploy ita-by-hostgroup-split -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_MEI=`kubectl get deploy ita-by-menu-export-import -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_TCE=`kubectl get deploy ita-by-terraform-cli-execute -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_TCV=`kubectl get deploy ita-by-terraform-cli-vars-listup -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_TCEE=`kubectl get deploy ita-by-terraform-cloud-ep-execute -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    RS_TCEV=`kubectl get deploy ita-by-terraform-cloud-ep-vars-listup -o jsonpath='{@.spec.replicas}{"\n"}' -n exastro`
    
  2. リバースプロキシの停止

    リバースプロキシ (platform-auth) の Pod 起動数を 0 に変更し、エンドユーザーからのアクセスを制限します。
    リスト 3.40 コマンド
    kubectl scale deployment platform-auth -n exastro --replicas=0
    
  3. バックヤード処理の停止

    バックヤード処理 (ita-by-***) の Pod 起動数を 0 に変更し、データベースの更新を停止します。
    リスト 3.41 コマンド
    kubectl scale deployment ita-by-ansible-execute -n exastro --replicas=0
    kubectl scale deployment ita-by-ansible-legacy-role-vars-listup -n exastro --replicas=0
    kubectl scale deployment ita-by-ansible-towermaster-sync -n exastro --replicas=0
    kubectl scale deployment ita-by-conductor-synchronize -n exastro --replicas=0
    kubectl scale deployment ita-by-menu-create -n exastro --replicas=0
    
    以下はITA2.1.0以降からITA2.1.1以降にバージョンアップする際に実行してください。
    kubectl scale deployment ita-by-ansible-legacy-vars-listup -n exastro --replicas=0
    kubectl scale deployment ita-by-ansible-pioneer-vars-listup -n exastro --replicas=0
    kubectl scale deployment ita-by-cicd-for-iac -n exastro --replicas=0
    kubectl scale deployment ita-by-collector -n exastro --replicas=0
    kubectl scale deployment ita-by-conductor-regularly -n exastro --replicas=0
    kubectl scale deployment ita-by-excel-export-import -n exastro --replicas=0
    kubectl scale deployment ita-by-hostgroup-split -n exastro --replicas=0
    kubectl scale deployment ita-by-menu-export-import -n exastro --replicas=0
    kubectl scale deployment ita-by-terraform-cli-execute -n exastro --replicas=0
    kubectl scale deployment ita-by-terraform-cli-vars-listup -n exastro --replicas=0
    kubectl scale deployment ita-by-terraform-cloud-ep-execute -n exastro --replicas=0
    kubectl scale deployment ita-by-terraform-cloud-ep-vars-listup -n exastro --replicas=0
    
  4. Pod 起動数の確認

    上記で停止した対象の Pod 数が 0 になっていることを確認
    リスト 3.42 コマンド
    kubectl get deployment -n exastro
    
    リスト 3.43 実行結果
    NAME                                     READY   UP-TO-DATE   AVAILABLE   AGE
    mariadb                                  1/1     1            1           3h41m
    ita-web-server                           1/1     1            1           3h41m
    platform-web                             1/1     1            1           3h41m
    ita-api-admin                            1/1     1            1           3h41m
    ita-api-organization                     1/1     1            1           3h41m
    platform-api                             1/1     1            1           3h41m
    keycloak                                 1/1     1            1           3h41m
    ita-by-menu-create                       0/0     0            0           3h41m
    ita-by-ansible-execute                   0/0     0            0           3h41m
    ita-by-ansible-legacy-role-vars-listup   0/0     0            0           3h41m
    ita-by-ansible-towermaster-sync          0/0     0            0           3h41m
    ita-by-conductor-synchronize             0/0     0            0           3h41m
    platform-auth                            0/0     0            0           3h41m
    
    以下はITA2.1.0以降からITA2.1.1以降にバージョンアップする際に確認してください。
    NAME                                     READY   UP-TO-DATE   AVAILABLE   AGE
    ita-by-ansible-legacy-vars-listup        0/0     0            0           3h41m
    ita-by-ansible-pioneer-vars-listup       0/0     0            0           3h41m
    ita-by-cicd-for-iac                      0/0     0            0           3h41m
    ita-by-collector                         0/0     0            0           3h41m
    ita-by-conductor-regularly               0/0     0            0           3h41m
    ita-by-excel-export-import               0/0     0            0           3h41m
    ita-by-hostgroup-split                   0/0     0            0           3h41m
    ita-by-menu-export-import                0/0     0            0           3h41m
    ita-by-terraform-cli-execute             0/0     0            0           3h41m
    ita-by-terraform-cli-vars-listup         0/0     0            0           3h41m
    ita-by-terraform-cloud-ep-execute        0/0     0            0           3h41m
    ita-by-terraform-cloud-ep-vars-listup    0/0     0            0           3h41m
    

3.4.2. アップグレード実施

アップグレードを実施します。
リスト 3.44 コマンド
helm upgrade exastro exastro/exastro \
  --namespace exastro \
  --values exastro.yaml
リスト 3.45 出力結果
NAME: exastro
LAST DEPLOYED: Sat Jan 28 15:00:02 2023
NAMESPACE: exastro
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
Exastro install completion!

1. Execute the following command and wait until the pod becomes "Running" or "Completed":

  # NOTE: You can also append "-w" to the command or wait until the state changes with "watch command"

  kubectl get pods --namespace exastro

2. Get the ENCRYPT_KEY by running these commands:

  # Exastro IT Automation ENCRYPT_KEY
  kubectl get secret ita-secret-ita-global -n exastro -o jsonpath='{.data.ENCRYPT_KEY}' | base64 -d

  # Exastro Platform ENCRYPT_KEY
  kubectl get secret platform-secret-pf-global -n exastro -o jsonpath='{.data.ENCRYPT_KEY}' | base64 -d

  !!! Please save the output ENCRYPT_KEY carefully. !!!

3. Run the following command to get the application URL and go to the URL or go to the displayed URL:
  *************************
  * Service Console       *
  *************************
  http://exastro-suite.example.local/

  *************************
  * Administrator Console *
  *************************
  http://exastro-suite-mng.example.local/auth/


  # Note: You can display this note again by executing the following command.

3.4.3. サービス再開

  1. サービス再開

    サービス停止時に取得した各 Deployment の Pod 起動数を元に戻します。
    リスト 3.46 コマンド
    kubectl scale deployment ita-by-ansible-execute -n exastro --replicas=${RS_AE}
    kubectl scale deployment ita-by-ansible-legacy-role-vars-listup -n exastro --replicas=${RS_ALRV}
    kubectl scale deployment ita-by-ansible-towermaster-sync -n exastro --replicas=${RS_ATS}
    kubectl scale deployment ita-by-conductor-synchronize -n exastro --replicas=${RS_CS}
    kubectl scale deployment ita-by-menu-create -n exastro --replicas=${RS_MC}
    kubectl scale deployment platform-auth -n exastro --replicas=${RS_PA}
    
    以下はITA2.1.0以降からITA2.1.1以降にバージョンアップする際に実行してください。
    kubectl scale deployment ita-by-ansible-legacy-vars-listup -n exastro --replicas=${RS_ALV}
    kubectl scale deployment ita-by-ansible-pioneer-vars-listup -n exastro --replicas=${RS_APV}
    kubectl scale deployment ita-by-cicd-for-iac -n exastro --replicas=${RS_CFI}
    kubectl scale deployment ita-by-conductor-regularly -n exastro --replicas=${RS_CR}
    kubectl scale deployment ita-by-collector -n exastro --replicas=${RS_COL}
    kubectl scale deployment ita-by-excel-export-import -n exastro --replicas=${RS_EEI}
    kubectl scale deployment ita-by-hostgroup-split -n exastro --replicas=${RS_HS}
    kubectl scale deployment ita-by-menu-export-import -n exastro --replicas=${RS_MEI}
    kubectl scale deployment ita-by-terraform-cli-execute -n exastro --replicas=${RS_TCE}
    kubectl scale deployment ita-by-terraform-cli-vars-listup -n exastro --replicas=${RS_TCV}
    kubectl scale deployment ita-by-terraform-cloud-ep-execute -n exastro --replicas=${RS_TCEE}
    kubectl scale deployment ita-by-terraform-cloud-ep-vars-listup -n exastro --replicas=${RS_TCEV}
    
  2. Pod 起動数の確認

    上記で起動した対象の Pod 数が元に戻りすべて READY になっていることを確認
    リスト 3.47 コマンド
    kubectl get deployment -n exastro
    
    リスト 3.48 実行結果
    NAME                                     READY   UP-TO-DATE   AVAILABLE   AGE
    ita-api-admin-7c78cc475-xt8kh                             1/1     Running     0             47m
    ita-api-organization-f4bccc5c4-8txpj                      1/1     Running     0             47m
    ita-by-ansible-execute-666d5bdf86-bt94w                   1/1     Running     0             47m
    ita-by-ansible-legacy-role-vars-listup-79c5cfdf7c-wntg5   1/1     Running     0             47m
    ita-by-ansible-legacy-vars-listup-7b7f5fb88c-nqzrd        1/1     Running     0             47m
    ita-by-ansible-pioneer-vars-listup-5d5f5b589-d4hn9        1/1     Running     0             47m
    ita-by-ansible-towermaster-sync-548bd8c867-2vp9z          1/1     Running     0             47m
    ita-by-cicd-for-iac-558986b4c5-fk7bh                      1/1     Running     0             47m
    ita-by-collector-59ff796d8c-xc4dx                         1/1     Running     0             47m
    ita-by-conductor-regularly-b5c5dd6dc-7t8km                1/1     Running     0             47m
    ita-by-conductor-synchronize-787f9fd8f7-mxsw6             1/1     Running     0             47m
    ita-by-excel-export-import-66db589589-xv5zz               1/1     Running     0             47m
    ita-by-hostgroup-split-8459fb48fc-ltrtb                   1/1     Running     0             47m
    ita-by-menu-create-5bc6849cd5-xkm6r                       1/1     Running     0             47m
    ita-by-menu-export-import-84ccc5467-9fnb8                 1/1     Running     0             47m
    ita-by-terraform-cli-execute-695ffbd4c-pqkwj              1/1     Running     0             47m
    ita-by-terraform-cli-vars-listup-6dcccf9585-nxbkj         1/1     Running     0             47m
    ita-by-terraform-cloud-ep-execute-7bbfcd6f6c-fkqpd        1/1     Running     0             47m
    ita-by-terraform-cloud-ep-vars-listup-5d4c7c94ff-7gmsk    1/1     Running     0             47m
    ita-migration-1.0.5-iql5                                  0/1     Completed   0             47m
    ita-web-server-75f8c85f7c-vvkp5                           1/1     Running     0             47m
    keycloak-9d464565b-zwq6b                                  1/1     Running     0             47m
    platform-api-57bff76cc-fmdcn                              1/1     Running     0             47m
    platform-auth-54c7f8bcc8-lmgv6                            1/1     Running     0             47m
    platform-migration-1.4.3-gs4x                             0/1     Completed   0             47m
    platform-web-7d74bb98d-srtdp                              1/1     Running     0             47m
    

3.4.4. アップグレード状況確認

コマンドラインから以下のコマンドを入力して、アップグレードが完了していることを確認します。
リスト 3.49 コマンド
# Pod の一覧を取得
kubectl get po -n exastro
正常に起動している場合は、ita-migration-xxxとplatform-migration-xxxが “Completed” 、その他すべてが “Running” となります。
※正常に起動するまで数分かかる場合があります。
リスト 3.50 出力結果
 NAME                                                      READY   STATUS      RESTARTS   AGE
 ita-api-admin-64657656c6-r4s2l                            1/1     Running     0          30m
 ita-api-organization-75ff9d599c-gthvl                     1/1     Running     0          30m
 ita-by-ansible-execute-fdd8dfc57-7676h                    1/1     Running     0          30m
 ita-by-ansible-legacy-role-vars-listup-6cd558d78b-xxl6x   1/1     Running     0          30m
 ita-by-ansible-legacy-vars-listup-5db44d54d8-zxqj7        1/1     Running     0          30m
 ita-by-ansible-pioneer-vars-listup-6bf744f5b6-k8ctx       1/1     Running     0          30m
 ita-by-ansible-towermaster-sync-59594b5d84-phbg7          1/1     Running     0          30m
 ita-by-cicd-for-iac-f6855c588-r6w4k                       1/1     Running     0          30m
 ita-by-collector-6fc8c7b4d4-hjwck                         1/1     Running     0          30m
 ita-by-conductor-regularly-5897dcb9f6-4npz7               1/1     Running     0          30m
 ita-by-conductor-synchronize-6fd6dcd5f4-qgdhx             1/1     Running     0          30m
 ita-by-excel-export-import-df76d77c4-ms4j2                1/1     Running     0          30m
 ita-by-hostgroup-split-86746f758-b796k                    1/1     Running     0          30m
 ita-by-menu-create-8588c9747d-66xwn                       1/1     Running     0          30m
 ita-by-menu-export-import-6b8498f476-zwml7                1/1     Running     0          30m
 ita-by-terraform-cli-execute-8478554d8d-qztbv             1/1     Running     0          30m
 ita-by-terraform-cli-vars-listup-bf688659d-zgh8d          1/1     Running     0          30m
 ita-by-terraform-cloud-ep-execute-5dbbb599b-qh8rc         1/1     Running     0          30m
 ita-by-terraform-cloud-ep-vars-listup-5564fcb5b-nphm7     1/1     Running     0          30m
 ita-migration-1.0.4-0wdt                                  0/1     Completed   0          30m
 ita-web-server-854bcdbbf4-s7fdb                           1/1     Running     0          30m
 keycloak-56d8b4556c-tndnv                                 1/1     Running     0          30m
 platform-api-bddb446db-s9zjh                              1/1     Running     0          30m
 platform-auth-799f57fb6c-wlbtf                            1/1     Running     0          30m
 platform-migration-1.4.2-6sks                             0/1     Completed   0          30m
 platform-web-88db7c489-wkmn9                              1/1     Running     0          30m