Kubernetes Operator to manage installations, updates and removal of Tektoncd projects (pipeline, dashboard, …)
The following steps will install Tekton Pipeline and configure it appropriately for your cluster.
-
Create namespace:
tekton-operator
kubectl create namespace tekton-operator
-
Apply Operator CRD
kubectl apply -f deploy/crds/operator_v1alpha1_config_crd.yaml
kubectl apply -f deploy/crds/operator_v1alpha1_addon_crd.yaml
-
Deploy the Operator
kubectl -n tekton-operator apply -f deploy/
The Operator will automatic install
Tekton pipeline
withv0.10.0
in the namespacetekton-pipeline
go
: The language Tektoncd-pipeline-operator is built ingit
: For source controlkubectl
: For interacting with your kube cluster- operator-sdk: https://github.com/operator-framework/operator-sdk
-
Apply Operator CRD
kubectl apply -f deploy/crds/*_crd.yaml
-
start operator
make local-dev
-
Update the dependencies
make update-deps
-
run
local-test-e2e
-
to watch resources getting created/deleted, run in a separate terminal:
watch -d -n 1 kubectl get all -n tekton-pipelines
-
Enable go mod
export GO111MODULE=on
-
Build go and the container image
operator-sdk build ${YOUR_REGISTORY}/openshift-pipelines-operator:${IMAGE_TAG}
-
Push the container image
docker push ${YOUR-REGISTORY}/openshift-pipelines-operator:${IMAGE-TAG}
-
Edit the 'image' value in deploy/operator.yaml to match to your image
This is a sample of crd
apiVersion: operator.tekton.dev/v1alpha1
kind: Config
metadata:
name: cluster
spec:
targetNamespace: tekton-pipelines
The crd is Cluster scope
, and targetNamespace
means Tekton Pipleine
will installed in it.
By default the cr will be created automatic, means Tekton Pipeline
will be installed automatic when Operator installed.
To change the behavior, you could add argument: no-auto-install=true
to deploy/operator.yaml, like this:
args:
- --no-auto-install=true
Then install Tekton Pipeline
manually:
kubectl apply -f deploy/crds/*_cr.yaml
Supported addon components are installed by creating the 'addon' CR for the component.
Sample CR
apiVersion: operator.tekton.dev/v1alpha1
kind: Addon
metadata:
name: dashboard
spec:
version: v0.1.0
The current supported components and versions are:
- dashboard
- v0.1.1
- v0.2.0
- openshift-v0.2.0
- extensionwebhooks
- v0.2.0
- openshift-v0.2.0
- trigger
- v0.1.0
- v0.2.0