Overview
A kubernetes
pipeline executes pipeline steps as containers inside a Kubernetes Pod. Containers provide isolation allowing safe execution of concurrent pipelines on the same machine.
Example pipeline configuration:
1 ---
2 kind: pipeline
3 type: kubernetes
4 name: default
5
6 steps:
7 - name: greeting
8 image: golang:1.12
9 commands:
10 - go build
11 - go test
12
13 ...
The kind and type attributes define a Kubernetes pipeline.
1 ---
2 kind: pipeline
3 type: kubernetes
The steps
section defines a series of shell commands. These commands are executed inside the Docker container as the Entrypoint
. If any command returns a non-zero exit code, the pipeline fails and exits.
6 steps:
7 - name: greeting
8 image: golang:1.12
9 commands:
10 - go build
11 - go test
To bind a non-default service account to a pipeline and allow for more fine-grained access to resouces, do the following:
1 ---
2 kind: pipeline
3 type: kubernetes
4 service_account_name: builder