Skip to main content
Version: Next

Built-in Component Type

This documentation will walk through the built-in component types.

Helm#

Parameters#

ParametersDescriptionExample
repoTyperequired, indicates where it's fromHelm
pullIntervaloptional, synchronize with Helm Repo, tunning interval and 5 minutes by default10m
urlrequired, Helm Reop address, it supports http/httpshttps://charts.bitnami.com/bitnami
secretRefoptional, The name of the Secret object that holds the credentials required to pull the repo. The username and password fields must be included in the HTTP/S basic authentication Secret. For TLS the secret must contain a certFile and keyFile, and/or caCert fields. For TLS authentication, the secret must contain a certFile / keyFile field and/or caCert field.sec-name
timeoutoptional, timeout for pulling repo index60s
chartrequired, chart titleredis-cluster
versionoptional, chart version, * by default6.2.7
targetNamespaceoptional, the namespace to install chart, decided by chart itselfyour-ns
releaseNameoptional, release name after installedyour-rn
valuesoptional, override the Values.yaml inchart, using for the rendering of Helm
installTimeoutoptional, the timeout for operation helm install, and 10 minutes by default20m

Example#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-delivering-chart
spec:
components:
- name: redis-comp
type: helm
properties:
chart: redis-cluster
version: 6.2.7
url: https://charts.bitnami.com/bitnami
repoType: helm

Helm ( repoType: oss )#

Parameters#

ParametersDescriptionExample
repoTyperequired, indicates where it's fromoss
pullIntervaloptional, synchronize with bucket, tunning interval and 5 minutes by default10m
urlrequired, bucket's endpoint and no need to fill in with schemeoss-cn-beijing.aliyuncs.com
secretRefoptional, Save the name of a Secret, which is the credential to read the bucket. Secret contains accesskey and secretkey fieldssec-name
timeoutoptional, The timeout period of the download operation, the default is 20s60s
chartrequired, Chart storage path (key)./chart/podinfo-5.1.3.tgz
versionoptional, In OSS source, this parameter has no effect
targetNamespaceoptional, The namespace of the installed chart, which is determined by the chart itself by defaultyour-ns
releaseNameoptional, Installed release nameyour-rn
valuesoptional, Overwrite the Values.yaml of the chart for Helm rendering.
oss.bucketNamerequired, bucket nameyour-bucket
oss.provideroptional, Optional generic or aws, fill in aws if the certificate is obtained from aws EC2. The default is generic.generic
oss.regionoptional, bucket region

Example#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: bucket-app
spec:
components:
- name: bucket-comp
type: helm
properties:
repoType: oss
# required if bucket is private
secretRef: bucket-secret
chart: ./chart/podinfo-5.1.3.tgz
url: oss-cn-beijing.aliyuncs.com
oss:
bucketName: definition-registry

Helm ( repoType: git )#

Parameters#

ParametersDescriptionExample
repoTyperequired, indicates where it's fromgit
pullIntervaloptional, synchronize with Git Repo, tunning interval and 5 minutes by default10m
urlrequired, Git Repo addresshttps://github.com/oam-dev/terraform-controller
secretRefoptional, The name of the Secret object that holds the credentials required to pull the Git repository. For HTTP/S basic authentication, the Secret must contain the username and password fields. For SSH authentication, the identity, identity.pub and known_hosts fields must be includedsec-name
timeoutoptional, The timeout period of the download operation, the default is 20s60s
chartrequired, Chart storage path (key)./chart/podinfo-5.1.3.tgz
versionoptional, In Git source, this parameter has no effect
targetNamespaceoptional, the namespace to install chart, decided by chart itselfyour-ns
releaseNameoptional, Installed release nameyour-rn
valuesoptional, Overwrite the Values.yaml of the chart for Helm rendering.
git.branchoptional, Git branch, master by defaultdev

Example#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-delivering-chart
spec:
components:
- name: terraform-controller
type: helm
properties:
repoType: git
url: https://github.com/oam-dev/terraform-controller
chart: ./chart
git:
branch: master

