Tekton Interceptor to get
pipeline-config
from Kubernetes ConfigMap
kube-pipeline-config
reads pipeline-config
from Kubernetes ConfigMap, then tries to read
existing one
from InterceptorRequest#extensions["pipeline-config"]
, merges them together, and returns merged result
as InterceptorResponse#extensions["pipeline-config"]
.
kube-pipeline-config
can be configured by using environment variables, a configuration file, or flags.
Environment Variable | Description | Required | Default |
---|---|---|---|
ADDR |
The address and port. | No | "0.0.0.0:80" |
Field Name | Description | Required | Default |
---|---|---|---|
addr |
The address and port. | No | "0.0.0.0:80" |
Sample configuration file:
addr: "0.0.0.0:80"
By default, kube-pipeline-config
lookups a configuration file in the following order:
$HOME/.config/kube-pipeline-config/config.yaml
/etc/config/kube-pipeline-config/config.yaml
$PWD/config/kube-pipeline-config/config.yaml
Also, kube-pipeline-config
allows to set a path to a configuration file by using a --config
flag:
kube-pipeline-config --config=$PWD/kube-pipeline-config.yaml
Flag Name | Description | Required | Default |
---|---|---|---|
config |
The path to the config file. | No | "" |
kube-pipeline-config
allows to specify namespace
and name
parameters to read Kubernetes ConfigMap.
Parameter Name | Description |
---|---|
namespace |
The namespace where to lookup Kubernetes ConfigMap. |
name |
The name of Kubernetes ConfigMap. |
Sample Trigger
file:
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: Trigger
metadata:
name: my-trigger
spec:
interceptors:
- params:
- name: name
value: my-pipeline-config-cm
- name: namespace
value: tekton
ref:
kind: ClusterInterceptor
name: kube-pipeline-config
kube-pipeline-config
watches for any further changes of received Kubernetes ConfigMap, but it should be properly
annotated with labels.name
equals to pipeline-config-cm
and has config.yaml
field, eg. my-pipeline-config-cm
:
apiVersion: v1
kind: ConfigMap
metadata:
name: my-pipeline-config-cm
namespace: tekton
labels:
name: pipeline-config-cm
data:
config.yaml: |