Back to list
dev_to 2026年3月21日

FluxCD Image Automation エラーのトラブルシューティング

FluxCD Image Automation Error Troubleshooting

Translated: 2026/3/21 6:07:06
fluxcdgit-automationsecret-managementssh-keycontainer-image

Japanese Translation

## 問題 実行: `flux reconcile image update flux-system` 結果: `failed to update source: failed to push to remote` `ERROR: The key you are authenticating with has been marked as read only` また: `flux get image update` は示します: `READY: False` `MESSAGE: failed to push to remote` FluxCD ImageUpdateAutomation はコンテナイメージのタグを更新する際、Git リポジトリにコミットとプッシュを実行する必要があります。 パイプライン: `Container Registry` → `ImageRepository` → `ImagePolicy` → `ImageUpdateAutomation` → `Git Commit + Push` → `Flux Kustomization deploys update` Git クレデンシャルが読み取り専用の場合、プッシュは失敗します。 `flux get image update` 検索対象: `READY: False` `failed to push to remote` `kubectl get imageupdateautomation -A`を参照してください。 例: `STATUS: failed to update source` `flux get sources git` これは Flux がリポジトリを読み取っていることを確認します。 ただし、キーが読み取り専用の場合、プッシュは引き続き失敗します。 Git シークレットを確認: `kubectl get secret flux-system -n flux-system` このシークレットには Flux 使用する SSH キーが含まれています。 書き込み有効な SSH キーを持つ Git 認証シークレットを再作成しました。 `ssh-keygen`を実行します。 リポジトリへ進む: `Settings → Deploy Keys` 追加: `fluxcd-test.pub` 有効化: `Allow write access` `flux create secret git flux-system`を実行します: `--url=ssh://git@github.com/pilgrim2go/flux-minikube-lab` `--private-key-file=$PWD/fluxcd-test` `-n flux-system` これは Flux 使用する Git クレデンシャルを更新します。 `flux reconcile image update flux-system`を実行します。 `flux get image update`を実行します。 結果: `READY: True` `MESSAGE: committed and pushed update` Git に次のようなコミットも確認する必要があります: `flux: update image tag` フルな Flux ステータスを確認: `flux get all` 自動化ログを確認: `kubectl logs -n flux-system deploy/image-automation-controller` Git スイックをテスト: `flux reconcile source git flux-system` SSH Git リポジトリを使用する際に、個人アクセストークン代わりに専用 Flux deploy キー (`read + write`) を使用します。

Original Content

Problem Running: flux reconcile image update flux-system Result: failed to update source: failed to push to remote ERROR: The key you are authenticating with has been marked as read only And: flux get image update shows: READY: False MESSAGE: failed to push to remote FluxCD ImageUpdateAutomation needs to commit and push updates to the Git repository when it updates container image tags. Pipeline: Container Registry ↓ ImageRepository ↓ ImagePolicy ↓ ImageUpdateAutomation ↓ Git Commit + Push ↓ Flux Kustomization deploys update If the Git credential is read-only, the push fails. flux get image update Look for: READY: False failed to push to remote kubectl get imageupdateautomation -A Example: STATUS: failed to update source flux get sources git This confirms Flux can read the repo. But pushing still fails if the key is read-only. Check the Git secret: kubectl get secret flux-system -n flux-system This secret contains the SSH key Flux uses. You recreated the Git authentication secret with a write-enabled SSH key. ssh-keygen Go to repo: Settings → Deploy Keys Add: fluxcd-test.pub Enable: Allow write access flux create secret git flux-system \ --url=ssh://git@github.com/pilgrim2go/flux-minikube-lab \ --private-key-file=$PWD/fluxcd-test \ -n flux-system This updates the Git credential used by Flux. flux reconcile image update flux-system flux get image update READY: True MESSAGE: committed and pushed update You should also see a commit in Git like: flux: update image tag Check full Flux status: flux get all Check automation logs: kubectl logs -n flux-system deploy/image-automation-controller Test Git sync: flux reconcile source git flux-system Use a dedicated Flux deploy key with: read + write instead of personal access tokens when using SSH Git repositories.