Webservice#

Description#

Describes long-running, scalable, containerized services that have a stable network endpoint to receive external network traffic from customers.

Properties#

NameDescriptionTypeRequiredDefault
cmdCommands to run in the container[]stringfalse
envDefine arguments by using environment variables[]envfalse
volumeMountsvolumeMountsfalse
labelsSpecify the labels in the workloadmap[string]stringfalse
annotationsSpecify the annotations in the workloadmap[string]stringfalse
imageWhich image would you like to use for your servicestringtrue
portsWhich ports do you want customer traffic sent to, defaults to 80[]portsfalse
imagePullPolicySpecify image pull policy for your servicestringfalse
cpuNumber of CPU units for the service, like 0.5 (0.5 CPU core), 1 (1 CPU core)stringfalse
memorySpecifies the attributes of the memory resource required for the container.stringfalse
volumesDeprecated field, use volumeMounts instead.[]volumesfalse
livenessProbeInstructions for assessing whether the container is alive.livenessProbefalse
readinessProbeInstructions for assessing whether the container is in a suitable state to serve traffic.readinessProbefalse
imagePullSecretsSpecify image pull secrets for your service[]stringfalse

readinessProbe#

NameDescriptionTypeRequiredDefault
hostAliasesSpecify the hostAliases to add[]hostAliasestrue
execInstructions for assessing container health by executing a command. Either this attribute or the httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the httpGet attribute and the tcpSocket attribute.execfalse
httpGetInstructions for assessing container health by executing an HTTP GET request. Either this attribute or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the tcpSocket attribute.httpGetfalse
tcpSocketInstructions for assessing container health by probing a TCP socket. Either this attribute or the exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the httpGet attribute.tcpSocketfalse
initialDelaySecondsNumber of seconds after the container is started before the first probe is initiated.inttrue0
periodSecondsHow often, in seconds, to execute the probe.inttrue10
timeoutSecondsNumber of seconds after which the probe times out.inttrue1
successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.inttrue1
failureThresholdNumber of consecutive failures required to determine the container is not alive (liveness probe) or not ready (readiness probe).inttrue3
tcpSocket#
NameDescriptionTypeRequiredDefault
portThe TCP socket within the container that should be probed to assess container health.inttrue
httpGet#
NameDescriptionTypeRequiredDefault
pathThe endpoint, relative to the port, to which the HTTP GET request should be directed.stringtrue
portThe TCP socket within the container to which the HTTP GET request should be directed.inttrue
httpHeaders[]httpHeadersfalse
httpHeaders#
NameDescriptionTypeRequiredDefault
namestringtrue
valuestringtrue
exec#
NameDescriptionTypeRequiredDefault
commandA command to be executed inside the container to assess its health. Each space delimited token of the command is a separate array element. Commands exiting 0 are considered to be successful probes, whilst all other exit codes are considered failures.[]stringtrue
hostAliases#
NameDescriptionTypeRequiredDefault
ipstringtrue
hostnames[]stringtrue

livenessProbe#

