Skip to content

Commit be35b07

Browse files
Merge pull request openstack-k8s-operators#253 from lpiwowar/feature/resource-limit
Add ResourceLimits for test pods
2 parents 0da95da + bc47b78 commit be35b07

25 files changed

+1006
-4
lines changed

api/bases/test.openstack.org_ansibletests.yaml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,70 @@ spec:
153153
needed for certain test-operator functionalities to work properly (e.g.:
154154
extraRPMs in Tempest CR, or certain set of tobiko tests).
155155
type: boolean
156+
resources:
157+
default:
158+
limits:
159+
cpu: 4000m
160+
memory: 4Gi
161+
requests:
162+
cpu: 2000m
163+
memory: 2Gi
164+
description: |-
165+
The desired amount of resources that should be assigned to each test pod
166+
spawned using the AnsibleTest CR. https://pkg.go.dev/k8s.io/api/core/v1#ResourceRequirements
167+
properties:
168+
claims:
169+
description: |-
170+
Claims lists the names of resources, defined in spec.resourceClaims,
171+
that are used by this container.
172+
173+
174+
This is an alpha field and requires enabling the
175+
DynamicResourceAllocation feature gate.
176+
177+
178+
This field is immutable. It can only be set for containers.
179+
items:
180+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
181+
properties:
182+
name:
183+
description: |-
184+
Name must match the name of one entry in pod.spec.resourceClaims of
185+
the Pod where this field is used. It makes that resource available
186+
inside a container.
187+
type: string
188+
required:
189+
- name
190+
type: object
191+
type: array
192+
x-kubernetes-list-map-keys:
193+
- name
194+
x-kubernetes-list-type: map
195+
limits:
196+
additionalProperties:
197+
anyOf:
198+
- type: integer
199+
- type: string
200+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
201+
x-kubernetes-int-or-string: true
202+
description: |-
203+
Limits describes the maximum amount of compute resources allowed.
204+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
205+
type: object
206+
requests:
207+
additionalProperties:
208+
anyOf:
209+
- type: integer
210+
- type: string
211+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
212+
x-kubernetes-int-or-string: true
213+
description: |-
214+
Requests describes the minimum amount of compute resources required.
215+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
216+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
217+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
218+
type: object
219+
type: object
156220
storageClass:
157221
default: local-storage
158222
description: StorageClass used to create any test-operator related
@@ -299,6 +363,70 @@ spec:
299363
functionalities to work properly (e.g.: extraRPMs in Tempest CR, or certain set
300364
of tobiko tests).
301365
type: boolean
366+
resources:
367+
default:
368+
limits:
369+
cpu: 2000m
370+
memory: 2Gi
371+
requests:
372+
cpu: 1000m
373+
memory: 2Gi
374+
description: |-
375+
The desired amount of resources that should be assigned to each test pod
376+
spawned using the AnsibleTest CR. https://pkg.go.dev/k8s.io/api/core/v1#ResourceRequirements
377+
properties:
378+
claims:
379+
description: |-
380+
Claims lists the names of resources, defined in spec.resourceClaims,
381+
that are used by this container.
382+
383+
384+
This is an alpha field and requires enabling the
385+
DynamicResourceAllocation feature gate.
386+
387+
388+
This field is immutable. It can only be set for containers.
389+
items:
390+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
391+
properties:
392+
name:
393+
description: |-
394+
Name must match the name of one entry in pod.spec.resourceClaims of
395+
the Pod where this field is used. It makes that resource available
396+
inside a container.
397+
type: string
398+
required:
399+
- name
400+
type: object
401+
type: array
402+
x-kubernetes-list-map-keys:
403+
- name
404+
x-kubernetes-list-type: map
405+
limits:
406+
additionalProperties:
407+
anyOf:
408+
- type: integer
409+
- type: string
410+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
411+
x-kubernetes-int-or-string: true
412+
description: |-
413+
Limits describes the maximum amount of compute resources allowed.
414+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
415+
type: object
416+
requests:
417+
additionalProperties:
418+
anyOf:
419+
- type: integer
420+
- type: string
421+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
422+
x-kubernetes-int-or-string: true
423+
description: |-
424+
Requests describes the minimum amount of compute resources required.
425+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
426+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
427+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
428+
type: object
429+
type: object
302430
stepName:
303431
description: |-
304432
Name of a workflow step. The step name will be used for example to create

