kubernetes-sigs / kubernetes-sigs/cluster-api

BeforeClusterUpgrade is not called with cp unavailable

Open
#8,942 14 comments 1 reaction 0 assignees View on GitHub
help wanted kind/bug priority/backlog triage/accepted
Dominant language
Go
Stars
4.3k
Forks
1.6k
Avg merge
1d 3h
Merged PRs (30d)
113

Description

### What steps did you take and what happened?

Using `ClusterClass` we found an unexpected behavior when we try to upgrade the cluster and intercept the `BeforeClusterUpgrade` hook using RuntimeSDK.
If a ControlPlane isn't in an healthy state the hook doesn't get propagated to the runtime extension, I think this is logically wrong and in contrast with the [documentation](https://cluster-api.sigs.k8s.io/tasks/experimental-features/runtime-sdk/implement-lifecycle-hooks.html?highlight=beforeclusterup#beforeclusterupgrade).

### What did you expect to happen?

To receive the `BeforeClusterUpgrade` request even if the ControlPlanes are unhealthy and manage the problem in the phase of upgrading.

### Cluster API version

1.4.2+

### Kubernetes version

1.27.2

### Anything else you would like to add?

_No response_

### Label(s) to be applied

/kind bug
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

Contributor guide

Open the contributing guide

Research direction

Start by reading the RuntimeSDK documentation for the BeforeClusterUpgrade hook and trace the ClusterClass upgrade path where ControlPlane health is checked. Reproduce the unhealthy-ControlPlane case, then verify that the hook request reaches the runtime extension and that the existing upgrade behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.