Skip to content

Commit

Permalink
Added docs for the Tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Senjuti256 committed Jan 4, 2024
1 parent 9ae5711 commit edb2499
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 2 deletions.
57 changes: 57 additions & 0 deletions docs/task-openshift-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
`OpenShift-Cient` Tekton Task
-----------------------

# Abstract

The `openshift-client` Task is the binary for OpenShift CLI that complements kubectl for simplifying deployment and configuration applications on OpenShift.

# Usage

Please, consider the usage example below:

```yaml
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata: {}
spec:
pipelineRef:
name: task-openshift-client
params:
- name: SCRIPT
value: openShift-CLI-arguments
- name: VERSION
value: oc-version

```
You'll need to replace `openShift-CLI-arguments` with OpenShift CLI arguments that you want to run and replace `oc-version` with the version of OpenShift you want to use.
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 |
| :------------ | :------------------------: | :--------------------------- |
| `manifest_dir` | `true` | The workspace which contains kubernetes manifests which we want to apply on the cluster. |
| `kubeconfig_dir` | `true` | The workspace which contains the the kubeconfig file if in case we want to run the oc command on another cluster. |


## Params

| Param | Type | Default | Description |
| :------------ | :------------------------: | :--------------------------- | :------------------------- |
| `SCRIPT` | `string` | (required) | The OpenShift CLI arguments to run |
| `VERSION` | `string` | (required) | The OpenShift version to use |



[tektonPipelineAuth]: https://tekton.dev/docs/pipelines/auth/#configuring-docker-authentication-for-docker

56 changes: 56 additions & 0 deletions docs/task-tkn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
`Tkn` Tekton Task
-----------------------

# Abstract

The `tkn` Task is a binary to perform operations on Tekton resources using tkn.

# Usage

Please, consider the usage example below:

```yaml
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata: {}
spec:
pipelineRef:
name: task-tkn
params:
- name: SCRIPT
value: "tkn $@"
- name: ARGS
value: tkn-command-you-want-to-execute

```
You'll need to replace `tkn-command-you-want-to-execute` with tkn CLI arguments based on what operation you want to perform on the Tekton resources.
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 tkn to access the cluster. |


## Params

| Param | Type | Default | Description |
| :------------ | :------------------------: | :--------------------------- | :------------------------- |
| `SCRIPT` | `string` | (required) | tkn CLI script to execute |
| `ARGS` | `array` | (required) | tkn CLI arguments to run |



[tektonPipelineAuth]: https://tekton.dev/docs/pipelines/auth/#configuring-docker-authentication-for-docker

2 changes: 1 addition & 1 deletion test/e2e/resources/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/resources/tkn-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
labels:
Expand Down

0 comments on commit edb2499

Please sign in to comment.