This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Component Specifications

Learn about OpenFunction component specifications.

1 - Function Specifications

Learn about Function Specifications.

This document describes the specifications of the Function CRD.

Function

FieldDescription
apiVersion stringcore.openfunction.io/v1alpha2
kind stringFunction
metadata v1.ObjectMeta(Optional) Refer to v1.ObjectMeta
spec FunctionSpecRefer to FunctionSpec
status FunctionStatusRefer to FunctionStatus

FunctionSpec

Belong to Function.

FieldDescription
version string(Optional) Function version, e.g. v1.0.0
image stringImage 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.

FieldDescription
builder stringName 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 GitRepoThe 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.

FieldDescription
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.

FieldDescription
name stringName of the strategy
kind string(Optional) Kind of the build strategy, which defaults to “BuildStrategy” or optional “ClusterBuildStrategy”

GitRepo

Belong to BuildImpl.

FieldDescription
url stringSource 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.

FieldDescription
runtime stringType 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.

FieldDescription
dapr Dapr(Optional) Definition of Dapr components, see Dapr
keda Keda(Optional) Definition of Keda, see Keda

Dapr

Belong to OpenFuncAsyncRuntime.

FieldDescription
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.

FieldDescription
name stringName of the input and output of the function. Consistent with the name of DaprComponent means associated
component stringIndicates the name of components
type stringType 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.

FieldDescription
scaledObject KedaScaledObjectDefinition of KEDA scalable objects (Deployments), refer to KedaScaledObject
scaledJob KedaScaledJobDefinition of KEDA scalable jobs, refer to KedaScaledJob

KedaScaledObject

Belong to Keda.

FieldDescription
workloadType stringHow 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.ScaleTriggersEvent sources that trigger dynamic scaling of workloads. Refer to kedav1alpha1.ScaleTriggers.

KedaScaledJob

Belong to Keda.

FieldDescription
restartPolicy v1.RestartPolicyRestart 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.ScaleTriggersEvent sources that trigger dynamic scaling of workloads, refer to kedav1alpha1.ScaleTriggers.

2 - EventSource Specifications

Learn about EventSource Specifications.

2.1 - EventSource Specifications

EventSource Specifications.

This document describes the specifications of the EventSource CRD.

EventSource

FieldDescription
apiVersion stringevents.openfunction.io/v1alpha1
kind stringEventSource
metadata v1.ObjectMeta(Optional) Refer to v1.ObjectMeta
spec EventSourceSpecRefer to EventSourceSpec
status EventSourceStatusStatus of EventSource

EventSourceSpec

Belong to EventSource.

FieldDescription
eventBus string(Optional) Name of the EventBus resource associated with the event source.
redis map[string]RedisSpec(Optional) The definition of a Redis event source, with key being the event name, refer to RedisSpec.
kafka map[string]KafkaSpec(Optional) The definition of a Kafka event source, with key being the event name, refer to KafkaSpec.
cron map[string]CronSpec(Optional) The definition of a Cron event source, with key being the event name, refer to CronSpec.
sink SinkSpec(Optional) Definition of the Sink (addressable access resource, i.e. synchronization request) associated with the event source, cf. SinkSpec.

SinkSpec

Belong to EventSourceSpec.

FieldDescription
ref ReferenceRefer to Reference.

Reference

Belong to SinkSpec.

FieldDescription
kind stringThe type of the referenced resource. It defaults to Service.
namespace stringThe namespace of the referenced resource, by default the same as the namespace of the Trigger.
name stringName of the referenced resource, for example, function-ksvc.
apiVersion stringThe apiVersion of the referenced resource. It defaults to serving.knative.dev/v1.

GenericScaleOption

Belong to scaleOption.

FieldDescription
pollingInterval intThis is the interval to check each trigger on. It defaults to 30 seconds.
cooldownPeriod intThe period to wait after the last trigger reported active before scaling the resource back to 0. It defaults to 300 seconds.
minReplicaCount intMinimum number of replicas KEDA will scale the resource down to. It defaults to 0.
maxReplicaCount intThis setting is passed to the HPA definition that KEDA will create for a given resource.
advanced kedav1alpha1.AdvancedConfigSee KEDA documentation.
metadata map[string]stringKEDA trigger’s metadata
authRef kedav1alpha1.ScaledObjectAuthRefEvery parameter you define in TriggerAuthentication definition does not need to be included in the metadata of the trigger for your ScaledObject definition. To reference a TriggerAuthentication from a ScaledObject you add the authenticationRef to the trigger, refer to KEDA documentation.

2.2 - Redis

Event source specifications of Redis.

RedisSpec

Belong to EventSourceSpec.

