Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(CNV-53188): improve disk-uploader usage guidance #576

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configs/disk-uploader.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
task_name: disk-uploader
secret_task_name: disk-uploader-secret
task_category: disk-uploader
main_image: quay.io/kubevirt/tekton-tasks
nice_name: disk uploader
19 changes: 18 additions & 1 deletion release/tasks/disk-uploader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ When user runs [KubeVirt Tekton Tasks](https://github.com/kubevirt/kubevirt-tekt

### Parameters

- **EXPORT_SOURCE_KIND**: The name of the export source kind
- **EXPORT_SOURCE_KIND**: Specify the export source kind (vm, vmsnapshot, pvc)
- **EXPORT_SOURCE_NAME**: The name of the export source
- **VOLUME_NAME**: The volume name (If source kind is PVC, then volume name is equal to source name)
- **IMAGE_DESTINATION**: Destination of the image in container registry
Expand All @@ -21,6 +21,21 @@ When user runs [KubeVirt Tekton Tasks](https://github.com/kubevirt/kubevirt-tekt

### Usage

Secret of the task run:
```
apiVersion: v1
data:
accessKeyId: <ACCESS_KEY_ID>
secretKey: <SECRET_KEY>
codingben marked this conversation as resolved.
Show resolved Hide resolved
kind: Secret
metadata:
name: disk-uploader-credentials
type: Opaque

```

Get `ACCESS_KEY_ID` or `SECRET_KEY` by running: `echo -n "<REGISTRY_USERNAME_OR_PASSWORD>" | base64`.

Task run using resolver:
```
apiVersion: tekton.dev/v1
Expand All @@ -39,6 +54,8 @@ spec:
value: quay.io/kubevirt/example-vm-exported:latest
- name: PUSH_TIMEOUT
value: 120
- name: SECRET_NAME
value: disk-uploader-credentials
taskRef:
params:
- name: catalog
Expand Down
2 changes: 1 addition & 1 deletion release/tasks/disk-uploader/disk-uploader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
to be used in multiple Kubernetes clusters.
params:
- name: EXPORT_SOURCE_KIND
description: The name of the export source kind
description: Specify the export source kind (vm, vmsnapshot, pvc)
type: string
- name: EXPORT_SOURCE_NAME
description: The name of the export source
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: v1
kind: Secret
metadata:
name: disk-uploader-credentials
type: Opaque
data:
accessKeyId: "<ACCESS_KEY_ID>"
secretKey: "<SECRET_KEY>"
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ spec:
value: quay.io/kubevirt/example-vm-exported:latest
- name: PUSH_TIMEOUT
value: 120
- name: SECRET_NAME
value: disk-uploader-credentials
2 changes: 2 additions & 0 deletions templates/disk-uploader/examples/disk-uploader-taskrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ spec:
value: quay.io/kubevirt/example-vm-exported:latest
- name: PUSH_TIMEOUT
value: 120
- name: SECRET_NAME
value: disk-uploader-credentials
9 changes: 9 additions & 0 deletions templates/disk-uploader/generate-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
mode: "{{ default_file_mode }}"
with_items:
- { taskrun_with_flavor_name: "{{ task_name }}-taskrun-resolver"}
- name: Generate example secret of the task
template:
src: "{{ examples_templates_dir }}/{{ secret_task_name }}.yaml"
dest: "{{ examples_taskruns_output_dir }}/{{ item.secret_task_with_flavor_name }}.yaml"
mode: "{{ default_file_mode }}"
with_items:
- { secret_task_with_flavor_name: "{{ secret_task_name }}"}
- name: Generate README
template:
src: "{{ readmes_templates_dir }}/README.md"
Expand All @@ -46,6 +53,8 @@
task_yaml: "{{ lookup('file', task_path) | from_yaml }}"
task_run_resolver_path: "{{ examples_taskruns_output_dir }}/{{ task_name }}-taskrun-resolver.yaml"
task_run_resolver_yaml: "{{ lookup('file', task_run_resolver_path) | from_yaml }}"
secret_task_path: "{{ examples_taskruns_output_dir }}/{{ secret_task_name }}.yaml"
secret_task_yaml: "{{ lookup('file', secret_task_path) | from_yaml }}"
- name: "Delete readme tmp directory"
file:
path: "{{ readme_output_dir_tmp }}"
Expand Down
2 changes: 1 addition & 1 deletion templates/disk-uploader/manifests/disk-uploader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
to be used in multiple Kubernetes clusters.
params:
- name: EXPORT_SOURCE_KIND
description: The name of the export source kind
description: Specify the export source kind (vm, vmsnapshot, pvc)
type: string
- name: EXPORT_SOURCE_NAME
description: The name of the export source
Expand Down
7 changes: 7 additions & 0 deletions templates/disk-uploader/readmes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ When user runs [KubeVirt Tekton Tasks](https://github.com/kubevirt/kubevirt-tekt

### Usage

Secret of the task run:
```
{{ secret_task_yaml | to_nice_yaml }}
```

Get `ACCESS_KEY_ID` or `SECRET_KEY` by running: `echo -n "<REGISTRY_USERNAME_OR_PASSWORD>" | base64`.

Task run using resolver:
```
{{ task_run_resolver_yaml | to_nice_yaml }}
Expand Down
Loading