Skip to content

Conversation

Karthik-K-N
Copy link
Contributor

@Karthik-K-N Karthik-K-N commented Jun 26, 2025

What this PR does / why we need it:

while setting machine-deployment status, AvailableReplicas field was not deferred to set the actual value, Because of this on each reconciliation the status was updated and it was causing aggressive/repeated reconciliation.

I0626 08:53:46.421877      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="6129cb51-fe99-462c-8263-1b1fe509a47a" Cluster="default/ibm-powervs-1"
I0626 08:53:46.521349      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="166ca54f-28ae-4966-b3db-e37168e05bce" Cluster="default/ibm-powervs-1"
I0626 08:53:46.621543      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="3d443243-da5d-4611-aa77-783481f6f91e" Cluster="default/ibm-powervs-1"
I0626 08:53:46.720159      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="40e437a1-6d9f-43c2-a71f-0c796676b13c" Cluster="default/ibm-powervs-1"
I0626 08:53:46.820255      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="eb7a2f09-9c5f-4a44-924a-f715a4353b1b" Cluster="default/ibm-powervs-1"
I0626 08:53:46.921383      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="0ae188a7-baa4-4428-8dd9-dcc31d22faad" Cluster="default/ibm-powervs-1"
I0626 08:53:47.021249      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="644ae6d7-ad42-46b5-b25c-068d1d315655" Cluster="default/ibm-powervs-1"
I0626 08:53:47.120684      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="cb0b5005-3c9b-4755-87e9-96f793cceb70" Cluster="default/ibm-powervs-1"
I0626 08:53:47.221367      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="aa007af9-c74b-4533-8392-bdc1c3c24a98" Cluster="default/ibm-powervs-1"
I0626 08:53:47.320932      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="a01f3e10-dc9b-4051-8cbd-2262d8a0201d" Cluster="default/ibm-powervs-1"
I0626 08:53:47.420404      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="c595b459-1812-4031-85b1-52b67fda781f" Cluster="default/ibm-powervs-1"
I0626 08:53:47.519674      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="bdc00188-bf4d-40c3-9eca-a029c1c6279e" Cluster="default/ibm-powervs-1"
I0626 08:53:47.619009      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="a5d975da-3c51-46d0-9f3f-727cb2922ac5" Cluster="default/ibm-powervs-1"
I0626 08:53:47.721728      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="11525951-8419-4dbe-b14d-83dfa1d4587c" Cluster="default/ibm-powervs-1"
I0626 08:53:47.818521      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="278a43a0-9b73-4336-a0f8-36f1b619821e" Cluster="default/ibm-powervs-1"
I0626 08:53:47.918246      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="032e750a-e3c1-4a3a-b33c-c82a65f7eb89" Cluster="default/ibm-powervs-1"
I0626 08:53:48.017799      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="71751958-94e5-4ae3-9e25-e3c4cefebd3d" Cluster="default/ibm-powervs-1"
I0626 08:53:48.120221      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="aac82bd8-4b96-4fac-9a9a-78bbff183c32" Cluster="default/ibm-powervs-1"
I0626 08:53:48.223057      14 machinedeployment_controller.go:234] "Reconcile MachineDeployment" controller="machinedeployment" controllerGroup="cluster.x-k8s.io" controllerKind="MachineDeployment" MachineDeployment="default/ibm-powervs-1-md-0" namespace="default" name="ibm-powervs-1-md-0" reconcileID="2a5c8796-7ced-4917-9444-3a3e697a0ce1" Cluster="default/ibm-powervs-1"
% kubectl get md -o json | jq .items | jq '.[0].status'
{
  "availableReplicas": 0,
  "conditions": [
    {
      "lastTransitionTime": "2025-06-26T09:55:39Z",
      "message": "0 available replicas, at least 1 required (spec.strategy.rollout.maxUnavailable is 0, spec.replicas is 1)",
      "observedGeneration": 1,
      "reason": "NotAvailable",
      "status": "False",
      "type": "Available"
    },
    {
      "lastTransitionTime": "2025-06-26T09:55:39Z",
      "message": "",
      "observedGeneration": 1,
      "reason": "NotRollingOut",
      "status": "False",
      "type": "RollingOut"
    },
    {
      "lastTransitionTime": "2025-06-26T09:55:39Z",
      "message": "",
      "observedGeneration": 1,
      "reason": "NotRemediating",
      "status": "False",
      "type": "Remediating"
    },
    {
      "lastTransitionTime": "2025-06-26T09:55:39Z",
      "message": "",
      "observedGeneration": 1,
      "reason": "NotScalingDown",
      "status": "False",
      "type": "ScalingDown"
    },
    {
      "lastTransitionTime": "2025-06-26T09:55:41Z",
      "message": "",
      "observedGeneration": 1,
      "reason": "NotScalingUp",
      "status": "False",
      "type": "ScalingUp"
    },
    {
      "lastTransitionTime": "2025-06-26T09:55:41Z",
      "message": "* Machine ibm-powervs-1-md-0-phjrv-rmzpp:\n  * BootstrapConfigReady:\n    * DataSecretAvailable: Waiting for Cluster control plane to be initialized\n    * CertificatesAvailable: Condition not yet reported\n  * InfrastructureReady:\n    * InstanceReady: WaitingForControlPlaneInitialized\n  * NodeHealthy: Waiting for Cluster control plane to be initialized",
      "observedGeneration": 1,
      "reason": "NotReady",
      "status": "False",
      "type": "MachinesReady"
    },
    {
      "lastTransitionTime": "2025-06-26T09:55:39Z",
      "message": "",
      "observedGeneration": 1,
      "reason": "UpToDate",
      "status": "True",
      "type": "MachinesUpToDate"
    },
    {
      "lastTransitionTime": "2025-06-26T09:55:39Z",
      "message": "",
      "observedGeneration": 1,
      "reason": "NotPaused",
      "status": "False",
      "type": "Paused"
    },
    {
      "lastTransitionTime": "2025-06-26T09:55:39Z",
      "message": "",
      "observedGeneration": 1,
      "reason": "NotDeleting",
      "status": "False",
      "type": "Deleting"
    }
  ],
  "deprecated": {
    "v1beta1": {
      "availableReplicas": 0,
      "conditions": [
        {
          "lastTransitionTime": "2025-06-26T10:25:08Z",
          "message": "Minimum availability requires 1 replicas, current 274906884264 available",
          "reason": "WaitingForAvailableMachines",
          "severity": "Warning",
          "status": "False",
          "type": "Ready"
        },
        {
          "lastTransitionTime": "2025-06-26T10:25:08Z",
          "message": "Minimum availability requires 1 replicas, current 274906884264 available",
          "reason": "WaitingForAvailableMachines",
          "severity": "Warning",
          "status": "False",
          "type": "Available"
        },
        {
          "lastTransitionTime": "2025-06-26T09:55:41Z",
          "message": "Scaling up MachineSet to 1 replicas (actual 0)",
          "reason": "ScalingUp",
          "severity": "Warning",
          "status": "False",
          "type": "MachineSetReady"
        }
      ],
      "readyReplicas": 0,
      "unavailableReplicas": 1,
      "updatedReplicas": 1
    }
  },
  "observedGeneration": 1,
  "phase": "Running",
  "readyReplicas": 0,
  "replicas": 1,
  "selector": "cluster.x-k8s.io/cluster-name=ibm-powervs-1,cluster.x-k8s.io/deployment-name=ibm-powervs-1-md-0",
  "upToDateReplicas": 1
}

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes the issue reported in #12334 (comment)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label labels Jun 26, 2025
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 26, 2025
@sbueringer
Copy link
Member

Thank you very much!!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 26, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6c72730dfcfcedb154f78a76880058997f266607

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 26, 2025
@sbueringer sbueringer added area/machinedeployment Issues or PRs related to machinedeployments and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 26, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Jun 26, 2025
@sbueringer
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 26, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6c72730dfcfcedb154f78a76880058997f266607

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 26, 2025
@k8s-ci-robot k8s-ci-robot merged commit d900123 into kubernetes-sigs:main Jun 26, 2025
29 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.11 milestone Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/machinedeployment Issues or PRs related to machinedeployments cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants