Giter Club home page Giter Club logo

Comments (6)

hasbro17 avatar hasbro17 commented on August 10, 2024

We could define a condition for whether a release is reconciled/installed(true, false, unknown) with the reason.
https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties
Or turn that into a known field in status.

from helm-app-operator-kit.

joelanford avatar joelanford commented on August 10, 2024

Yeah I was reading up on conventions for status and I'm thinking the Helm status is due for an overhaul.

I think we need to be able to convey the following states:

Success (steady-state):

  • "Deployed", with the deployed release
    • This would cover successes for install, update, and reconcile

Failure:

  • "InstallFailed", with the failed release and a reason
  • "UpdateFailed", with the deployed release, failed release, and a reason
  • "ReconcileFailed", with the deployed release and a reason

Maybe we put "Deployed" and "DeployedRelease" as fields at the top-level status and then have a condition for the failures with a FailedRelease field in that condition?

from helm-app-operator-kit.

joelanford avatar joelanford commented on August 10, 2024

Thinking about it more, if we just made them all conditions, we could have multiple conditions.

For example, if we successfully install a release, we add a Deployed condition:

status.AddCondition(HelmAppCondition{
    Type:    ConditionDeployed,
    Status:  StatusTrue,
    Reason:  ReasonInstallSuccessful,
    Message: release.GetInfo().GetStatus().GetNotes(),
    Release: release,
})

Then, if sometime later we fail to update, we would just add another condition, ReleaseFailed:

status.AddCondition(HelmAppCondition{
    Type:    ConditionReleaseFailed,
    Status:  StatusTrue,
    Reason:  ReasonUpdateError,
    Message: err.Error(),
    Release: failedRelease,
})

In that case, we'd have two conditions until the update error is resolved.

So something like the following:

type HelmAppStatus struct {
    Conditions []HelmAppCondition `json:"conditions"`
}

type HelmAppCondition struct {
    Type    HelmAppConditionType   `json:"type"`
    Status  ConditionStatus        `json:"status"`
    Reason  HelmAppConditionReason `json:"reason"`
    Message string                 `json:"message,omitempty"`
    Release *release.Release       `json:"release,omitempty"`
}

const (
    ConditionDeployed       HelmAppConditionType = "Deployed"
    ConditionReleaseFailed  HelmAppConditionType = "ReleaseFailed"
    ConditionIrreconcilable HelmAppConditionType = "Irreconcilable"

    StatusTrue    ConditionStatus = "True"
    StatusFalse   ConditionStatus = "False"
    StatusUnknown ConditionStatus = "Unknown"

    ReasonInstallSuccessful HelmAppConditionReason = "InstallSuccessful"
    ReasonUpdateSuccessful  HelmAppConditionReason = "UpdateSuccessful"
    ReasonInstallError      HelmAppConditionReason = "InstallError"
    ReasonUpdateError       HelmAppConditionReason = "UpdateError"
    ReasonReconcileError    HelmAppConditionReason = "ReconcileError"
)

from helm-app-operator-kit.

joelanford avatar joelanford commented on August 10, 2024

@hasbro17 I was about to submit a PR for this when I found the following discussions:

The doc you linked (https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties) was last updated before the above discussions happened, and nothing concrete seems to have been decided otherwise. In the absence of a clearly defined convention, I think I lean towards continuing with conditions as it seems to fit the Helm operator use case fairly well.

Thoughts?

from helm-app-operator-kit.

hasbro17 avatar hasbro17 commented on August 10, 2024

Yep we can proceed with conditions. We can't go back to Phases and there doesn't seem to be an alternative convention to conditions yet(the issue on removing conditions is frozen kubernetes/kubernetes#7856 (comment)).
The latest upstream proposals are still using conditions as well.
https://github.com/kubernetes/community/pull/2524/files#diff-61b3bf8a9689fb1a602ce6906cab8c4aR209

from helm-app-operator-kit.

joelanford avatar joelanford commented on August 10, 2024

The Helm operator has been integrated into operator-sdk. This issue was solved there by operator-framework/operator-sdk#814

from helm-app-operator-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.