2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[IBMCloud] IKS/ROKS環境でKeyProtectを削除してしまった場合の挙動と復旧方法

Last updated at Posted at 2025-09-26

目的

IBM Cloud Kubernetes Serviceクラスター内のClusterとWorkerをKeyProtectで暗号化し、
その後、誤ってKeyProtectのKeyを無効/削除してしまったことを想定した挙動を確認する
https://cloud.ibm.com/docs/containers?topic=containers-encryption#worker-encryption-vpc

各パターンごとに動作を確認する

パターン Worker Pool Encryption Cluster Encryption
A ON ON
B OFF ON
C ON OFF

◾️作成したKeyをClusterに適用してオーダする
image.png
image.png

ON = Encryptionを有効化
OFF = Encryptionを無効化

全クラスタはROKS4.18(RHCOS WorkerNode)


Key Protectの作成

検索画面にて「Key」等で検索し、Key Protectを選択
image.png

Select a location -> 利用予定のロケーションを選択
Service Name -> KeyProtectインスタンスの名前
Allowed network polocy -> PublicとPrivateもしくはPrivate Onlyどちらで使うか選択

最後にCreateを選択
image.png

作成完了
image.png

◾️Root Keyの追加
Keys -> Addを選択
image.png

Root Key -> KeyNameを選択 -> Add Keyを選択
image.png


削除テストの実施

A/B/Cのパターンに同一のRootKeyを使用し、
RootKeyを削除した時にClusterやWorkerNodeがどうなるか確認する

状態確認
ClusterはA/B/C全て正常
image.png

A Worker

% oc get node
NAME                                                STATUS   ROLES    AGE     VERSION
kube-d3au4drt0e3chbtpk560-dltest-default-0000019c   Ready    worker   6m23s   v1.31.12
kube-d3au4drt0e3chbtpk560-dltest-default-00000201   Ready    worker   6m19s   v1.31.12

B Worker

% oc get node
NAME                                                    STATUS   ROLES    AGE     VERSION
kube-d3au5sat05lsk8k5pen0-dltestonly-default-0000013a   Ready    worker   5m15s   v1.31.12
kube-d3au5sat05lsk8k5pen0-dltestonly-default-000002fc   Ready    worker   5m27s   v1.31.12

C Worker

% oc get node
NAME                                                     STATUS   ROLES    AGE     VERSION
kube-d3au6fut027mlilpk56g-dltestcluso-default-00000156   Ready    worker   2m56s   v1.31.12
kube-d3au6fut027mlilpk56g-dltestcluso-default-000002ac   Ready    worker   2m27s   v1.31.12

RootKey Disableテスト

Root Keyのdisableを実施

貼り付けた画像_2025_09_26_10_40.png

A/CパターンでMaster Statusが「Key management service enablement in progress.」となる
image.png

WorkerNodeをリプレイスを試行

全パターンでステータスが下記となり、プロビジョニングが失敗する
image.png

Status
Attempting to provision worker (attempt 3) - 'vpc-gen2' infrastructure exception: The CRN specified in the request is not valid.

RootKeyを無効後、しばらく放置

A/Cのパターン(WorkerNode Encryptionを有効化しているパターン)のみWorkerNodeステータスがクリティカルとなる。
image.png

RootKeyのEnableの実施

RootKeyをEnableとしエラーが解消するか確認
プロビジョニングが失敗していたノードは、有効化するとWorkerNodeのプロビジョニングが再開された

貼り付けた画像_2025_09_26_10_41.png

Status
Infrastructure instance status is 'starting'

WorkerNodeステータスがクリティカルとなっていたノードも復旧
image.png

RootKeyの削除と復旧

RootKeyの削除

貼り付けた画像_2025_09_26_13_07.png

KeyNameを入力し、チェックマークを選択後、Delete Keyを選択
貼り付けた画像_2025_09_26_13_07.png

RootKeyの復元

RootKeyの削除後、30日以内であればまだ復旧が可能
https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys&interface=ui#restore-ui

Keysページのフィルターを選択し、復旧対象を表示する
貼り付けた画像_2025_09_26_13_12.png

Stateフィルターで「Deleted」のみを選択し、Applyを選択
貼り付けた画像_2025_09_26_13_13.png

削除したが復旧可能なRootKeyが表示されるので、「Restore」を選択
貼り付けた画像_2025_09_26_13_14.png

Restore Keyを選択
image.png

フィルタを元に戻して復旧されたか確認
貼り付けた画像_2025_09_26_13_15.png

復旧を確認
貼り付けた画像_2025_09_26_13_16.png

ClusterのWorkerNodeのエラーはRootKeyを復旧すれば、しばらく経過後にエラーは解消される。

2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?