Function Specifications
Learn about Function Specifications.
This document describes the specifications of the Function CRD.
Function
Field | Description |
---|---|
apiVersion string | core.openfunction.io/v1alpha2 |
kind string | Function |
metadata v1.ObjectMeta | (Optional) Refer to v1.ObjectMeta |
spec FunctionSpec | Refer to FunctionSpec |
status FunctionStatus | Refer to FunctionStatus |
FunctionSpec
Belong to Function.
Field | Description |
---|---|
version string | (Optional) Function version, e.g. v1.0.0 |
image string | Image upload path, e.g. demorepo/demofunction:v1 |
imageCredentials v1.LocalObjectReference | (Optional) Credentials for accessing the image repository, refer to v1.LocalObjectReference |
port int32 | (Optional) The port the function is listening on, e.g. 8080 |
build BuildImpl | (Optional) Builder specification for the function, see BuildImpl |
serving ServingImpl | (Optional) Serving specification for the function, see ServingImpl |
BuildImpl
Belong to FunctionSpec.
Field | Description |
---|---|
builder string | Name of the Builder |
builderCredentials v1.LocalObjectReference | (Optional) Credentials for accessing the image repository, refer to v1.LocalObjectReference |
shipwright ShipwrightEngine | (Optional) Specification of the Shipwright engine, refer to ShipwrightEngine |
params map[string]string | (Optional) Parameters passed to Shipwright |
env map[string]string | (Optional) Parameters passed to the buildpacks builder |
srcRepo GitRepo | The configuration of the source code repository, refer to GitRepo |
dockerfile string | (Optional) Path to the Dockerfile instructing Shipwright when using the Dockerfile to build images |
ShipwrightEngine
Belong to BuildImpl.
Field | Description |
---|---|
strategy Strategy | (Optional) Index of image build strategy, refer to Strategy |
timeout v1.Duration | (Optional) Build timeout, refer to v1.Duration |
Strategy
Belong to ShipwrightEngine.
Field | Description |
---|---|
name string | Name of the strategy |
kind string | (Optional) Kind of the build strategy, which defaults to “BuildStrategy” or optional “ClusterBuildStrategy” |
GitRepo
Belong to BuildImpl.
Field | Description |
---|---|
url string | Source code repository address |
revision string | (Optional) Referenceable instances in the repository, such as commit ID and branch name. |
sourceSubPath string | (Optional) The directory of the function in the repository, e.g. functions/function-a/ |
credentials v1.LocalObjectReference | (Optional) Repository access credentials, refer to v1.LocalObjectReference |
ServingImpl
Belong to FunctionSpec.
Field | Description |
---|---|
runtime string | Type of load runtime, optional: Knative , OpenFuncAsync |
params map[string]string | (Optional) Parameters passed to the workloads |
openFuncAsync OpenFuncAsyncRuntime | (Optional) Used to define the configuration of OpenFuncAsync when the runtime is OpenFuncAsync, see OpenFuncAsyncRuntime |
template v1.PodSpec | (Optional) Template for the definition of Pods in the workloads, refer to v1.PodSpec |
OpenFuncAsyncRuntime
Belong to ServingImpl.
Field | Description |
---|---|
dapr Dapr | (Optional) Definition of Dapr components, see Dapr |
keda Keda | (Optional) Definition of Keda, see Keda |
Dapr
Belong to OpenFuncAsyncRuntime.
Field | Description |
---|---|
annotations map[string]string | (Optional) Annotations for Dapr components, see Dapr documentation |
components map[string]componentsv1alpha1.ComponentSpec | (Optional) Dapr Components Spec map, with key being component’s name and value being componentsv1alpha1.ComponentSpec |
inputs []DaprIO | (Optional) The definition of the inputs of the function, see DaprIO |
outputs []DaprIO | (Optional) The definition of the outputs of the function, see DaprIO |
DaprIO
Belong to Dapr.
Field | Description |
---|---|
name string | Name of the input and output of the function. Consistent with the name of DaprComponent means associated |
component string | Indicates the name of components |
type string | Type of Dapr component, optional: bindings , pubsub |
topic string | (Optional) When the type is pubsub , you need to set the topic |
operation string | (Optional) Operation field tells the Dapr component which operation it should perform, refer to Dapr docs |
params map[string]string | (Optional) Parameters passed to Dapr |
Keda
Belong to OpenFuncAsyncRuntime.
Field | Description |
---|---|
scaledObject KedaScaledObject | Definition of KEDA scalable objects (Deployments), refer to KedaScaledObject |
scaledJob KedaScaledJob | Definition of KEDA scalable jobs, refer to KedaScaledJob |
KedaScaledObject
Belong to Keda.
Note
For more information, see Scaling Deployments, StatefulSets & Custom Resources.Field | Description |
---|---|
workloadType string | How to run the function, known values are Deployment or StatefulSet , which defaults to Deployment . |
pollingInterval int32 | (Optional) The pollingInterval is in seconds. This is the interval in which KEDA checks the triggers for the queue length or the stream lag. It defaults to 30 seconds. |
cooldownPeriod int32 | (Optional) The cooldownPeriod is in seconds, and it is the period of time to wait after the last trigger activated before scaling back down to 0. It defaults to 300 seconds. |
minReplicaCount int32 | (Optional) Minimum number of replicas which KEDA will scale the resource down to. By default, it scales to 0 . |
maxReplicaCount int32 | (Optional) This setting is passed to the HPA definition that KEDA will create for a given resource. |
advanced kedav1alpha1.AdvancedConfig | (Optional) This property specifies whether the target resource (for example, Deployment and StatefulSet ) should be scaled back to original replicas count after the ScaledObject is deleted. Default behavior is to keep the replica count at the same number as it is in the moment of ScaledObject deletion. Refer to kedav1alpha1.AdvancedConfig. |
triggers []kedav1alpha1.ScaleTriggers | Event sources that trigger dynamic scaling of workloads. Refer to kedav1alpha1.ScaleTriggers. |
KedaScaledJob
Belong to Keda.
Note
For more information, see Scaling Jobs.Field | Description |
---|---|
restartPolicy v1.RestartPolicy | Restart policy for all containers within the pod. Value options are OnFailure or Never . It defaults to Never . |
pollingInterval int32 | (Optional) The pollingInterval is in seconds. This is the interval in which KEDA checks the triggers for the queue length or the stream lag. It defaults to 30 seconds. |
successfulJobsHistoryLimit int32 | (Optional) How many completed jobs should be kept. It defaults to 100 . |
failedJobsHistoryLimit int32 | (Optional) How many failed jobs should be kept. It defaults to 100 . |
maxReplicaCount int32 | (Optional) The max number of pods that is created within a single polling period. |
scalingStrategy kedav1alpha1.ScalingStrategy | (Optional) Select a scaling strategy. Value options are default , custom , or accurate . The default value is default . Refer to kedav1alpha1.ScalingStrategy. |
triggers []kedav1alpha1.ScaleTriggers | Event sources that trigger dynamic scaling of workloads, refer to kedav1alpha1.ScaleTriggers. |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.