-
Notifications
You must be signed in to change notification settings - Fork 158
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
feat: Introduce new MultiContainerRun function to run pods with two containers #3095
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6fd6fdc
feat: Introduce new KubeTaskParallel function to run pods with two co…
hairyhum 14c4e1a
Code cleanup
hairyhum 64113fa
Added init container support.
hairyhum 7fd8be4
Fix docs warnings
hairyhum 40a73b8
Wording
hairyhum 61d1267
Linter fixes
hairyhum 5938e47
Rename KubeTaskParallel to MultiContainerRun
hairyhum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -150,6 +150,82 @@ Example: | |
- | | ||
echo "Example" | ||
|
||
MultiContainerRun | ||
----------------- | ||
|
||
MultiContainerRun 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. | ||
"background" container is one responsible for generating data, while "output" container | ||
should export it to destination. | ||
The main difference between these containers is that phase outputs can only be generated | ||
from the "output" container. | ||
The function also supports an optional init container to set up the volume contents. | ||
|
||
.. 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) | ||
`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 | ||
Comment on lines
+173
to
+174
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be called upload container? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same note as a note before, trying to name things for what they do rather than what they can be used for. |
||
`initImage`, No, `string`, image to be used in init container of the pod | ||
`initCommand`, No, `[]string`, command list to execute in init container of the pod | ||
`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 `emptyDir`_. | ||
`sharedVolumeSizeLimit`, No, `string`, sizeLimit setting for shared volume. See `emptyDir`_. | ||
`sharedVolumeDir`, No, `string`, directory to mount shared volume. Defaults to `/tmp` | ||
|
||
.. _emptyDir: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir | ||
|
||
Example: | ||
|
||
.. code-block:: yaml | ||
:linenos: | ||
|
||
- func: MultiContainerRun | ||
name: examplePhase | ||
args: | ||
namespace: "{{ .Deployment.Namespace }}" | ||
podOverride: | ||
containers: | ||
- name: export | ||
imagePullPolicy: IfNotPresent | ||
podAnnotations: | ||
annKey: annValue | ||
podLabels: | ||
labelKey: labelValue | ||
sharedVolumeMedium: Memory | ||
sharedVolumeSizeLimit: 1Gi | ||
sharedVolumeDir: /tmp/ | ||
initImage: ubuntu | ||
initCommand: | ||
- bash | ||
- -c | ||
- | | ||
mkfifo /tmp/pipe-file | ||
backgroundImage: ubuntu | ||
backgroundCommand: | ||
- bash | ||
- -c | ||
- | | ||
for i in {1..10} | ||
do | ||
echo $i | ||
sleep 0.1 | ||
done > /tmp/pipe-file | ||
outputImage: ubuntu | ||
outputCommand: | ||
- bash | ||
- -c | ||
- | | ||
cat /tmp/pipe-file | ||
|
||
ScaleWorkload | ||
------------- | ||
|
||
|
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 |
---|---|---|
|
@@ -63,3 +63,6 @@ webhook | |
Kopia | ||
kopia | ||
hostname | ||
emptyDir | ||
sizeLimit | ||
init |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we call this container snapshot or backup container? or maybe data container? just a suggestion, if you think
background
is ok, I am good.