vmware-archive / kubeless

Kubernetes Native Serverless Framework
https://kubeless.io
Apache License 2.0
6.86k stars 754 forks source link

Add Status to kubeless CRD objects #482

Open murali-reddy opened 6 years ago

murali-reddy commented 6 years ago

We should add resource status to the function object, and any other CRD's kubeless may have (e.g. runtime, trigger etc)

to start with function object should have Status along with Spec something like below:

// Function object
type Function struct {
    metav1.TypeMeta `json:",inline"`
    Metadata               metav1.ObjectMeta `json:"metadata"`
    Spec   FunctionSpec `json:"spec"`
        Status FunctionStatus `json:"status,omitempty"`
}

Things like function status, http endpoint etc should go in the FunctionStatus.

Current way of inferring the status of the function by kubeless client should go away into controller. Client should just reflect the status of the function returned by API.

andresmgot commented 6 years ago

does this require a watcher in the controller?

murali-reddy commented 6 years ago

Kubeless controller is/will be the source of change to function objects (or any other CRD api objects that may come), so dont see need for it.

andresmgot commented 6 years ago

what if the deployment crashes? or should the controller wait until the deployment is ready?

sayanh commented 6 years ago

@andresmgot @murali-reddy Do we still consider solving this? As of now, I do see status: {} subresource but there is no feedback from kubeless-controller.

murali-reddy commented 6 years ago

Support for Status in CRD only got in 1.10 and will be beta in 1.11

https://github.com/kubernetes/features/issues/571

When Kubeless moves to latest client-go and supports 1.10/1.11 we can add support for status.