Skip to main content

Runtime

This component is responsible for integrating with a runtime environment based off the configuration provided.

The runtime environment is used by Vela for executing workload resources and managing their lifecycle.

Configuration

The following options are used to configure the component:

NameDescriptionRequiredDefaultEnvironment Variables
runtime.configpath to configuration file for the runtimefalseN/ARUNTIME_CONFIG`VELA_RUNTIME_CONFIG`
runtime.drivertype of client to control and operate runtimetruedockerRUNTIME_DRIVER`VELA_RUNTIME_DRIVER`
runtime.namespacenamespace to use for the runtime (only for kubernetes)falseN/ARUNTIME_NAMESPACE`VELA_RUNTIME_NAMESPACE`
runtime.pods-template-namename of the PipelinePodsTemplate to retrieve from the runtime.namespace (only for kubernetes)falseN/ARUNTIME_PODS_TEMPLATE_NAME`VELA_RUNTIME_PODS_TEMPLATE_NAME`
runtime.pods-template-filepath to local fallback file containing a PipelinePodsTemplate in YAML (only for kubernetes)falseN/ARUNTIME_PODS_TEMPLATE_FILE`VELA_RUNTIME_PODS_TEMPLATE_FILE`
runtime.privileged-imagesimages allowed to run in privileged mode for the runtimefalse[ ]RUNTIME_PRIVILEGED_IMAGES`VELA_RUNTIME_PRIVILEGED_IMAGES`
runtime.drop-capabilitieskernel capabilities to be dropped from each running containerfalseN/ARUNTIME_DROP_CAPABILITIES`VELA_RUNTIME_DROP_CAPABILITIES`
runtime.volumespath to host volumes to mount into resources for the runtimefalseN/ARUNTIME_VOLUMES`VELA_RUNTIME_VOLUMES`
note

For more information on these configuration options, please see the worker reference.

Drivers

The following drivers are available to configure the component:

NameDescriptionDocumentation
dockeruses a Docker daemon for creating and managing runtime resourceshttps://docker.io/
kubernetesuses a Kubernetes cluster for creating and managing runtime resourceshttps://kubernetes.io/

Docker

From the Docker official website:

Docker takes away repetitive, mundane configuration tasks and is used throughout the development lifecycle for fast, easy and portable application development - desktop and cloud. Docker’s comprehensive end to end platform includes UIs, CLIs, APIs and security that are engineered to work together across the entire application delivery lifecycle.

The below configuration displays an example of starting the Vela worker that will use a Docker runtime:

$ docker run \
--detach=true \
--env=VELA_QUEUE_DRIVER=redis \
+ --env=VELA_RUNTIME_DRIVER=docker \
--env=VELA_SERVER_ADDR=https://vela-server.example.com \
--env=VELA_SERVER_SECRET=<shared-secret> \
--env=VELA_WORKER_ADDR=https://vela-worker.example.com \
--name=worker \
--publish=80:80 \
--publish=443:443 \
--restart=always \
--volume=/var/run/docker.sock:/var/run/docker.sock
target/vela-worker:latest
note

This Docker configuration is enabled by default and is not necessary to provide in order for Vela to operate.

Kubernetes

From the Kubernetes official website:

Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.

The below configuration displays an example of starting the Vela worker that will use a Kubernetes runtime:

$ docker run \
--detach=true \
--env=VELA_QUEUE_DRIVER=redis \
+ --env=VELA_RUNTIME_DRIVER=kubernetes \
+ --env=VELA_RUNTIME_CONFIG=/root/.kube/config \
+ --env=VELA_RUNTIME_NAMESPACE=vela \
--env=VELA_SERVER_ADDR=https://vela-server.example.com \
--env=VELA_SERVER_SECRET=<shared-secret> \
--env=VELA_WORKER_ADDR=https://vela-worker.example.com \
--name=worker \
--publish=80:80 \
--publish=443:443 \
--restart=always \
--volume=/var/run/docker.sock:/var/run/docker.sock \
+ --volume=/root/.kube/config:/root/.kube/config \
target/vela-worker:latest