NameDescriptionTypeRequiredDefault
hostAliasesSpecify the hostAliases to add[]hostAliasestrue
execInstructions for assessing container health by executing a command. Either this attribute or the httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the httpGet attribute and the tcpSocket attribute.execfalse
httpGetInstructions for assessing container health by executing an HTTP GET request. Either this attribute or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the tcpSocket attribute.httpGetfalse
tcpSocketInstructions for assessing container health by probing a TCP socket. Either this attribute or the exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with both the exec attribute and the httpGet attribute.tcpSocketfalse
initialDelaySecondsNumber of seconds after the container is started before the first probe is initiated.inttrue0
periodSecondsHow often, in seconds, to execute the probe.inttrue10
timeoutSecondsNumber of seconds after which the probe times out.inttrue1
successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.inttrue1
failureThresholdNumber of consecutive failures required to determine the container is not alive (liveness probe) or not ready (readiness probe).inttrue3
tcpSocket#
NameDescriptionTypeRequiredDefault
portThe TCP socket within the container that should be probed to assess container health.inttrue
httpGet#
NameDescriptionTypeRequiredDefault
pathThe endpoint, relative to the port, to which the HTTP GET request should be directed.stringtrue
portThe TCP socket within the container to which the HTTP GET request should be directed.inttrue
httpHeaders[]httpHeadersfalse
httpHeaders#
NameDescriptionTypeRequiredDefault
namestringtrue
valuestringtrue
exec#
NameDescriptionTypeRequiredDefault
commandA command to be executed inside the container to assess its health. Each space delimited token of the command is a separate array element. Commands exiting 0 are considered to be successful probes, whilst all other exit codes are considered failures.[]stringtrue
hostAliases#
NameDescriptionTypeRequiredDefault
ipstringtrue
hostnames[]stringtrue

volumes#

NameDescriptionTypeRequiredDefault
namestringtrue
mountPathstringtrue
typeSpecify volume type, options: "pvc","configMap","secret","emptyDir"stringtrue

ports#

NameDescriptionTypeRequiredDefault
nameName of the portstringfalse
portNumber of port to expose on the pod's IP addressinttrue
protocolProtocol for port. Must be UDP, TCP, or SCTPstringtrueTCP
exposeSpecify if the port should be exposedbooltruefalse

volumeMounts#

NameDescriptionTypeRequiredDefault
pvcMount PVC type volume[]pvcfalse
configMapMount ConfigMap type volume[]configMapfalse
secretMount Secret type volume[]secretfalse
emptyDirMount EmptyDir type volume[]emptyDirfalse
hostPathMount HostPath type volume[]hostPathfalse
hostPath#
NameDescriptionTypeRequiredDefault
pathstringtrue
namestringtrue
mountPathstringtrue
emptyDir#
NameDescriptionTypeRequiredDefault
namestringtrue
mountPathstringtrue
mediumstringtrueempty
secret#
NameDescriptionTypeRequiredDefault
namestringtrue
mountPathstringtrue
defaultModeinttrue420
items[]itemsfalse
secretNamestringtrue
items#
NameDescriptionTypeRequiredDefault
pathstringtrue
keystringtrue
modeinttrue511
configMap#
NameDescriptionTypeRequiredDefault
namestringtrue
mountPathstringtrue
defaultModeinttrue420
cmNamestringtrue
items[]itemsfalse
items#
NameDescriptionTypeRequiredDefault
pathstringtrue
keystringtrue
modeinttrue511
pvc#
NameDescriptionTypeRequiredDefault
namestringtrue
mountPathstringtrue
claimNameThe name of the PVCstringtrue

env#

NameDescriptionTypeRequiredDefault
nameEnvironment variable namestringtrue
valueThe value of the environment variablestringfalse
valueFromSpecifies a source the value of this var should come fromvalueFromfalse
valueFrom#
NameDescriptionTypeRequiredDefault
secretKeyRefSelects a key of a secret in the pod's namespacesecretKeyReffalse
configMapKeyRefSelects a key of a config map in the pod's namespaceconfigMapKeyReffalse
configMapKeyRef#
NameDescriptionTypeRequiredDefault
nameThe name of the config map in the pod's namespace to select fromstringtrue
keyThe key of the config map to select from. Must be a valid secret keystringtrue
secretKeyRef#
NameDescriptionTypeRequiredDefault
nameThe name of the secret in the pod's namespace to select fromstringtrue
keyThe key of the secret to select from. Must be a valid secret keystringtrue

Examples#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: website
spec:
components:
- name: frontend
type: webservice
properties:
image: oamdev/testapp:v1
cmd: ["node", "server.js"]
port: 8080
cpu: "0.1"
env:
- name: FOO
value: bar
- name: FOO
valueFrom:
secretKeyRef:
name: bar
key: bar

