-
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.
Prior to this, we were extracting results from tasks via the termination messages which had a limit of only 4 KB per pod. If users had many results then the results would need to become smaller to obey the upper limit of 4 KB. We now run a dedicated sidecar that has access to the results of all the steps. This sidecar prints out the result and its content to stdout. The logs of the sidecar are parsed by the taskrun controller and the results updated instead of termination logs. We set an upper limit on the results to 1KB but users can have as many such results as needed.
- Loading branch information
1 parent
6bc53ca
commit 06bbc1d
Showing
20 changed files
with
643 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: tekton-pipelines-controller-pod-log-access | ||
labels: | ||
app.kubernetes.io/component: controller | ||
app.kubernetes.io/instance: default | ||
app.kubernetes.io/part-of: tekton-pipelines | ||
rules: | ||
- apiGroups: [""] | ||
# Controller needs to get the logs of the results sidecar created by TaskRuns to extract results. | ||
resources: ["pods/log"] | ||
verbs: ["get"] |
16 changes: 16 additions & 0 deletions
16
config/enable-log-access-to-controller/clusterrolebinding.yaml
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,16 @@ | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: tekton-pipelines-controller-pod-log-access | ||
labels: | ||
app.kubernetes.io/component: controller | ||
app.kubernetes.io/instance: default | ||
app.kubernetes.io/part-of: tekton-pipelines | ||
subjects: | ||
- kind: ServiceAccount | ||
name: tekton-pipelines-controller | ||
namespace: tekton-pipelines | ||
roleRef: | ||
kind: ClusterRole | ||
name: tekton-pipelines-controller-pod-log-access | ||
apiGroup: rbac.authorization.k8s.io |
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
81 changes: 81 additions & 0 deletions
81
examples/v1beta1/pipelineruns/alpha/pipelinerun-large-results.yaml
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,81 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: large-result | ||
spec: | ||
results: | ||
- name: result1 | ||
- name: result2 | ||
- name: result3 | ||
- name: result4 | ||
- name: result5 | ||
steps: | ||
- name: step1 | ||
image: alpine | ||
script: | | ||
cat /dev/urandom | head -c 750 | base64 | tee $(results.result1.path); | ||
cat /dev/urandom | head -c 750 | base64 | tee $(results.result2.path); | ||
cat /dev/urandom | head -c 750 | base64 | tee $(results.result3.path); | ||
cat /dev/urandom | head -c 750 | base64 | tee $(results.result4.path); | ||
cat /dev/urandom | head -c 750 | base64 | tee $(results.result5.path); | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: concat-text | ||
spec: | ||
params: | ||
- name: param1 | ||
- name: param2 | ||
- name: param3 | ||
results: | ||
- name: concatenated-text | ||
description: concatenate strings | ||
steps: | ||
- name: concat | ||
image: alpine | ||
command: ["/bin/sh", "-c"] | ||
args: | ||
- echo $(params.param1) +++ $(params.param2) +++ $(params.param3)| tee $(results.concatenated-text.path) ; | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: concat-text-pipeline | ||
spec: | ||
tasks: | ||
- name: first-task | ||
taskRef: | ||
name: large-result | ||
- name: second-task | ||
taskRef: | ||
name: large-result | ||
- name: third-task | ||
taskRef: | ||
name: large-result | ||
- name: last-task | ||
runAfter: | ||
- first-task | ||
- second-task | ||
- third-task | ||
params: | ||
- name: param1 | ||
value: $(tasks.first-task.results.result1) | ||
- name: param2 | ||
value: $(tasks.second-task.results.result3) | ||
- name: param3 | ||
value: $(tasks.third-task.results.result5) | ||
taskRef: | ||
name: concat-text | ||
results: | ||
- name: sum | ||
description: the concat of all texts | ||
value: $(tasks.last-task.results.concatenated-text) | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
name: concat-text-pipeline-run | ||
spec: | ||
pipelineRef: | ||
name: concat-text-pipeline |
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,28 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: larger-results- | ||
spec: | ||
taskSpec: | ||
description: | | ||
A task that creates results > termination message limit of 4K per pod! | ||
results: | ||
- name: result1 | ||
- name: result2 | ||
- name: result3 | ||
- name: result4 | ||
- name: result5 | ||
steps: | ||
- name: step1 | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
cat /dev/urandom | head -c 750 | base64 | tee /tekton/results/result1 #about 1 K result | ||
cat /dev/urandom | head -c 750 | base64 | tee /tekton/results/result2 #about 1 K result | ||
- name: step2 | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
cat /dev/urandom | head -c 750 | base64 | tee /tekton/results/result3 #about 1 K result | ||
cat /dev/urandom | head -c 750 | base64 | tee /tekton/results/result4 #about 1 K result | ||
cat /dev/urandom | head -c 750 | base64 | tee /tekton/results/result5 #about 1 K result |
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
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.