FieldDescription
redisHost stringAddress of the Redis server, e.g. localhost:6379.
redisPassword stringPassword for the Redis server, e.g. 123456.
enableTLS bool(Optional) Whether to enable TLS access, which defaults to false. Value options: true, false.
failover bool(Optional) Whether to enable the failover feature. Requires the sentinalMasterName to be set. It defaults to false. Value options: true, false.
sentinelMasterName string(Optional) The name of the sentinel master. Refer to Redis Sentinel Documentation.
redeliverInterval string(Optional) The interval for redeliver. It defaults to 60s. 0 means the redeliver mechanism is disabled. E.g. 30s
processingTimeout string(Optional) Message processing timeout. It defaults to 15s. 0 means timeout is disabled. E.g. 30s
redisType string(Optional) The type of Redis. Value options: node for single-node mode, cluster for cluster mode. It defaults to node.
redisDB int64(Optional) The database index to connect to Redis. Effective only if redisType is node. It defaults to 0.
redisMaxRetries int64(Optional) Maximum number of retries. It defaults to no retries. E.g. 5
redisMinRetryInterval string(Optional) Minimum backoff time for retries. The default value is 8ms. -1 indicates that the backoff time is disabled. E.g. 10ms
redisMaxRetryInterval string(Optional) Maximum backoff time for retries. The default value is 512ms. -1 indicates that the backoff time is disabled. E.g. 5s
dialTimeout string(Optional) Timeout to establish a new connection. It defaults to 5s.
readTimeout string(Optional) Read timeout. A timeout causes Redis commands to fail rather than wait in a blocking fashion. It defaults to 3s. -1 means disabled.
writeTimeout string(Optional) Write timeout. A timeout causes Redis commands to fail rather than wait in a blocking fashion. It defaults to consistent with readTimeout.
poolSize int64(Optional) Maximum number of connections. It defaults to 10 connections per runtime.NumCPU. E.g. 20
poolTimeout string(Optional) The timeout for the connection pool. The default is readTimeout + 1 second. E.g. 50s
maxConnAge string(Optional) Connection aging time. The default is not to close the aging connection. E.g. 30m
minIdleConns int64(Optional) The minimum number of idle connections to maintain to avoid performance degradation from creating new connections. It defaults to 0. E.g. 2
idleCheckFrequency string(Optional) Frequency of idle connection recycler checks. Default is 1m. -1 means the idle connection recycler is disabled. E.g. -1
idleTimeout string(Optional) Timeout to close idle client connections, which should be less than the server’s timeout. It defaults to 5m. -1 means disable idle timeout check. E.g. 10m

2.3 - Kafka

Event source specifications of Kafka.

KafkaSpec

Belong to EventSourceSpec.

FieldDescription
brokers stringA comma-separated string of Kafka server addresses, for example, localhost:9092.
authRequired boolWhether to enable SASL authentication for the Kafka server. Value options: true, false.
topic stringThe topic name of the Kafka event source, for example, topicA, myTopic.
saslUsername string(Optional) The SASL username to use for authentication. Only required if authRequired is true. For example, admin.
saslPassword string(Optional) The SASL user password for authentication. Only required if authRequired is true. For example, 123456.
maxMessageBytes int64(Optional) The maximum number of bytes a single message is allowed to contain. Default is 1024. For example, 2048.
scaleOption KafkaScaleOption(Optional) Kafka’s scale configuration.

KafkaScaleOption

Belong to KafkaSpec.

FieldDescription
GenericScaleOptionGeneric scale configuration.
consumerGroup stringKafka’s consumer group name.
topic stringTopic under monitoring, for example, topicA, myTopic.
lagThreshold stringThreshold for triggering scaling, in this case is the Kafka’s lag.

2.4 - Cron

Event source specifications of Cron.

CronSpec

Belong to EventSourceSpec.

FieldDescription
schedule stringRefer to Schedule format for a valid schedule format, for example, @every 15m.

3 - EventBus Specifications

Learn about EventBus Specifications.

3.1 - EventBus Specifications

EventBus Specifications.

This document describes the specifications of the EventBus (ClusterEventBus) CRD.

EventBus (ClusterEventBus)

FieldDescription
apiVersion stringevents.openfunction.io/v1alpha1
kind stringEventBus(ClusterEventBus)
metadata v1.ObjectMeta(Optional) Refer to v1.ObjectMeta
spec EventBusSpecRefer to EventBusSpec
status EventBusStatusStatus of EventBus(ClusterEventBus)

EventBusSpec

Belong to EventBus.

FieldDescription
topic stringThe topic name of the event bus.
natsStreaming NatsStreamingSpecDefinition of the Nats Streaming event bus (currently only supported). See NatsStreamingSpec.

GenericScaleOption

Belong to scaleOption.