Worker#

Describes long-running, scalable, containerized services that running at backend. They do NOT have network endpoint to receive external network traffic.

Parameters#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
cmdCommands to run in the container[]stringfalse
envDefine arguments by using environment variables[]envfalse
imageWhich image would you like to use for your servicestringtrue
imagePullPolicySpecify image pull policy for your servicestringfalse
cpuNumber of CPU units for the service, like 0.5 (0.5 CPU core), 1 (1 CPU core)stringfalse
memorySpecifies the attributes of the memory resource required for the container.stringfalse
volumesDeclare volumes and volumeMounts[]volumesfalse
livenessProbeInstructions for assessing whether the container is alive.livenessProbefalse
readinessProbeInstructions for assessing whether the container is in a suitable state to serve traffic.readinessProbefalse
imagePullSecretsSpecify image pull secrets for your service[]stringfalse

readinessProbe#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
execInstructions for assessing container health by executing a command. Either this attribute or theexecfalse
httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive
with both the httpGet attribute and the tcpSocket attribute.
httpGetInstructions for assessing container health by executing an HTTP GET request. Either this attributehttpGetfalse
or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually
exclusive with both the exec attribute and the tcpSocket attribute.
tcpSocketInstructions for assessing container health by probing a TCP socket. Either this attribute or thetcpSocketfalse
exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with
both the exec attribute and the httpGet attribute.
initialDelaySecondsNumber of seconds after the container is started before the first probe is initiated.inttrue0
periodSecondsHow often, in seconds, to execute the probe.inttrue10
timeoutSecondsNumber of seconds after which the probe times out.inttrue1
successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.inttrue1
failureThresholdNumber of consecutive failures required to determine the container is not alive (liveness probe) orinttrue3
not ready (readiness probe).
tcpSocket#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
portThe TCP socket within the container that should be probed to assess container health.inttrue

httpGet#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
pathThe endpoint, relative to the port, to which the HTTP GET request should be directed.stringtrue
portThe TCP socket within the container to which the HTTP GET request should be directed.inttrue
httpHeaders[]httpHeadersfalse
httpHeaders#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
valuestringtrue
exec#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
commandA command to be executed inside the container to assess its health. Each space delimited token of[]stringtrue
the command is a separate array element. Commands exiting 0 are considered to be successful probes,
whilst all other exit codes are considered failures.

livenessProbe#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
execInstructions for assessing container health by executing a command. Either this attribute or theexecfalse
httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive
with both the httpGet attribute and the tcpSocket attribute.
httpGetInstructions for assessing container health by executing an HTTP GET request. Either this attributehttpGetfalse
or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually
exclusive with both the exec attribute and the tcpSocket attribute.
tcpSocketInstructions for assessing container health by probing a TCP socket. Either this attribute or thetcpSocketfalse
exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with
both the exec attribute and the httpGet attribute.
initialDelaySecondsNumber of seconds after the container is started before the first probe is initiated.inttrue0
periodSecondsHow often, in seconds, to execute the probe.inttrue10
timeoutSecondsNumber of seconds after which the probe times out.inttrue1
successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.inttrue1
failureThresholdNumber of consecutive failures required to determine the container is not alive (liveness probe) orinttrue3
not ready (readiness probe).

tcpSocket#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
portThe TCP socket within the container that should be probed to assess container health.inttrue

httpGet#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
pathThe endpoint, relative to the port, to which the HTTP GET request should be directed.stringtrue
portThe TCP socket within the container to which the HTTP GET request should be directed.inttrue
httpHeaders[]httpHeadersfalse
httpHeaders#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
valuestringtrue

exec#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
commandA command to be executed inside the container to assess its health. Each space delimited token of[]stringtrue
the command is a separate array element. Commands exiting 0 are considered to be successful probes,
whilst all other exit codes are considered failures.

volumes#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
mountPathstringtrue
typeSpecify volume type, options: "pvc","configMap","secret","emptyDir"stringtrue

