From 05c68156e7309bbf17d9eb4592abe5920d205243 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 --- examples/pipelineruns/limitrange.yaml | 57 +++++++++++++++++++++++++++ examples/taskruns/limitrange.yaml | 47 ++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 examples/pipelineruns/limitrange.yaml create mode 100644 examples/taskruns/limitrange.yaml diff --git a/examples/pipelineruns/limitrange.yaml b/examples/pipelineruns/limitrange.yaml new file mode 100644 index 00000000000..e1958376c3b --- /dev/null +++ b/examples/pipelineruns/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/limitrange.yaml b/examples/taskruns/limitrange.yaml new file mode 100644 index 00000000000..4148b4ada22 --- /dev/null +++ b/examples/taskruns/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