From dfcac109d8136e288545689f0eb6574af59015ea Mon Sep 17 00:00:00 2001 From: Senjuti De Date: Wed, 20 Mar 2024 17:32:03 +0530 Subject: [PATCH] Added documentation for opc task. --- README.md | 3 +++ docs/task-opc.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 docs/task-opc.md diff --git a/README.md b/README.md index 6288a33..d1c55b6 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,6 @@ This repository provides various task related to OpenShift and OpenShift Pipelines. - [openshift-client](docs/task-openshift-client.md) - [tkn](docs/task-tkn.md) +- [opc](docs/task-opc.md) +- [kn](docs/task-kn.md) +- [kn-apply](docs/task-kn-apply.md) diff --git a/docs/task-opc.md b/docs/task-opc.md new file mode 100644 index 0000000..f2ad410 --- /dev/null +++ b/docs/task-opc.md @@ -0,0 +1,56 @@ +`opc` Tekton Task +----------------------- + +# Abstract + +The `opc` Task makes it easy to work with Tekton resources in OpenShift Pipelines. + +# Usage + +Please, consider the usage example below: + +```yaml +--- +apiVersion: tekton.dev/v1 +kind: PipelineRun +metadata: {} +spec: + pipelineRef: + name: task-opc + params: + - name: SCRIPT + value: "opc $@" + - name: ARGS + value: opc-command-you-want-to-execute + +``` +You'll need to replace `opc-command-you-want-to-execute` with opc CLI arguments based on what operation you want to perform with the Tekton resources in OpenShift Pipelines. +In case the Container Registry requires authentication, please consider the [Tekton Pipelines documentation][tektonPipelineAuth]. In a nutshell, you need to create a Kubernetes Secret describing the following attributes: + +```bash +kubectl create secret docker-registry imagestreams \ + --docker-server="image-registry.openshift-image-registry.svc:5000" \ + --docker-username="${REGISTRY_USERNAME}" \ + --docker-password="${REGISTRY_TOKEN}" +``` + +Then make sure the Secret is linked with the Service-Account running the `TaskRun`/`PipelineRun`. + +## Workspace + +| Name | Optional | Description | +| :------------ | :------------------------: | :--------------------------- | +| `kubeconfig_dir` | `true` | An optional workspace that allows you to provide a .kube/config file for opc to access the cluster. | + + +## Params + +| Param | Type | Default | Description | +| :------------ | :------------------------: | :--------------------------- | :------------------------- | +| `SCRIPT` | `string` | (required) | opc CLI script to execute | +| `ARGS` | `array` | (required) | opc CLI arguments to run | + + + +[tektonPipelineAuth]: https://tekton.dev/docs/pipelines/auth/#configuring-docker-authentication-for-docker +