Harbor Registry を使用した Tanzu Kubernetes Grid サービスで、Cert-Manager パッケージの調整が ImagePull エラーと「不明な BLOB」メッセージで失敗する
search cancel

Harbor Registry を使用した Tanzu Kubernetes Grid サービスで、Cert-Manager パッケージの調整が ImagePull エラーと「不明な BLOB」メッセージで失敗する

book

Article ID: 422075

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

免責事項:これは英文の記事「Cert-Manager Package Reconciliation Fails with ImagePull Error and “Unknown Blob” Message in Tanzu Kubernetes Grid Service with Harbor Registry」の日本語訳です。記事はベストエフォートで翻訳を進めているため、ローカライズ化コンテンツは最新情報ではない可能性があります。最新情報は英語版の記事で参照してください。

この記事では、Harbor レジストリをパッケージリポジトリとして使用している Tanzu Kubernetes Grid Service(vSphere with Tanzu)環境において、cert-manager パッケージの調停(reconciliation)が失敗する問題について説明します。

管理者は、Harbor からパッケージイメージを取得する際に、ImagePull エラーunknown blobメッセージが発生し、cert-manager のデプロイメントが失敗することを確認する場合があります。

この問題は通常、Tanzu パッケージリポジトリが参照している Harbor リポジトリの参照先が無効、またはすでに存在しない場合に発生します。Harbor UI 上ではイメージ名が表示されていても、実体が存在していないケースです。

  • cert-manager パッケージの調停に失敗する。
  • パッケージが tanzu package installed list -A 実行時に reconciling または failed と表示される。
  • ログに unknown blob を伴う ImagePull 失敗が表示される。
  • Harbor UI 上には問題のイメージが表示されるが、閲覧や pull ができない。
  • 手動で crictl pulldocker pull を実行しても pull に失敗する。

観測された事象: kubectl get apps -A コマンドは、影響を受けるパッケージについて以下のように表示します:

 

NAMESPACE NAME DESCRIPTION

cert-manager-ns cert-manager Reconcile failed: Deploying: Error (see .status.usefulErrorMessage for details)

 

kubectl get pod -A | grep cert の出力は以下の通りです:

 

NAMESPACE NAME STATUS

cert-manager-ns cert-manager-<hash> 0/1 ImagePullBackOff

cert-manager-ns cert-manager-cainjector-<hash> 0/1 ImagePullBackOff

cert-manager-ns cert-manager-webhook-<hash> 0/1 ImagePullBackOff

 

kubectl describe apps の出力:

 

fail: reconcile deployment/cert-manager (apps/v1) namespace: cert-manager-ns

^ Deployment is not progressing: ProgressDeadlineExceeded, message: ReplicaSet "cert-manager-<hash>" has timed out progressing.

Fetch:

Exit Code: 0

Stdout: apiVersion: vendir.k14s.io/v1alpha1

directories:

- contents:

- imgpkgBundle:

image: <internal-harbor-registry>/vks3.3.1/tanzu-packages/packages/standard/repo@sha256:<hash>

path: .

path: "0"

kind: LockConfig

Friendly Description: Reconcile failed: Deploying: Error (see .status.usefulErrorMessage for details)

Useful Error Message: kapp: Error: waiting on reconcile deployment/cert-manager (apps/v1) namespace: cert-manager-ns:

Finished waiting unsuccessfully:

Deployment is not progressing:

ProgressDeadlineExceeded, message:

ReplicaSet "cert-manager-<hash>" has timed out progressing.

Events: <none>

Pod Describe 出力:

QoS Class: BestEffort

Node-Selectors: kubernetes.io/os=linux

Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s

node.kubernetes.io/unreachable:NoExecute op=Exists for 300s

Events:

Type Reason Age From Message

---- ------ ---- ---- -------

Normal BackOff 116s (x14851 over 2d8h) kubelet Back-off pulling image "<internal-harbor-registry>/vks3.3.1/tanzu-packages/packages/standard/repo@sha256:<hash>"

Warning Failed 116s (x14851 over 2d8h) kubelet Error: ImagePullBackOff

手動でのイメージ Pull 試行: ブートストラップマシンで手動で pull を試行すると、以下のようになります:

$ docker pull <internal-harbor-registry>/vks3.3.1/tanzu-packages/packages/standard/repo@sha256:<hash>

<internal-harbor-registry>/vks3.3.1/tanzu-packages/packages/standard/repo@sha256:<hash>: Pulling from vks3.3.1/tanzu-packages/packages/standard/repo

<layer-hash>: Pull complete

<layer-hash>: Pull complete

...

unknown blob

 

Environment

  • Tanzu Kubernetes Grid Service
  • VMware Kubernetes Service (VKS) 
  • Harbor Registry (embedded or external)

Cause

この問題は、Tanzu パッケージリポジトリが、Harbor の存在しなくなったリポジトリパス、または誤って設定されたパスを参照している場合に発生します。

Harbor プロジェクト上にイメージ名が表示されていたとしても、そのイメージに関連するコンテンツ blob が欠落している、またはアクセス不能になっている可能性があります。その結果、イメージ pull 時に “unknown blob” エラーが発生します。

この問題を引き起こす典型的なシナリオは以下の通りです:

  • アップグレードまたは移行の際にリポジトリ構造が変更された。
  • 古いリポジトリ参照がパッケージ設定内で更新されていなかった。
  • Harbor で GC(ガーベジコレクション)が実行され、参照されていない blob が削除された。

Resolution

この問題を解決するには、Tanzu パッケージリポジトリを有効な Harbor リポジトリを参照するように更新し、cert-manager パッケージを再インストールします。

ステップ 1 – 既存のリポジトリを一覧表示

tanzu package repository list -A

ステップ 2 – リポジトリ URL を更新

正しい Harbor パス(有効なイメージが存在する場所)へリポジトリを更新します。

tanzu package repository update standard-repo \--url ####.####.####./####/####/#####/ \-n #####

ステップ 3 – 既存の cert-manager パッケージを削除

tanzu package installed delete cert-manager --namespace #####

ステップ 4 – cert-manager パッケージを再インストール

tanzu package install cert-manager \-p cert-manager.kubernetes.vmware.com \--namespace ##### \--version #.##.#+vmware.1-vks.1

ステップ 5 – 調停(Reconciliation)が成功したか確認

以下のコマンドでパッケージが正常にインストールされていることを確認します:

tanzu package installed list -A

cert-manager パッケージのステータスが “Reconcile succeeded” と表示されれば成功です。