Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KubeadmControlPlanePhase to CRD #10704

Open
sivchari opened this issue May 30, 2024 · 6 comments
Open

Add KubeadmControlPlanePhase to CRD #10704

sivchari opened this issue May 30, 2024 · 6 comments
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@sivchari
Copy link
Member

What would you like to be added (User Story)?

I suggest to add KubeadmControlPlanePhase to CRD.
Currently, Cluster and MachineDeployment has individual phase, but KCP doesn't have it.
KCP is same as MachineDeployment, because ControlPlane is machine, too.

Detailed Description

TBW

Anything else you would like to add?

No response

Label(s) to be applied

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

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates an issue lacks a `priority/foo` label and requires one. labels May 30, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If CAPI contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label May 30, 2024
@fabriziopandini
Copy link
Member

@sivchari which phases do you envision for KCP? how they are defined?

@sivchari
Copy link
Member Author

sivchari commented Jun 4, 2024

I want Scaling Up, Scaling Down and Running phase. This phase is changed following and changing by replicas and other field.

@chrischdi
Copy link
Member

You should be able to take a look at the ResizedCondition of a KCP:

ResizedCondition clusterv1.ConditionType = "Resized"

It is getting set here:

switch {
// We are scaling up
case replicas < desiredReplicas:
conditions.MarkFalse(controlPlane.KCP, controlplanev1.ResizedCondition, controlplanev1.ScalingUpReason, clusterv1.ConditionSeverityWarning, "Scaling up control plane to %d replicas (actual %d)", desiredReplicas, replicas)
// We are scaling down
case replicas > desiredReplicas:
conditions.MarkFalse(controlPlane.KCP, controlplanev1.ResizedCondition, controlplanev1.ScalingDownReason, clusterv1.ConditionSeverityWarning, "Scaling down control plane to %d replicas (actual %d)", desiredReplicas, replicas)
// This means that there was no error in generating the desired number of machine objects
conditions.MarkTrue(controlPlane.KCP, controlplanev1.MachinesCreatedCondition)
default:
// make sure last resize operation is marked as completed.
// NOTE: we are checking the number of machines ready so we report resize completed only when the machines
// are actually provisioned (vs reporting completed immediately after the last machine object is created).
readyMachines := controlPlane.Machines.Filter(collections.IsReady())
if int32(len(readyMachines)) == replicas {
conditions.MarkTrue(controlPlane.KCP, controlplanev1.ResizedCondition)
}
// This means that there was no error in generating the desired number of machine objects
conditions.MarkTrue(controlPlane.KCP, controlplanev1.MachinesCreatedCondition)
}

And from quickly reading it, the condition should either be:

  • True: if all kcp machines are ready
  • False with controlplanev1.ScalingUpReason for scaling up.
  • False with controlplanev1.ScalingDownReason for scaling down.

@fabriziopandini fabriziopandini added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Jun 5, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates an issue lacks a `priority/foo` label and requires one. label Jun 5, 2024
@fabriziopandini fabriziopandini added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Jun 5, 2024
@sivchari
Copy link
Member Author

I didn't know this condition so far, thanks. Then why does MachineDeployment has conditions and phase ?

@chrischdi
Copy link
Member

Good question, maybe searching the PRs which introduced the one or the other or the ones for the proposals and reading through them may have context on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

4 participants