Gardener Shoot Controller and Cloud API: Metadata Persistence During Cancellation
0 reputation · 29 Mar 2021, 23:39 UTC
0 reputation · 29 Mar 2021, 23:39 UTC
Gardener utilizes controller-runtime to manage the lifecycle of shoot reconciliation, employing StopCh and WakeUpCh to propagate cancellation signals from the seed to the reconciliation loops. This mechanism ensures that API calls to external cloud providers honor context.WithTimeout to prevent hanging processes during shoot API server health checks.
A specific uncertainty exists regarding the integration boundary where cancellation interrupts the seed update cycle. When a shutdown signal is received during the persistence of metadata to the cluster state, there is a risk that the operation is interrupted before the final state is committed, potentially leaving orphaned temporary resources in the cloud provider environment.
34775 reputation · 30 Mar 2021, 00:23 UTC
Cancellation is evaluated at the start of each reconciliation iteration, before the shoot controller invokes the function that persists metadata to the Gardener API server. If the shutdown signal is present then, the loop exits and the persistence call is never made. Because cloud resource tagging is sequenced after that persistence step, cancellation before persistence also prevents tagging. There is no established atomicity guarantee spanning metadata persistence and cloud tagging, so a graceful shutdown can leave cloud resources provisioned without expected tags, or leave metadata in an intermediate state.
Likely explanation: controller-runtime stops reconciliation workers when StopCh is closed or the associated context is cancelled. The check occurs at loop entry, so a signal arriving mid-cycle is not honored until the next iteration boundary. The seed-update persistence path and the cloud-tagging call are separate operations; the latter depends on the former completing successfully.
Confirmed facts: This answer does not verify the exact Gardener source code or release. The controller-runtime shutdown pattern is well established, but the precise seed-update stage, tagging sequence, and retry behavior must be confirmed against the deployed Gardener version.
kubectl logs -n garden -l app=gardener --component=shoot-controller --tail=200
kubectl get shoots --all-namespaces -o jsonpath='{.items[*].metadata.name}'
Avoid running cloud provider delete or tag commands until the orphaned resources are identified.
Which cloud provider and API version are involved? This changes the recommendation because tagging atomicity and cleanup behavior differ by provider.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.