FieldDescription
pollingInterval intThe interval to check each trigger on. It defaults to 30 seconds.
cooldownPeriod intThe period to wait after the last trigger reported active before scaling the resource back to 0. It defaults to 300 seconds.
minReplicaCount intMinimum number of replicas which KEDA will scale the resource down to. It defaults to 0.
maxReplicaCount intThis setting is passed to the HPA definition that KEDA will create for a given resource.
advanced kedav1alpha1.AdvancedConfigSee KEDA documentation.
metadata map[string]stringKEDA trigger’s metadata.
authRef kedav1alpha1.ScaledObjectAuthRefEvery parameter you define in TriggerAuthentication definition does not need to be included in the metadata of the trigger for your ScaledObject definition. To reference a TriggerAuthentication from a ScaledObject, add the authRef to the trigger. Refer to KEDA documentation.

3.2 - NATS Streaming

Event bus specifications of NATS Streaming.

NatsStreamingSpec

Belong to EventBusSpec.

FieldDescription
natsURL stringNATS server address, for example, nats://localhost:4222.
natsStreamingClusterID stringNATS cluster ID, for example, stan.
subscriptionType stringSubscriber type, value options: topic, queue.
ackWaitTime string(Optional) Refer to Acknowledgements , for example, 300ms.
maxInFlight int64(Optional) Refer to Max In Flight , for example, 25.
durableSubscriptionName string(Optional) The name of the persistent subscriber. For example, my-durable.
deliverNew bool(Optional) Subscriber options (only one can be used). Whether to send only new messages. Value options: true, false.
startAtSequence int64(Optional) Subscriber options (only one can be used). Set the starting sequence position and status. For example, 100000.
startWithLastReceived bool(Optional) Subscriber options (only one can be used). Whether to set the start position to the latest news place. Value options: true, false.
deliverAll bool(Optional) Subscriber options (only one can be used). Whether to send all available messages. Value options: true, false.
startAtTimeDelta string(Optional) Subscriber options (only one can be used). Use the difference form to set the desired start time position and state, for example, 10m, 23s.
startAtTime string(Optional) Subscriber options (only one can be used). Set the desired start time position and status using the marker value form. For example, Feb 3, 2013 at 7:54pm (PST).
startAtTimeFormat string(Optional) Must be used with startAtTime. Sets the format of the time. For example, Jan 2, 2006 at 3:04pm (MST).
scaleOption NatsStreamingScaleOption(Optional) Nats streaming’s scale configuration.

NatsStreamingScaleOption

Belong to NatsStreamingSpec.

FieldDescription
GenericScaleOptionGeneric scale configuration.
natsServerMonitoringEndpoint stringNats streaming’s monitoring endpoint.
queueGroup stringNats streaming’s queue group name.
durableName stringNats streaming’s durable name.
subject stringSubject under monitoring, for example, topicA, myTopic.
lagThreshold stringThreshold for triggering scaling, in this case is the Nats Streaming’s lag.

4 - Trigger Specifications

Learn about Trigger Specifications.

This document describes the specifications of the Trigger CRD.

Trigger

FieldDescription
apiVersion stringevents.openfunction.io/v1alpha1
kind stringTrigger
metadata v1.ObjectMeta(Optional) Refer to v1.ObjectMeta
spec TriggerSpecRefer to TriggerSpec
status TriggerStatusStatus of Trigger

TriggerSpec

Belong to Trigger.

FieldDescription
eventBus string(Optional) Name of the EventBus resource associated with the Trigger.
inputs map[string]Input(Optional) The input of trigger, with key being the input name. Refer to Input.
subscribers []Subscriber(Optional) The subscriber of the trigger. Refer to Subscriber.

Input

Belong to TriggerSpec.

FieldDescription
namespace string(Optional) The namespace name of the EventSource, which by default matches the namespace of the Trigger, for example, default.
eventSource stringEventSource name, for example, kafka-eventsource.
event stringEvent name, for example, eventA.

Subscriber

Belong to TriggerSpec.

FieldDescription
condition stringTrigger conditions for triggers, refer to cel-spec for more writing specifications, for example, eventA && eventB or `eventA
sink SinkSpec(Optional) Triggered Sink (addressable access resource, for example, synchronization request) definition, refer to SinkSpec.
deadLetterSink SinkSpec(Optional) Triggered dead letter Sink (addressable access resource, for example, synchronization request) definition, refer to SinkSpec.
topic string(Optional) Used to send post-trigger messages to the specified topic of the event bus, for example, topicTriggered.
deadLetterTopic string(Optional) Used to send post-trigger messages to the specified dead letter topic of the event bus, for example, topicDL.

SinkSpec

Belong to EventSourceSpec.

FieldDescription
ref ReferenceRefer to Reference.

Reference

Belong to SinkSpec.

FieldDescription
kind stringThe type of the referenced resource. It defaults to Service.
namespace stringThe namespace of the referenced resource, by default the same as the namespace of the Trigger.
name stringName of the referenced resource, for example, function-ksvc.
apiVersion stringThe apiVersion of the referenced resource. It defaults to serving.knative.dev/v1.