免責事項:これは英文の記事「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 上ではイメージ名が表示されていても、実体が存在していないケースです。
観測された事象: 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
この問題は、Tanzu パッケージリポジトリが、Harbor の存在しなくなったリポジトリパス、または誤って設定されたパスを参照している場合に発生します。
Harbor プロジェクト上にイメージ名が表示されていたとしても、そのイメージに関連するコンテンツ blob が欠落している、またはアクセス不能になっている可能性があります。その結果、イメージ pull 時に “unknown blob” エラーが発生します。
この問題を引き起こす典型的なシナリオは以下の通りです:
この問題を解決するには、Tanzu パッケージリポジトリを有効な Harbor リポジトリを参照するように更新し、cert-manager パッケージを再インストールします。
tanzu package repository list -A
正しい Harbor パス(有効なイメージが存在する場所)へリポジトリを更新します。
tanzu package repository update standard-repo \--url ####.####.####./####/####/#####/ \-n #####
tanzu package installed delete cert-manager --namespace #####
tanzu package install cert-manager \-p cert-manager.kubernetes.vmware.com \--namespace ##### \--version #.##.#+vmware.1-vks.1
以下のコマンドでパッケージが正常にインストールされていることを確認します:
tanzu package installed list -A
cert-manager パッケージのステータスが “Reconcile succeeded” と表示されれば成功です。