Installation
Obviously we need a kubernetes cluster. For studies use kind to set up your local cluster. Check the kubernetes version needed for the latest version of tekton, as updates to the kubernetes APIs have an impact.
Although not mandatory, the metric server is important to be installed for high availability situations. Get used to always using it in the cluster. Without it we don't have vertical and horizontal autoscaling.
Although there are ready-made helm charts for installation, it is recommended to use the operator.
For studies we can use the manifest installation with the command below.
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
But it's good to go straight to learning in production mode using the Tekton Operator which makes future updates and configuration changes easier if necessary.
# Install Operator Lifecycle Manager (OLM), a tool to help manage the Operators running on your cluster.
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.28.0/install.sh | bash -s v0.28.0
# Install the operator by running the following command:
kubectl create -f https://operatorhub.io/install/tektoncd-operator.yaml
# After install, watch your operator come up using next command
kubectl get csv -n operators
NAME DISPLAY VERSION REPLACES PHASE
tektoncd-operator.v0.70.0 Tektoncd Operator 0.70.0 tektoncd-operator.v0.69.1 Pending
Checking what we have in the tekton manifest we can edit and deactivate or activate some things in the future.
The profile will say which tools will be installed. If you change the profile automatically the operator will stop some resources. Take a look at the operator documentation.
| Platform | Profile | Installed Component |
|---|---|---|
| Kubernetes, OpenShift | lite | Pipeline |
| Kubernetes, OpenShift | basic | Pipeline, Trigger, Chains |
| Kubernetes | all | Pipeline, Trigger, Chains, Dashboard |
| OpenShift | all | Pipeline, Trigger, Chains, Pipelines as Code, Addons |
kubectl get -n olm tektonconfigs.operator.tekton.dev config -o yaml
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
creationTimestamp: "2024-07-31T02:36:13Z"
finalizers:
- tektonconfigs.operator.tekton.dev
generation: 1
labels:
operator.tekton.dev/release-version: v0.70.0
name: config
resourceVersion: "1826693"
uid: 5704dc6d-d8b5-4e13-84fe-e65c035a94a2
spec:
addon: {}
chain:
disabled: false
options:
disabled: false
config: {}
dashboard:
options:
disabled: false
readonly: false
hub:
options:
disabled: false
pipeline:
await-sidecar-readiness: true
coschedule: workspaces
disable-creds-init: false
enable-api-fields: beta
enable-bundles-resolver: true
enable-cel-in-whenexpression: false
enable-cluster-resolver: true
enable-custom-tasks: true
enable-git-resolver: true
enable-hub-resolver: true
enable-param-enum: false
enable-provenance-in-status: true
enable-step-actions: false
enable-tekton-oci-bundles: false
enforce-nonfalsifiability: none
keep-pod-on-cancel: false
max-result-size: 4096
metrics.count.enable-reason: false
metrics.pipelinerun.duration-type: histogram
metrics.pipelinerun.level: pipeline
metrics.taskrun.duration-type: histogram
metrics.taskrun.level: task
options:
disabled: false
performance:
disable-ha: false
require-git-ssh-secret-known-hosts: false
results-from: termination-message
running-in-environment-with-injected-sidecars: true
send-cloudevents-for-runs: false
set-security-context: false
trusted-resources-verification-no-match-policy: ignore
platforms:
openshift: {}
profile: all # This profile activates all resources
pruner:
disabled: false
keep: 100
resources:
- pipelinerun
schedule: 0 8 * * *
targetNamespace: tekton-pipelines
trigger:
enable-api-fields: stable
options:
disabled: false
status:
annotations:
operator.tekton.dev/post-upgrade-version: v0.70.0
operator.tekton.dev/pre-upgrade-version: v0.70.0
conditions:
- lastTransitionTime: "2024-07-31T02:37:30Z"
status: "True"
type: ComponentsReady
- lastTransitionTime: "2024-07-31T02:37:41Z"
status: "True"
type: PostInstall
- lastTransitionTime: "2024-07-31T02:37:42Z"
status: "True"
type: PostUpgrade
- lastTransitionTime: "2024-07-31T02:36:24Z"
status: "True"
type: PreInstall
- lastTransitionTime: "2024-07-31T02:36:24Z"
status: "True"
type: PreUpgrade
- lastTransitionTime: "2024-07-31T02:37:42Z"
status: "True"
type: Ready
version: v0.70.0
Still for a production scenario it is not enough, some fine adjustments are necessary. It remains as technical debt.
To check what we have running.
kubectl get all -n tekton-pipelines
NAME READY STATUS RESTARTS AGE
pod/tekton-chains-controller-5f4d8dd895-6hj9l 1/1 Running 0 8h
pod/tekton-dashboard-746bfff8c8-7znvh 1/1 Running 0 8h
pod/tekton-events-controller-685c4485-bgmbp 1/1 Running 0 8h
pod/tekton-operator-proxy-webhook-74cfb9798b-rmhtn 1/1 Running 0 8h
pod/tekton-pipelines-controller-d54db996-6h7fp 1/1 Running 0 8h
pod/tekton-pipelines-remote-resolvers-76b7cbd867-97fc5 1/1 Running 0 8h
pod/tekton-pipelines-webhook-74dffc947-kb77v 1/1 Running 0 8h
pod/tekton-triggers-controller-5479774488-pvhjc 1/1 Running 0 8h
pod/tekton-triggers-core-interceptors-c4c7c98f5-wdx28 1/1 Running 0 8h
pod/tekton-triggers-webhook-55c87584c9-n7dxm 1/1 Running 0 8h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/tekton-chains-metrics ClusterIP 10.97.25.22 <none> 9090/TCP 8h
service/tekton-dashboard ClusterIP 10.100.96.146 <none> 9097/TCP 8h
service/tekton-events-controller ClusterIP 10.105.115.210 <none> 9090/TCP,8008/TCP,8080/TCP 8h
service/tekton-operator-proxy-webhook ClusterIP 10.102.16.99 <none> 443/TCP 8h
service/tekton-pipelines-controller ClusterIP 10.96.179.193 <none> 9090/TCP,8008/TCP,8080/TCP 8h
service/tekton-pipelines-remote-resolvers ClusterIP 10.104.95.223 <none> 9090/TCP,8008/TCP,8080/TCP 8h
service/tekton-pipelines-webhook ClusterIP 10.106.146.247 <none> 9090/TCP,8008/TCP,443/TCP,8080/TCP 8h
service/tekton-triggers-controller ClusterIP 10.110.79.44 <none> 9000/TCP 8h
service/tekton-triggers-core-interceptors ClusterIP 10.96.76.242 <none> 8443/TCP 8h
service/tekton-triggers-webhook ClusterIP 10.109.205.230 <none> 443/TCP 8h
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/tekton-chains-controller 1/1 1 1 8h
deployment.apps/tekton-dashboard 1/1 1 1 8h
deployment.apps/tekton-events-controller 1/1 1 1 8h
deployment.apps/tekton-operator-proxy-webhook 1/1 1 1 8h
deployment.apps/tekton-pipelines-controller 1/1 1 1 8h
deployment.apps/tekton-pipelines-remote-resolvers 1/1 1 1 8h
deployment.apps/tekton-pipelines-webhook 1/1 1 1 8h
deployment.apps/tekton-triggers-controller 1/1 1 1 8h
deployment.apps/tekton-triggers-core-interceptors 1/1 1 1 8h
deployment.apps/tekton-triggers-webhook 1/1 1 1 8h
NAME DESIRED CURRENT READY AGE
replicaset.apps/tekton-chains-controller-5f4d8dd895 1 1 1 8h
replicaset.apps/tekton-dashboard-746bfff8c8 1 1 1 8h
replicaset.apps/tekton-events-controller-685c4485 1 1 1 8h
replicaset.apps/tekton-operator-proxy-webhook-74cfb9798b 1 1 1 8h
replicaset.apps/tekton-pipelines-controller-d54db996 1 1 1 8h
replicaset.apps/tekton-pipelines-remote-resolvers-76b7cbd867 1 1 1 8h
replicaset.apps/tekton-pipelines-webhook-74dffc947 1 1 1 8h
replicaset.apps/tekton-triggers-controller-5479774488 1 1 1 8h
replicaset.apps/tekton-triggers-core-interceptors-c4c7c98f5 1 1 1 8h
replicaset.apps/tekton-triggers-webhook-55c87584c9 1 1 1 8h
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
horizontalpodautoscaler.autoscaling/tekton-operator-proxy-webhook Deployment/tekton-operator-proxy-webhook cpu: <unknown>/85% 1 5 1 8h
horizontalpodautoscaler.autoscaling/tekton-pipelines-webhook Deployment/tekton-pipelines-webhook cpu: <unknown>/100% 1 5 1 8h
NAME SCHEDULE TIMEZONE SUSPEND ACTIVE LAST SCHEDULE AGE
cronjob.batch/tekton-resource-pruner-4tcs6 0 8 * * * <none> False 0 3h6m 8h
Tekton CLI​
To install the tekton cli just download and install on the system using dpkg or some package installer from your distribution.
sudo dpkg -i yourfile.deb
If you want completion in your terminal just add it to your bashrc or zshrc
echo "source <(tkn completion bash)" >> ~/.bashrc
echo "source <(tkn completion zsh)" >> ~/.zshrc
tkn
bundle -- Manage Tekton Bundles
chain -- Manage Chains
clustertriggerbinding -- Manage ClusterTriggerBindings
completion -- Prints shell completion scripts
customrun -- Manage CustomRuns
eventlistener -- Manage EventListeners
help -- Help about any command
hub -- Interact with tekton hub
pipeline -- Manage pipelines
pipelinerun -- Manage PipelineRuns
task -- Manage Tasks
taskrun -- Manage TaskRuns
triggerbinding -- Manage TriggerBindings
triggertemplate -- Manage TriggerTemplates
version -- Prints version information