Skip to content

Add an empty Status field to the Function CRD #970

@alexellis

Description

@alexellis
Member

Add an empty Status field to the Function CRD

Expected Behaviour

The Function CRD should have a Status in its CRD, so that we can expand on readiness concepts later on or store state about the function.

Current Behaviour

This doesn't exist at present.

Which Solution Do You Recommend?

Update the definition for the types, so that kubebuilder generates a status object.

Make sure that it is not mandatory, otherwise it will be a breaking change for anyone applying a new object from YAML.

Codegen will need to be updated so that the Status object is added to the Go SDK for Functions:

https://github.com/openfaas/faas-netes/blob/master/hack/update-codegen.sh

The CRDs will have to be regenerated too:

https://github.com/openfaas/faas-netes/blob/master/hack/update-crds.sh

The inlets-operator already has a status, this may be useful?

https://github.com/inlets/inlets-operator/blob/master/pkg/apis/inletsoperator/v1alpha1/types.go#L40
https://github.com/inlets/inlets-operator/blob/master/pkg/apis/inletsoperator/v1alpha1/types.go#L54

We will probably need to add // +kubebuilder:subresource:status to the Function type.

https://github.com/openfaas/faas-netes/blob/master/pkg/apis/openfaas/v1/types.go#L13

I have been through this exercise once or twice but threw away the code, there may be a couple of surprises or issues to resolve.

Activity

NikhilSharmaWe

NikhilSharmaWe commented on May 15, 2023

@NikhilSharmaWe

@alexellis I would like to work on this. Do we still need this, just to make sure, since it is an old issue?

If yes, do you need to inform me about something more about what you expect other than what you have mentioned above, since it has been some time since this issue was opened?

linked a pull request that will close this issue on May 15, 2023
alexellis

alexellis commented on May 15, 2023

@alexellis
MemberAuthor

It's tricky as there are so many edge cases including being at 0/0 replicas.

I think the only thing we could potentially do is something like:

ready = owned_deployment.generation == owned_deployment.desired_generation

NikhilSharmaWe

NikhilSharmaWe commented on May 16, 2023

@NikhilSharmaWe

@alexellis For this issue I have created a PR: #1104, adding an empty status field to the function CRD.

We can discuss what are we planning on how to use status to expand on readiness concepts or store the state of a function, providing users useful info about the progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @alexellis@NikhilSharmaWe

      Issue actions

        Add an empty Status field to the Function CRD · Issue #970 · openfaas/faas-netes