-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ae5711
commit edb2499
Showing
4 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|