api/bases/test.openstack.org_horizontests.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,70 @@ spec:
175175
default: https://review.opendev.org/openstack/horizon
176176
description: RepoUrl is the URL of the Horizon repository.
177177
type: string
178+
resources:
179+
default:
180+
limits:
181+
cpu: 2000m
182+
memory: 4Gi
183+
requests:
184+
cpu: 1000m
185+
memory: 2Gi
186+
description: |-
187+
The desired amount of resources that should be assigned to each test pod
188+
spawned using the HorizonTest CR. https://pkg.go.dev/k8s.io/api/core/v1#ResourceRequirements
189+
properties:
190+
claims:
191+
description: |-
192+
Claims lists the names of resources, defined in spec.resourceClaims,
193+
that are used by this container.
194+
195+
196+
This is an alpha field and requires enabling the
197+
DynamicResourceAllocation feature gate.
198+
199+
200+
This field is immutable. It can only be set for containers.
201+
items:
202+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
203+
properties:
204+
name:
205+
description: |-
206+
Name must match the name of one entry in pod.spec.resourceClaims of
207+
the Pod where this field is used. It makes that resource available
208+
inside a container.
209+
type: string
210+
required:
211+
- name
212+
type: object
213+
type: array
214+
x-kubernetes-list-map-keys:
215+
- name
216+
x-kubernetes-list-type: map
217+
limits:
218+
additionalProperties:
219+
anyOf:
220+
- type: integer
221+
- type: string
222+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
223+
x-kubernetes-int-or-string: true
224+
description: |-
225+
Limits describes the maximum amount of compute resources allowed.
226+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
227+
type: object
228+
requests:
229+
additionalProperties:
230+
anyOf:
231+
- type: integer
232+
- type: string
233+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
234+
x-kubernetes-int-or-string: true
235+
description: |-
236+
Requests describes the minimum amount of compute resources required.
237+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
238+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
239+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
240+
type: object
241+
type: object
178242
storageClass:
179243
default: local-storage
180244
description: StorageClass used to create any test-operator related

api/bases/test.openstack.org_tempests.yaml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,70 @@ spec:
160160
needed for certain test-operator functionalities to work properly (e.g.:
161161
extraRPMs in Tempest CR, or certain set of tobiko tests).
162162
type: boolean
163+
resources:
164+
default:
165+
limits:
166+
cpu: 8000m
167+
memory: 4Gi
168+
requests:
169+
cpu: 4000m
170+
memory: 2Gi
171+
description: |-
172+
The desired amount of resources that should be assigned to each test pod
173+
spawned using the Tempest CR. https://pkg.go.dev/k8s.io/api/core/v1#ResourceRequirements
174+
properties:
175+
claims:
176+
description: |-
177+
Claims lists the names of resources, defined in spec.resourceClaims,
178+
that are used by this container.
179+
180+
181+
This is an alpha field and requires enabling the
182+
DynamicResourceAllocation feature gate.
183+
184+
185+
This field is immutable. It can only be set for containers.
186+
items:
187+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
188+
properties:
189+
name:
190+
description: |-
191+
Name must match the name of one entry in pod.spec.resourceClaims of
192+
the Pod where this field is used. It makes that resource available
193+
inside a container.
194+
type: string
195+
required:
196+
- name
197+
type: object
198+
type: array
199+
x-kubernetes-list-map-keys:
200+
- name
201+
x-kubernetes-list-type: map
202+
limits:
203+
additionalProperties:
204+
anyOf:
205+
- type: integer
206+
- type: string
207+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
208+
x-kubernetes-int-or-string: true
209+
description: |-
210+
Limits describes the maximum amount of compute resources allowed.
211+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
212+
type: object
213+
requests:
214+
additionalProperties:
215+
anyOf:
216+
- type: integer
217+
- type: string
218+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
219+
x-kubernetes-int-or-string: true
220+
description: |-
221+
Requests describes the minimum amount of compute resources required.
222+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
223+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
224+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
225+
type: object
226+
type: object
163227
storageClass:
164228
default: local-storage
165229
description: StorageClass used to create any test-operator related
@@ -619,6 +683,70 @@ spec:
619683
functionalities to work properly (e.g.: extraRPMs in Tempest CR, or certain set
620684
of tobiko tests).
621685
type: boolean
686+
resources:
687+
default:
688+
limits:
689+
cpu: 8000m
690+
memory: 4Gi
691+
requests:
692+
cpu: 4000m
693+
memory: 2Gi
694+
description: |-
695+
The desired amount of resources that should be assigned to each test pod
696+
spawned using the Tempest CR. https://pkg.go.dev/k8s.io/api/core/v1#ResourceRequirements
697+
properties:
698+
claims:
699+
description: |-
700+
Claims lists the names of resources, defined in spec.resourceClaims,
701+
that are used by this container.
702+
703+
704+
This is an alpha field and requires enabling the
705+
DynamicResourceAllocation feature gate.
706+
707+
708+
This field is immutable. It can only be set for containers.
709+
items:
710+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
711+
properties:
712+
name:
713+
description: |-
714+
Name must match the name of one entry in pod.spec.resourceClaims of
715+
the Pod where this field is used. It makes that resource available
716+
inside a container.
717+
type: string
718+
required:
719+
- name
720+
type: object
721+
type: array
722+
x-kubernetes-list-map-keys:
723+
- name
724+
x-kubernetes-list-type: map
725+
limits:
726+
additionalProperties:
727+
anyOf:
728+
- type: integer
729+
- type: string
730+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
731+
x-kubernetes-int-or-string: true
732+
description: |-
733+
Limits describes the maximum amount of compute resources allowed.
734+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
735+
type: object
736+
requests:
737+
additionalProperties:
738+
anyOf:
739+
- type: integer
740+
- type: string
741+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
742+
x-kubernetes-int-or-string: true
743+
description: |-
744+
Requests describes the minimum amount of compute resources required.
745+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
746+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
747+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
748+
type: object
749+
type: object
622750
stepName:
623751
description: |-
624752
Name of a workflow step. The step name will be used for example to create

0 commit comments

Comments
 (0)