-
Install Red Hat OpenShift Pipelines on
latest
channel from the Operator Hub using the Openshift UI -
If you want interact via cli with the pipeline you can install locally Tekton cli
To interact with the pipelines, you can download from the details of the operator installed (i.e. crc link) :
https://tkn-cli-serve-openshift-pipelines.apps-crc.testing/tkn/tkn-linux-amd64.tar.gz
The version proposed by the Operator is correctly aligned version with the tekton version. -
If isn't yet created, create the project
kogito-serverless-operator-system
oc new-project kogito-serverless-operator-system
- Install the Tekton
kubernetes-actions
task
kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/kubernetes-actions/0.2/raw
- Apply the cluster role and cluster role binding
kubectl create -f tekton/role/cluster_role.yaml
kubectl create -f tekton/role/cluster_role_binding.yaml
- Create the pipeline
kubectl apply -f tekton/pipeline/kogito_serverless_operator_pipeline.yaml
- Create a pipeline run
kubectl apply -f tekton/pipeline/kogito_serverless_operator_pipeline_run.yaml
or with the Tekton cli:
tkn pipeline start kogito-serverless-operator-pipeline \
-w name=shared-workspace,volumeClaimTemplateFile=https://raw.githubusercontent.com/kiegroup/kogito-serverless-operator/main/tekton/volume/persistent_volume.yaml \
-p deployment-name=kogito-serverless-operator \
-p git-url=https://github.com/kiegroup/kogito-serverless-operator.git \
-p git-revision=main \
-p IMAGE='image-registry.openshift-image-registry.svc:5000/kogito-serverless-operator-system/kogito-serverless-operator:latest' \
--use-param-defaults
- Check the Pipeline execution
Open the Pipeline menu under the namespace/project kogito-serverless-operator-system
or with the Tekton cli (use the pipeline run id):
tkn pipelinerun logs kogito-serverless-operator-pipeline-run-<id> -f -n <your-namespace>
- Create the task
show_workspace_content
kubectl apply -f tekton/task/show_workspace_content.yaml
- Add the task
show-workspace
in the pipeline after thefetch-repository
orbuild-image
Go to the pipeline runs and ask for a rerun of a previous pipeline run
- Create the trigger binding
oc create -f tekton/trigger/trigger_binding.yaml
- Create the trigger template
oc create -f tekton/trigger/trigger_template.yaml
- Create the trigger resource
oc create -f tekton/trigger/trigger_resource.yaml
- Add a label to enable the secure HTTPS connection to the Eventlistener resource
oc label namespace kogito-serverless-operator-system operator.tekton.dev/enable-annotation=enabled
- Create the Event listener trigger
oc create -f tekton/trigger/trigger_event_listener.yaml
- Create a route with the re-encrypted TLS termination
oc create route reencrypt --service=el-kogito-serverless-operator-webhook --cert=tls.crt --key=tls.key --ca-cert=ca.crt --hostname=<hostname>
- Check the webhook
tkn el -n kogito-serverless-operator-pipeline ls
kubectl get pods,svc -n kogito-serverless-operator-pipeline -l eventlistener=kogito-serverless-operator-webhook
-
Add a webhook in your github/gitlab repo with the url of the listener on openshift
-
Authenticating pipelines using git secret https://docs.openshift.com/container-platform/4.12/cicd/pipelines/authenticating-pipelines-using-git-secret.html