From a3ef0858f069c42ac0d8a23984457c884a1cb2b8 Mon Sep 17 00:00:00 2001 From: Daniel Helfand Date: Wed, 5 Feb 2020 11:46:39 -0500 Subject: [PATCH] add limitrange examples for pipelinerun and taskrun --- docs/pipelineruns.md | 2 + docs/taskruns.md | 2 + examples/pipelineruns/no-ci/limitrange.yaml | 57 +++++++++++++++++++++ examples/taskruns/no-ci/limitrange.yaml | 47 +++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 examples/pipelineruns/no-ci/limitrange.yaml create mode 100644 examples/taskruns/no-ci/limitrange.yaml diff --git a/docs/pipelineruns.md b/docs/pipelineruns.md index 494bfe54fb0..66dd1fa27ce 100644 --- a/docs/pipelineruns.md +++ b/docs/pipelineruns.md @@ -408,6 +408,8 @@ spec: status: {} ``` +An example `PipelineRun` using `limitRangeName` is available [here](../examples/pipelineruns/no-ci/limitrange.yaml). + --- Except as otherwise noted, the content of this page is licensed under the diff --git a/docs/taskruns.md b/docs/taskruns.md index 05d9eb2b8ff..9fb49e8f46c 100644 --- a/docs/taskruns.md +++ b/docs/taskruns.md @@ -738,6 +738,8 @@ spec: limitRangeName: "limit-mem-cpu-per-container" ``` +An example `TaskRun` using `limitRangeName` is available [here](../examples/taskruns/no-ci/limitrange.yaml). + --- Except as otherwise noted, the content of this page is licensed under the diff --git a/examples/pipelineruns/no-ci/limitrange.yaml b/examples/pipelineruns/no-ci/limitrange.yaml new file mode 100644 index 00000000000..e1958376c3b --- /dev/null +++ b/examples/pipelineruns/no-ci/limitrange.yaml @@ -0,0 +1,57 @@ +apiVersion: v1 +kind: LimitRange +metadata: + name: limit-mem-cpu-per-container +spec: + limits: + - max: + cpu: "800m" + memory: "1Gi" + min: + cpu: "100m" + memory: "99Mi" + default: + cpu: "700m" + memory: "900Mi" + defaultRequest: + cpu: "110m" + memory: "111Mi" + type: Container +--- +apiVersion: tekton.dev/v1alpha1 +kind: Task +metadata: + name: echo-hello-world +spec: + steps: + - name: echo + image: ubuntu + command: + - echo + args: + - "hello world" +--- +apiVersion: tekton.dev/v1alpha1 +kind: Pipeline +metadata: + name: pipeline-hello +spec: + tasks: + - name: hello-world-1 + taskRef: + name: echo-hello-world + - name: hello-world-2 + taskRef: + name: echo-hello-world + runAfter: + - hello-world-1 +--- +apiVersion: tekton.dev/v1alpha1 +kind: PipelineRun +metadata: + generateName: pipeline-hello-run- +spec: + pipelineRef: + name: pipeline-hello + limitRangeName: "limit-mem-cpu-per-container" +status: {} \ No newline at end of file diff --git a/examples/taskruns/no-ci/limitrange.yaml b/examples/taskruns/no-ci/limitrange.yaml new file mode 100644 index 00000000000..4148b4ada22 --- /dev/null +++ b/examples/taskruns/no-ci/limitrange.yaml @@ -0,0 +1,47 @@ +apiVersion: v1 +kind: LimitRange +metadata: + name: limit-mem-cpu-per-container +spec: + limits: + - max: + cpu: "800m" + memory: "1Gi" + min: + cpu: "100m" + memory: "99Mi" + default: + cpu: "700m" + memory: "900Mi" + defaultRequest: + cpu: "110m" + memory: "111Mi" + type: Container +--- +apiVersion: tekton.dev/v1alpha1 +kind: Task +metadata: + name: echo-hello-world +spec: + steps: + - name: echo + image: ubuntu + command: + - echo + args: + - "hello world" +--- +apiVersion: tekton.dev/v1alpha1 +kind: TaskRun +metadata: + generateName: echo-hello-world-run- +spec: + inputs: {} + outputs: {} + serviceAccountName: "" + taskRef: + name: echo-hello-world + timeout: 1h0m0s + limitRangeName: "limit-mem-cpu-per-container" +status: + podName: "" \ No newline at end of file