env#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
nameEnvironment variable namestringtrue
valueThe value of the environment variablestringfalse
valueFromSpecifies a source the value of this var should come fromvalueFromfalse

valueFrom#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
secretKeyRefSelects a key of a secret in the pod's namespacesecretKeyReftrue

secretKeyRef#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
nameThe name of the secret in the pod's namespace to select fromstringtrue
keyThe key of the secret to select from. Must be a valid secret keystringtrue

Examples#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-worker
spec:
components:
- name: myworker
type: worker
properties:
image: "busybox"
cmd:
- sleep
- "1000"

Task#

Describes jobs that run code or a script to completion.

Parameters#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
cmdCommands to run in the container[]stringfalse
envDefine arguments by using environment variables[]envfalse
countSpecify number of tasks to run in parallelinttrue1
restartDefine the job restart policy, the value can only be Never or OnFailure. By default, it's Never.stringtrueNever
imageWhich image would you like to use for your servicestringtrue
cpuNumber of CPU units for the service, like 0.5 (0.5 CPU core), 1 (1 CPU core)stringfalse
memorySpecifies the attributes of the memory resource required for the container.stringfalse
volumesDeclare volumes and volumeMounts[]volumesfalse
livenessProbeInstructions for assessing whether the container is alive.livenessProbefalse
readinessProbeInstructions for assessing whether the container is in a suitable state to serve traffic.readinessProbefalse
labelsSpecify the labels in the workload[]stringfalse
annotationsSpecify the annotations in the workload[]stringfalse
imagePullPolicySpecify image pull policy for your servicestringfalse
imagePullSecretsSpecify image pull secrets for your service[]stringfalse

readinessProbe#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
execInstructions for assessing container health by executing a command. Either this attribute or theexecfalse
httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive
with both the httpGet attribute and the tcpSocket attribute.
httpGetInstructions for assessing container health by executing an HTTP GET request. Either this attributehttpGetfalse
or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually
exclusive with both the exec attribute and the tcpSocket attribute.
tcpSocketInstructions for assessing container health by probing a TCP socket. Either this attribute or thetcpSocketfalse
exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with
both the exec attribute and the httpGet attribute.
initialDelaySecondsNumber of seconds after the container is started before the first probe is initiated.inttrue0
periodSecondsHow often, in seconds, to execute the probe.inttrue10
timeoutSecondsNumber of seconds after which the probe times out.inttrue1
successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.inttrue1
failureThresholdNumber of consecutive failures required to determine the container is not alive (liveness probe) orinttrue3
not ready (readiness probe).

tcpSocket#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
portThe TCP socket within the container that should be probed to assess container health.inttrue

httpGet#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
pathThe endpoint, relative to the port, to which the HTTP GET request should be directed.stringtrue
portThe TCP socket within the container to which the HTTP GET request should be directed.inttrue
httpHeaders[]httpHeadersfalse
httpHeaders#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
valuestringtrue

exec#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
commandA command to be executed inside the container to assess its health. Each space delimited token of[]stringtrue
the command is a separate array element. Commands exiting 0 are considered to be successful probes,
whilst all other exit codes are considered failures.

livenessProbe#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
execInstructions for assessing container health by executing a command. Either this attribute or theexecfalse
httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive
with both the httpGet attribute and the tcpSocket attribute.
httpGetInstructions for assessing container health by executing an HTTP GET request. Either this attributehttpGetfalse
or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually
exclusive with both the exec attribute and the tcpSocket attribute.
tcpSocketInstructions for assessing container health by probing a TCP socket. Either this attribute or thetcpSocketfalse
exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with
both the exec attribute and the httpGet attribute.
initialDelaySecondsNumber of seconds after the container is started before the first probe is initiated.inttrue0
periodSecondsHow often, in seconds, to execute the probe.inttrue10
timeoutSecondsNumber of seconds after which the probe times out.inttrue1
successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.inttrue1
failureThresholdNumber of consecutive failures required to determine the container is not alive (liveness probe) orinttrue3
not ready (readiness probe).

