Skip to content

Commit

Permalink
docs(CNV-53188): improve disk-uploader usage guidance
Browse files Browse the repository at this point in the history
Add more details to explain an usage of
EXPORT_SOURCE_KIND. Also, Add an example of the
Secret object, that will be referenced by
SECRET_NAME.

Signed-off-by: Ben Oukhanov <[email protected]>
  • Loading branch information
codingben committed Jan 6, 2025
1 parent 8dea0da commit ebc66cc
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 3 deletions.
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>
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

0 comments on commit ebc66cc

Please sign in to comment.