Skip to content

Commit 1c5a019

Browse files
authored
Merge pull request #57466 from ekristova/RHDEVDOCS-4305
RHDEVDOCS-4305: fix priorityClassName issue with code in modules/op-s…
2 parents 447179a + b4736c4 commit 1c5a019

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

cicd/pipelines/setting-compute-resource-quota-for-openshift-pipelines.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ include::modules/op-specifying-pipelines-resource-quota-using-priority-class.ado
3232
[id="additional-resources_setting-compute-resource-quota-for-pipelines"]
3333
== Additional resources
3434

35+
* xref:../../nodes/clusters/nodes-cluster-limit-ranges.adoc#nodes-cluster-limit-ranges[Restrict resource consumption with limit ranges]
3536
* link:https://kubernetes.io/docs/concepts/policy/resource-quotas/[Resource quotas in Kubernetes]
3637
* link:https://kubernetes.io/docs/concepts/policy/limit-range/[Limit ranges in Kubernetes]
3738
* link:https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#resources[Resource requests and limits in Kubernetes]

modules/op-specifying-pipelines-resource-quota-using-priority-class.adoc

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Because pods are not running, the quota is unused.
7373
.Example: YAML for the pipeline
7474
[source,yaml]
7575
----
76-
apiVersion: tekton.dev/v1alpha1
76+
apiVersion: tekton.dev/v1beta1
7777
kind: Pipeline
7878
metadata:
7979
name: maven-build
@@ -130,50 +130,49 @@ spec:
130130
.Example: YAML for a task in the pipeline
131131
[source,yaml]
132132
----
133-
apiVersion: tekton.dev/v1alpha1
133+
apiVersion: tekton.dev/v1beta1
134134
kind: Task
135135
metadata:
136136
name: mvn
137137
spec:
138138
workspaces:
139139
- name: maven-repo
140-
inputs:
141-
params:
142-
- name: GOALS
143-
description: The Maven goals to run
144-
type: array
145-
default: ["package"]
146-
resources:
140+
resources:
141+
inputs:
147142
- name: source
148143
type: git
144+
params:
145+
- name: GOALS
146+
description: The Maven goals to run
147+
type: array
148+
default: ["package"]
149149
steps:
150150
- name: mvn
151151
image: gcr.io/cloud-builders/mvn
152152
workingDir: /workspace/source
153153
command: ["/usr/bin/mvn"]
154154
args:
155155
- -Dmaven.repo.local=$(workspaces.maven-repo.path)
156-
- "$(inputs.params.GOALS)"
157-
priorityClassName: pipeline1-pc
156+
- "$(params.GOALS)"
158157
----
159-
+
160-
[NOTE]
161-
====
162-
Ensure that all tasks in the pipeline belongs to the same priority class.
163-
====
164158

165159
. Create and start the pipeline run.
166160
+
167161
.Example: YAML for a pipeline run
168162
[source,yaml]
169163
----
170-
apiVersion: tekton.dev/v1alpha1
164+
apiVersion: tekton.dev/v1beta1
171165
kind: PipelineRun
172166
metadata:
173167
generateName: petclinic-run-
174168
spec:
175169
pipelineRef:
176170
name: maven-build
171+
podTemplate:
172+
priorityClassName: pipeline1-pc
173+
workspaces:
174+
- name: local-maven-repo
175+
emptyDir: {}
177176
resources:
178177
- name: app-git
179178
resourceSpec:
@@ -182,6 +181,15 @@ spec:
182181
- name: url
183182
value: https://github.com/spring-projects/spring-petclinic
184183
----
184+
+
185+
[NOTE]
186+
====
187+
The pipeline run might fail with an error: `failed quota: <quota name> must specify cpu, memory`.
188+
189+
To avoid this error, set a limit range for the namespace, where the defaults from the `LimitRange` object apply to pods created during the build process.
190+
191+
For more information about setting limit ranges, refer to _Restrict resource consumption with limit ranges_ in the _Additional resources_ section.
192+
====
185193

186194
. After the pods are created, verify the resource quota usage for the pipeline run.
187195
+

0 commit comments

Comments
 (0)