tcpSocket#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
portThe TCP socket within the container that should be probed to assess container health.inttrue

httpGet#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
pathThe endpoint, relative to the port, to which the HTTP GET request should be directed.stringtrue
portThe TCP socket within the container to which the HTTP GET request should be directed.inttrue
httpHeaders[]httpHeadersfalse
httpHeaders#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
valuestringtrue

exec#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
commandA command to be executed inside the container to assess its health. Each space delimited token of[]stringtrue
the command is a separate array element. Commands exiting 0 are considered to be successful probes,
whilst all other exit codes are considered failures.
volumes#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
mountPathstringtrue
typeSpecify volume type, options: "pvc","configMap","secret","emptyDir"stringtrue

env#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
nameEnvironment variable namestringtrue
valueThe value of the environment variablestringfalse
valueFromSpecifies a source the value of this var should come fromvalueFromfalse

valueFrom#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
secretKeyRefSelects a key of a secret in the pod's namespacesecretKeyReftrue

secretKeyRef#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
nameThe name of the secret in the pod's namespace to select fromstringtrue
keyThe key of the secret to select from. Must be a valid secret keystringtrue

Examples#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-worker
spec:
components:
- name: mytask
type: task
properties:
image: perl
count: 10
cmd: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]

Cron Task#

Describes cron jobs that run code or a script to completion.

Parameters#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
cmdCommands to run in the container[]stringfalse
envDefine arguments by using environment variables[]envfalse
scheduleSpecify the schedule in Cron formatstringtrue
suspendSuspend subsequent executionsboolfalsefalse
concurrencyPolicySpecifies how to treat concurrent executions of a JobstringfalseAllow
successfulJobsHistoryLimitThe number of successful finished jobs to retainintfalse3
failedJobsHistoryLimitThe number of failed finished jobs to retainintfalse1
countSpecify number of tasks to run in parallelinttrue1
restartDefine the job restart policy, the value can only be Never or OnFailure. By default, it's Never.stringtrueNever
imageWhich image would you like to use for your servicestringtrue
cpuNumber of CPU units for the service, like 0.5 (0.5 CPU core), 1 (1 CPU core)stringfalse
memorySpecifies the attributes of the memory resource required for the container.stringfalse
volumesDeclare volumes and volumeMounts[]volumesfalse
livenessProbeInstructions for assessing whether the container is alive.livenessProbefalse
readinessProbeInstructions for assessing whether the container is in a suitable state to serve traffic.readinessProbefalse
labelsSpecify the labels in the workload[]stringfalse
annotationsSpecify the annotations in the workload[]stringfalse
imagePullPolicySpecify image pull policy for your servicestringfalse
imagePullSecretsSpecify image pull secrets for your service[]stringfalse

readinessProbe#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
execInstructions for assessing container health by executing a command. Either this attribute or theexecfalse
httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive
with both the httpGet attribute and the tcpSocket attribute.
httpGetInstructions for assessing container health by executing an HTTP GET request. Either this attributehttpGetfalse
or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually
exclusive with both the exec attribute and the tcpSocket attribute.
tcpSocketInstructions for assessing container health by probing a TCP socket. Either this attribute or thetcpSocketfalse
exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with
both the exec attribute and the httpGet attribute.
initialDelaySecondsNumber of seconds after the container is started before the first probe is initiated.inttrue0
periodSecondsHow often, in seconds, to execute the probe.inttrue10
timeoutSecondsNumber of seconds after which the probe times out.inttrue1
successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.inttrue1
failureThresholdNumber of consecutive failures required to determine the container is not alive (liveness probe) orinttrue3
not ready (readiness probe).

tcpSocket#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
portThe TCP socket within the container that should be probed to assess container health.inttrue

