Skip to content

Commit

Permalink
Rename Dump to KubeTaskParallel
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhum committed Sep 11, 2024
1 parent 8314e4a commit 8dbc0e2
Show file tree
Hide file tree
Showing 9 changed files with 391 additions and 413 deletions.
41 changes: 21 additions & 20 deletions docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,39 +150,40 @@ Example:
- |
echo "Example"
Dump
--------
KubeTaskParallel
----------------

Dump spins up a new pod with two containers connected via shared emptyDir volume.
KubeTaskParallel spins up a new pod with two containers connected
via shared emptyDir volume.
It's similar to KubeTask, but allows using multiple images to move backup data.
"dump" container is one responsible for generating data, while "export" container
"background" container is one responsible for generating data, while "output" container
should export it to destination.
The main difference between them is that phase outputs can only generated from the
"export" container outputs.
"output" container outputs.

.. csv-table::
:header: "Argument", "Required", "Type", "Description"
:align: left
:widths: 5,5,5,15

`namespace`, No, `string`, namespace in which to execute (the pod will be created in controller's namespace if not specified)
`dumpImage`, Yes, `string`, image to be used in "dump" container
`dumpCommand`, Yes, `[]string`, command list to execute in "dump" container
`exportImage`, Yes, `string`, image to be used in "export" container
`exportCommand`, Yes, `[]string`, command list to execute in "export" container
`backgroundImage`, Yes, `string`, image to be used in "background" container
`backgroundCommand`, Yes, `[]string`, command list to execute in "background" container
`outputImage`, Yes, `string`, image to be used in "output" container
`outputCommand`, Yes, `[]string`, command list to execute in "output" container
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created
`sharedStorageMedium`, No, `string`, medium setting for shared volume. See https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
`sharedStorageSize`, No, `string`, sizeLimit setting for shared volume
`sharedStorageDir`, No, `string`, directory to mount shared volume. Defaults to `/tmp`
`sharedVolumeMedium`, No, `string`, medium setting for shared volume. See https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
`sharedVolumeSizeLimit`, No, `string`, sizeLimit setting for shared volume
`sharedVolumeDir`, No, `string`, directory to mount shared volume. Defaults to `/tmp`

Example:

.. code-block:: yaml
:linenos:
- func: Dump
- func: KubeTaskParallel
name: examplePhase
args:
namespace: "{{ .Deployment.Namespace }}"
Expand All @@ -194,11 +195,11 @@ Example:
annKey: annValue
podLabels:
labelKey: labelValue
sharedStorageMedium: Memory
sharedStorageSize: 1Gi
sharedStorageDir: /tmp/
dumpImage: ubuntu
dumpCommand:
sharedVolumeMedium: Memory
sharedVolumeSizeLimit: 1Gi
sharedVolumeDir: /tmp/
backgroundImage: ubuntu
backgroundCommand:
- bash
- -c
- |
Expand All @@ -208,8 +209,8 @@ Example:
echo $i
sleep 0.1
done > /tmp/pipe-file
exportImage: ubuntu
exportCommand:
outputImage: ubuntu
outputCommand:
- bash
- -c
- |
Expand Down
45 changes: 22 additions & 23 deletions docs_new/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,35 +129,35 @@ Example:
echo "Example"
```
### Dump
### KubeTaskParallel
Dump spins up a new pod with teo containers connected via shared emptyDir volume.
KubeTaskParallel spins up a new pod with two containers connected via shared emptyDir volume.
It's similar to KubeTask, but allows using multiple images to move backup data.
"dump" container is one responsible for generating data, while "export" container
"background" container is one responsible for generating data, while "output" container
should export it to destination.
The main difference between them is that phase outputs can only generated from the
"export" container outputs.
"output" container outputs.
| Argument | Required | Type | Description |
| ----------- | :------: | ----------------------- | ----------- |
| namespace | No | string | namespace in which to execute (the pod will be created in controller's namespace if not specified) |
| dumpImage | Yes | string | image to be used in "dump" container |
| dumpCommand | Yes | []string | command list to execute in "dump" container |
| exportImage | Yes | string | image to be used in "export" container |
| exportCommand | Yes | []string | command list to execute in "export" container |
| podOverride | No | map[string]interface{} | specs to override default pod specs with |
| podAnnotations | No | map[string]string | custom annotations for the temporary pod that gets created |
| podLabels | No | map[string]string | custom labels for the temporary pod that gets created |
| sharedStorageMedium | No | string | medium setting for shared volume, see https://kubernetes.io/docs/concepts/storage/volumes/#emptydir |
| sharedStorageSize | No | string | sizeLimit setting for shared volume |
| sharedStorageDir | No | string | directory to mount shared volume, defaults to `/tmp` |
| backgroundImage | Yes | string | image to be used in "background" container |
| backgroundCommand | Yes | []string | command list to execute in "background" container |
| outputImage | Yes | string | image to be used in "output" container |
| outputCommand | Yes | []string | command list to execute in "output" container |
| podOverride | No | map[string]interface{} | specs to override default pod specs with |
| podAnnotations | No | map[string]string | custom annotations for the temporary pod that gets created |
| podLabels | No | map[string]string | custom labels for the temporary pod that gets created |
| sharedVolumeMedium | No | string | medium setting for shared volume, see https://kubernetes.io/docs/concepts/storage/volumes/#emptydir |
| sharedVolumeSizeLimit | No | string | sizeLimit setting for shared volume |
| sharedVolumeDir | No | string | directory to mount shared volume, defaults to `/tmp` |


Example:

``` yaml
- func: KubeTask
- func: KubeTaskParallel
name: examplePhase
args:
namespace: "{{ .Deployment.Namespace }}"
Expand All @@ -169,11 +169,11 @@ Example:
annKey: annValue
podLabels:
labelKey: labelValue
sharedStorageMedium: Memory
sharedStorageSize: 1Gi
sharedStorageDir: /tmp/
dumpImage: ubuntu
dumpCommand:
sharedVolumeMedium: Memory
sharedVolumeSizeLimit: 1Gi
sharedVolumeDir: /tmp/
backgroundImage: ubuntu
backgroundCommand:
- bash
- -c
- |
Expand All @@ -183,16 +183,15 @@ Example:
echo $i
sleep 0.1
done > /tmp/pipe-file
exportImage: ubuntu
exportCommand:
outputImage: ubuntu
outputCommand:
- bash
- -c
- |
while [ ! -e /tmp/pipe-file ]; do sleep 1; done
cat /tmp/pipe-file
```


### ScaleWorkload

ScaleWorkload is used to scale up or scale down a Kubernetes workload.
Expand Down
Loading

0 comments on commit 8dbc0e2

Please sign in to comment.