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

Refactor: Adopt Flux runtime conditions and status standards #745

Merged
merged 6 commits into from
Oct 18, 2022

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Oct 13, 2022

Changes

  • Make the Kustomization.status conform to the Kubernetes kstatus standard
  • Make the Kustomization.status.conditions conform to the Kubernetes standard conditions
  • Improve the reconciliation observability with real-time informations about the actions taken by the controller
  • Adopt fluxcd/pkg/runtime/conditions and fluxcd/pkg/runtime/controller for status operations

Test image: ghcr.io/fluxcd/kustomize-controller:rc-747a2c9e

Reconciling status condition

This PR introduces a new status condition named Reconciling which improves the observability for the actions performed by the controller during a reconciliation run.

The Reconciling message reflects the current action being executed e.g.:

  • Fetching manifests for revision X with a timeout of Y
  • Building manifests for revision X with a timeout of Y
  • Detecting drift for revision X with a timeout of Y
  • Running health checks for revision X with a timeout of Y

The Reconciling condition is added to the status once the reconciliation starts and its Message is updated before each action performed by the controller during a reconciliation run.

conditions:
- lastTransitionTime: "2022-10-17T13:40:21Z"
  message: Running health checks for revision v1.0.0 with a timeout of 30s
  observedGeneration: 2
  reason: Progressing
  status: "True"
  type: Reconciling
- lastTransitionTime: "2022-10-17T13:40:21Z"
  message: Reconciliation in progress
  observedGeneration: 2
  reason: Progressing
  status: Unknown
  type: Ready

If the reconciliation encountered an error, the Ready condition is set to False and Reconciling is left in place, to signal that the controller will retry the failed action.

conditions:
- lastTransitionTime: "2022-10-14T17:50:57Z"
  message: Running health checks for revision v1.0.0 with a timeout of 30s
  observedGeneration: 2
  reason: ProgressingWithRetry
  status: "True"
  type: Reconciling
- lastTransitionTime: "2022-10-14T17:51:27Z"
  message: Timeout waiting for: [Job/default/test status: NotFound]
  observedGeneration: 2
  reason: HealthCheckFailed
  status: "False"
  type: Ready

If the reconciliation finishes with no errors, The Reconciling condition is removed from status and the Ready condition is set to True.

conditions:
- lastTransitionTime: "2022-10-14T17:51:27Z"
  message: 'Applied revision: v2.0.0'
  observedGeneration: 2
  reason: ReconciliationSucceeded
  status: "True"
  type: Ready

Closes: #663
Ref: fluxcd/pkg#380

@stefanprodan stefanprodan force-pushed the status-refactoring branch 6 times, most recently from deaf9ca to de4fcdd Compare October 14, 2022 09:21
@stefanprodan stefanprodan force-pushed the status-refactoring branch 4 times, most recently from b247c0d to 761835c Compare October 14, 2022 13:27
Signed-off-by: Stefan Prodan <[email protected]>
ProgressingWithRetry signals that the controller is going to retry the last failed reconciliation at a later time.

Signed-off-by: Stefan Prodan <[email protected]>
@stefanprodan stefanprodan force-pushed the status-refactoring branch 2 times, most recently from cca7b02 to 5552840 Compare October 17, 2022 14:42
@stefanprodan stefanprodan added this to the GA milestone Oct 18, 2022
@stefanprodan stefanprodan added the enhancement New feature or request label Oct 18, 2022
@stefanprodan stefanprodan marked this pull request as ready for review October 18, 2022 11:33
@stefanprodan stefanprodan modified the milestones: GA, Bootstrap GA Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Roll out new unified standards to Kustomize Controller
2 participants