kyma-project / infrastructure-manager

Apache License 2.0
0 stars 9 forks source link

Valid CRs statuses should be set when KIM's operations succeed or fail #193

Open Disper opened 2 months ago

Disper commented 2 months ago

Proposed solution for Runtime CR:

Following Statuses will represent current state of provisioned Kyma runtime:

Following conditions will be used to describe processing steps for Runtime CR

For each condition can be in following reasons may occur:

tobiscr commented 3 weeks ago

Just as proposal:

could we stay with the status closer to the common Pod phases in K8s (e.g. https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase)?

Below a mapping between the initially suggested states and how they could be aligned with Pod phases:

Suggested runtime status Proposed status (=common pod phase) Comment
Creating Pending Runtime currently processed
Ready Running Runtime is provisioned and running
Error Failed Runtime could not be provisioned
Processing Pending Runtime currently processed
Deleting Terminating Terminating is not an official phase of a K8s pod but used by kubectl and it's meaningful to have a clear indication when a Runtime is on the way to be deleted
koala7659 commented 3 weeks ago

Agree with one exception. We think that still "Ready" is better word than "Running" since we are preparing Runtime to be used by its users.

Final table:

Suggested runtime status Proposed status (=common pod phase) Comment
Creating Pending Runtime currently processed
Ready Ready Runtime is provisioned and ready to use
Error Failed Runtime could not be provisioned
Processing Pending Runtime currently processed
Deleting Terminating Terminating is not an official phase of a K8s pod but used by kubectl and it's meaningful to have a clear indication when a Runtime is on the way to be deleted
PK85 commented 3 weeks ago

@Disper please provide CR yaml examples with those new status and values

koala7659 commented 2 weeks ago

Cluster is pending:

  status:
    conditions:
    - lastTransitionTime: "2024-06-24T07:34:30Z"
      message: Shoot creation in progress
      reason: Pending
      status: Unknown
      type: Provisioned
    state: Pending

Cluster is ready to use:

  status:
    conditions:
    - lastTransitionTime: "2024-06-24T07:45:48Z"
      message: Shoot creation completed
      reason: ShootCreationCompleted
      status: "True"
      type: Provisioned
    state: Ready

Cluster provisioning failed:

  status:
    conditions:
    - lastTransitionTime: "2024-06-24T07:45:48Z"
      message: Gardener API create error
      reason: GardenerErr
      status: "False"
      type: Provisioned
    state: Failed
Disper commented 2 weeks ago

@PK85 I've sent you some Runtime CRs examples via Slack