httpGet#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
pathThe endpoint, relative to the port, to which the HTTP GET request should be directed.stringtrue
portThe TCP socket within the container to which the HTTP GET request should be directed.inttrue
httpHeaders[]httpHeadersfalse
httpHeaders#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
valuestringtrue

exec#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
commandA command to be executed inside the container to assess its health. Each space delimited token of[]stringtrue
the command is a separate array element. Commands exiting 0 are considered to be successful probes,
whilst all other exit codes are considered failures.

livenessProbe#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
execInstructions for assessing container health by executing a command. Either this attribute or theexecfalse
httpGet attribute or the tcpSocket attribute MUST be specified. This attribute is mutually exclusive
with both the httpGet attribute and the tcpSocket attribute.
httpGetInstructions for assessing container health by executing an HTTP GET request. Either this attributehttpGetfalse
or the exec attribute or the tcpSocket attribute MUST be specified. This attribute is mutually
exclusive with both the exec attribute and the tcpSocket attribute.
tcpSocketInstructions for assessing container health by probing a TCP socket. Either this attribute or thetcpSocketfalse
exec attribute or the httpGet attribute MUST be specified. This attribute is mutually exclusive with
both the exec attribute and the httpGet attribute.
initialDelaySecondsNumber of seconds after the container is started before the first probe is initiated.inttrue0
periodSecondsHow often, in seconds, to execute the probe.inttrue10
timeoutSecondsNumber of seconds after which the probe times out.inttrue1
successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.inttrue1
failureThresholdNumber of consecutive failures required to determine the container is not alive (liveness probe) orinttrue3
not ready (readiness probe).

tcpSocket#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
portThe TCP socket within the container that should be probed to assess container health.inttrue

httpGet#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
pathThe endpoint, relative to the port, to which the HTTP GET request should be directed.stringtrue
portThe TCP socket within the container to which the HTTP GET request should be directed.inttrue
httpHeaders[]httpHeadersfalse
httpHeaders#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
valuestringtrue

exec#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
commandA command to be executed inside the container to assess its health. Each space delimited token of[]stringtrue
the command is a separate array element. Commands exiting 0 are considered to be successful probes,
whilst all other exit codes are considered failures.
volumes#
NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
namestringtrue
mountPathstringtrue
typeSpecify volume type, options: "pvc","configMap","secret","emptyDir"stringtrue

env#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
nameEnvironment variable namestringtrue
valueThe value of the environment variablestringfalse
valueFromSpecifies a source the value of this var should come fromvalueFromfalse

valueFrom#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
secretKeyRefSelects a key of a secret in the pod's namespacesecretKeyReftrue

secretKeyRef#

NAMEDESCRIPTIONTYPEREQUIREDDEFAULT
nameThe name of the secret in the pod's namespace to select fromstringtrue
keyThe key of the secret to select from. Must be a valid secret keystringtrue

Examples#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: cron-worker
spec:
components:
- name: mytask
type: cron-task
properties:
image: perl
count: 10
cmd: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
schedule: "*/1 * * * *"

Kustomize ( repoType: oss )#

KubeVela's kustomize component meets the needs of users to directly connect Yaml files and folders as component products. No matter whether your Yaml file/folder is stored in a Git Repo or an OSS bucket, KubeVela can read and deliver it.

Parameters#

ParametersDescriptionExample
repoTyperequired, The value of the Git. To indicate that kustomize configuration comes from the Git repositoryoss
pullIntervaloptional, Synchronize with Git repository, and the time interval between tuning helm release. The default value is 5m (5 minutes)10m
urlrequired, bucket's endpoint, no need to fill in with schemeoss-cn-beijing.aliyuncs.com
secretRefoptional, Save the name of a Secret, which is the credential to read the bucket. Secret contains accesskey and secretkey fieldssec-name
timeoutoptional, The timeout period of the download operation, the default is 20s60s
pathrequired, The directory containing the kustomization.yaml file, or the directory containing a set of YAML files (used to generate kustomization.yaml)./prod
oss.bucketNamerequired, bucket nameyour-bucket
oss.provideroptional, Generic or aws, if you get the certificate from aws EC2, fill in aws. The default is generic.generic
oss.regionoptional, bucket region

