Skip to content

Commit

Permalink
add limitrange examples for pipelinerun and taskrun
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhelfand committed Feb 5, 2020
1 parent 98ab5f2 commit 4096319
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/pipelineruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/taskruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
57 changes: 57 additions & 0 deletions examples/pipelineruns/no-ci/limitrange.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
47 changes: 47 additions & 0 deletions examples/taskruns/no-ci/limitrange.yaml
Original file line number Diff line number Diff line change
@@ -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: ""

0 comments on commit 4096319

Please sign in to comment.