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
17 changes: 16 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,19 @@ 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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires still instructions how to get the ACCESS_KEY_ID and SECRET_KEY. E.g. the base64 encoding, and the command line to generate this comfortably. Maybe you can also mention that the instructions from https://tekton.dev/docs/pipelines/auth/#configuring-docker-authentication-for-docker will not work here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer not to re-write any instructions of using Quay or Kubernetes's, I think it would be enough for the user to google it. I can add a note about it if you really want it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please point me to any documentation about the format of the accessKeyId and secretKey ? I think even CNV downstream doc is still missing it. If the task would accept the credentials in the default dockerconfigjson format like shown in quay.io's web ui or in tekton documented, I would agree with you. But this task is expecting a format which seems to be special for kubevirt, and so we should document it.

kind: Secret
metadata:
name: disk-uploader-credentials
type: Opaque

```

Task run using resolver:
```
apiVersion: tekton.dev/v1
Expand All @@ -39,6 +52,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
5 changes: 5 additions & 0 deletions templates/disk-uploader/readmes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ When user runs [KubeVirt Tekton Tasks](https://github.com/kubevirt/kubevirt-tekt

### Usage

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

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