Examples#

Let's take the YAML folder component from the OSS bucket registry as an example to explain the usage. In the Application we will deliver a component named bucket-comp. The deployment file corresponding to the component is stored in the cloud storage OSS bucket, and the corresponding bucket name is definition-registry. kustomize.yaml comes from this address of oss-cn-beijing.aliyuncs.com and the path is ./app/prod/.

  1. (Optional) If your OSS bucket needs identity verification, create a Secret:
$ kubectl create secret generic bucket-secret --from-literal=accesskey=<your-ak> --from-literal=secretkey=<your-sk>
secret/bucket-secret created
  1. Deploy it:
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: bucket-app
spec:
components:
- name: bucket-comp
type: kustomize
properties:
repoType: oss
# If the bucket is private, you will need to provide
secretRef: bucket-secret
url: oss-cn-beijing.aliyuncs.com
oss:
bucketName: definition-registry
path: ./app/prod/

Kustomize ( repoType: git )#

Parameters#

ParametersDescriptionExample
repoTyperequired, The value of the Git. To indicate that kustomize configuration comes from the Git repositorygit
pullIntervaloptional, Synchronize with Git repository, and the time interval between tuning helm release. The default value is 5m (5 minutes)10m
urlrequired, Git repository addresshttps://github.com/oam-dev/terraform-controller
secretRefoptional, The Secret object name that holds the credentials required to pull the Git repository. The username and password fields must be included in the HTTP/S basic authentication Secret. For SSH authentication, the identity, identity.pub and known_hosts fields must be includedsec-name
timeoutoptional, The timeout period of the download operation, the default is 20s60s
git.branchoptional, Git branch, master by defaultdev
git.provideroptional, Determines which git client library to use. Defaults to GitHub, it will pick go-git. AzureDevOps will pick libgit2GitHub

Examples#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: git-app
spec:
components:
- name: git-comp
type: kustomize
properties:
repoType: git
url: https://github.com/<path>/<to>/<repo>
git:
branch: master
provider: GitHub
path: ./app/dev/

Override Kustomize

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: bucket-app
spec:
components:
- name: bucket-comp
type: kustomize
properties:
# ...omitted for brevity
path: ./app/

Kustomize ( Watch Image Registry )#

Parameter#

ParameterRequiredDescriptionExample
imagerequiredThe image urloamdev/vela-core
secretRefoptionalIf it's a private image registry, use kubectl create secret docker-registry to create the secretmy-secret
policy.alphabetical.orderoptionalOrder specifies the sorting order of the tags. Given the letters of the alphabet as tags, ascending order would select Z, and descending order would select Aasc
policy.numerical.orderoptionalGiven the integer values from 0 to 9 as tags, ascending order would select 9, and descending order would select 0asc
policy.semver.rangeoptionalRange gives a semver range for the image tag; the highest version within the range that's a tag yields the latest image'>=1.0.0 <2.0.0'
filterTags.extractoptionalExtract allows a capture group to be extracted from the specified regular expression pattern, useful before tag evaluation$timestamp
filterTags.patternoptionalPattern specifies a regular expression pattern used to filter for image tags'^master-[a-f0-9]'
commitMessageoptionalUse for more commit message'Image: {{range .Updated.Images}}{{println .}}{{end}}'

Example#

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: image-app
spec:
components:
- name: image
type: kustomize
properties:
imageRepository:
image: <your image>
secretRef: imagesecret
filterTags:
pattern: '^master-[a-f0-9]+-(?P<ts>[0-9]+)'
extract: '$ts'
policy:
numerical:
order: asc
commitMessage: "Image: {{range .Updated.Images}}{{println .}}{{end}}"
Last updated on by Jianbo Sun