Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

AzureMachinePool conditions handler #1123

Merged
merged 18 commits into from
Oct 30, 2020

Conversation

nprokopic
Copy link
Contributor

@nprokopic nprokopic commented Oct 28, 2020

AzureMachinePool conditions handler

New handler for setting following AzureMachinePool conditions:

  • SubnetReady: True when subnet deployment has been completed successfully, and subnet exists and it has Succeeded provisioning state.
  • VMSSReady: True when VMSS deployment (nodepool-{id}) has been completed successfully, and VMSS exists and it has Succeeded provisioning state.
  • Ready: True when SubnetReady && VMSSReady

Condition examples

While cluster is being created, so node pool creation has not been started yet:

$ k get azuremachinepool -n org-giantswarm tuw2u -o yaml | yq r - "status.conditions"
- lastTransitionTime: "2020-10-28T13:49:11Z"
  message: Deployment subnet-tuw2u is not found, check back in few minutes
  reason: DeploymentNotFound @ /tuw2u
  severity: Warning
  status: "False"
  type: Ready
- lastTransitionTime: "2020-10-28T13:49:10Z"
  message: Deployment subnet-tuw2u is not found, check back in few minutes
  reason: DeploymentNotFound
  severity: Warning
  status: "False"
  type: SubnetReady
- lastTransitionTime: "2020-10-28T13:49:11Z"
  message: Deployment nodepool-tuw2u is not found, check back in few minutes
  reason: DeploymentNotFound
  severity: Warning
  status: "False"
  type: VMSSReady

When the subnet is Ready, but VMSS is still being deployed:

$ k get azuremachinepool -n org-giantswarm tuw2u -o yaml | yq r - "status.conditions"
- lastTransitionTime: "2020-10-28T13:55:58Z"
  message: Deployment nodepool-tuw2u has not succeeded yet, current state is Running, check back in few minutes, see Azure portal for more details
  reason: DeploymentProvisioningStateRunning @ /tuw2u
  severity: Warning
  status: "False"
  type: Ready
- lastTransitionTime: "2020-10-28T13:55:48Z"
  status: "True"
  type: SubnetReady
- lastTransitionTime: "2020-10-28T13:55:58Z"
  message: Deployment nodepool-tuw2u has not succeeded yet, current state is Running, check back in few minutes, see Azure portal for more details
  reason: DeploymentProvisioningStateRunning
  severity: Warning
  status: "False"
  type: VMSSReady

When node pool creation has been completed:

$ k get azuremachinepool -n org-giantswarm yf4sd -o yaml | yq r - "status.conditions"                         
- lastTransitionTime: "2020-10-28T13:22:16Z"
  status: "True"
  type: Ready
- lastTransitionTime: "2020-10-28T13:22:15Z"
  status: "True"
  type: SubnetReady
- lastTransitionTime: "2020-10-28T13:22:16Z"
  status: "True"
  type: VMSSReady

@nprokopic nprokopic self-assigned this Oct 28, 2020
@nprokopic nprokopic requested a review from a team October 28, 2020 13:52
Copy link
Member

@fiunchinho fiunchinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments here and there but it looks great. I was wondering though, why should we care about ARM deployment status? What if we'd focus just on the resources themselves?

Copy link
Contributor

@tuommaki tuommaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM when Jose is happy

@nprokopic
Copy link
Contributor Author

Some comments here and there but it looks great. I was wondering though, why should we care about ARM deployment status? What if we'd focus just on the resources themselves?

We can do that as well, I just went with checking Deployments first, as we use them anyway for deploying things, so we don't use other Azure APIs at all (possible more sensitive to throttling, hey can you blame me 😄) if the deployment is not succeeded first.

Copy link
Member

@fiunchinho fiunchinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jose is happy

@nprokopic nprokopic merged commit 3aa5431 into master Oct 30, 2020
@nprokopic nprokopic deleted the azuremachinepoolconditions-handler branch October 30, 2020 19:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants