-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split /tekton/run directories into separate volumes.
This changes splits each `/tekton/run` volume into separate volumes so that steps can only mutate their own runtime information. This prevents steps from unexpectedly interfering with other step execution. To do this, we repurpose the `/tekton/run/#` path into a step-specific directory. Since this was previously used by the entrypoint for the post/wait files, we now use `/tekton/run/#/out` as the post/wait filepath instead. This does not change behavior of the directory, it enforces expected behavior of steps. `/tekton/run` is considered an internal implementation detail and is not covered by the API compatibility policy, so it is safe to make changes to the behavior of these files/paths. This does not stop user execution from writing the step's own `/tekton/run/#` folder. This needs more discussion/design - additional changes (if needed) will be made in another commit. This change is only focused on `/tekton/run` to reduce PR complexity. We will likely want to make a similar change to /tekton/steps in another commit. We may also look to consolidate all per-step volumes into a single source (i.e. creds-init does something similar as well). AFAICT, Ephemeral Volumes (i.e. EmptyDir) are exempt from Node Volume limits (https://kubernetes.io/docs/concepts/storage/storage-limits/) - spot checked this with a TaskRun with 100+ steps on both kind and GKE.
- Loading branch information
1 parent
51b5ed2
commit 00f7cc6
Showing
8 changed files
with
199 additions
and
150 deletions.
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
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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file is primarily used for test validation of internal Tekton | ||
# directories. This is not a useful example of typical user config. | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: readonly-internal-dir- | ||
spec: | ||
taskSpec: | ||
steps: | ||
- image: ubuntu | ||
script: exit 0 | ||
- image: ubuntu | ||
script: | | ||
set +e # dont fail the script on error | ||
# Steps should not be able to write to other step's run directories. | ||
echo "hello world" > /tekton/run/0/out | ||
if [ $? -eq 0 ] ; then | ||
echo "able to write to run directory of non-current step" | ||
exit 1 | ||
fi |
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
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
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.