From 1c1e624b74369a73ae4ac35e07762214c3f93495 Mon Sep 17 00:00:00 2001 From: Aneesh-M-Bhat Date: Mon, 12 Feb 2024 16:03:58 +0530 Subject: [PATCH] kn Documentation --- docs/task-kn.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/task-kn.md diff --git a/docs/task-kn.md b/docs/task-kn.md new file mode 100644 index 0000000..953a2b8 --- /dev/null +++ b/docs/task-kn.md @@ -0,0 +1,45 @@ +## `Kn` Tekton Task + +# Abstract + +The `kn` Task performs operations on Knative resources (services, revisions, routes) using kn CLI. + +# Usage + +Please, consider the usage example below: + +```yaml +--- +apiVersion: tekton.dev/v1 +kind: TaskRun +metadata: + name: example-taskrun +spec: + taskRef: + name: kn + params: + - name: ARGS + value: + - help +``` + +Here `ARGS` param accepts an array of arguments for usage with kn command. + +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`. + +## Params + +| Param | Type | Default | Description | +| :----- | :-----: | :--------- | :---------------------- | +| `ARGS` | `array` | (required) | kn CLI arguments to run | + +[tektonPipelineAuth]: https://tekton.dev/docs/pipelines/auth/#configuring-docker-authentication-for-docker