Skip to content

Commit 440c9cf

Browse files
authored
Merge pull request #469 from catpineapple/initContainer-resource-limit
[feature](initContainer) Init container resource limit
2 parents ca8803f + e6e0b73 commit 440c9cf

File tree

11 files changed

+1391
-0
lines changed

11 files changed

+1391
-0
lines changed

api/disaggregated/v1/types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ type SystemInitialization struct {
226226

227227
// Arguments to the entrypoint.
228228
Args []string `json:"args,omitempty"`
229+
230+
// defines the specification of resource cpu and mem for Custom initContainer.
231+
// the default behavior of the operator `initContainer` does not require resource constraints.
232+
// ep: {"requests":{"cpu": 4, "memory": "16Gi"},"limits":{"cpu":4,"memory":"16Gi"}}
233+
corev1.ResourceRequirements `json:",inline"`
229234
}
230235

231236
// PersistentVolume defines volume information and container mount information.

api/disaggregated/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/doris/v1/types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,11 @@ type SystemInitialization struct {
281281

282282
// Arguments to the entrypoint.
283283
Args []string `json:"args,omitempty"`
284+
285+
// defines the specification of resource cpu and mem for Custom initContainer.
286+
// the default behavior of the operator `initContainer` does not require resource constraints.
287+
// ep: {"requests":{"cpu": 4, "memory": "16Gi"},"limits":{"cpu":4,"memory":"16Gi"}}
288+
corev1.ResourceRequirements `json:",inline"`
284289
}
285290

286291
// PersistentVolume defines volume information and container mount information.

api/doris/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/crds.yaml

Lines changed: 385 additions & 0 deletions
Large diffs are not rendered by default.

config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,6 +2275,37 @@ spec:
22752275
items:
22762276
type: string
22772277
type: array
2278+
claims:
2279+
description: |-
2280+
Claims lists the names of resources, defined in spec.resourceClaims,
2281+
that are used by this container.
2282+
2283+
This is an alpha field and requires enabling the
2284+
DynamicResourceAllocation feature gate.
2285+
2286+
This field is immutable. It can only be set for containers.
2287+
items:
2288+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
2289+
properties:
2290+
name:
2291+
description: |-
2292+
Name must match the name of one entry in pod.spec.resourceClaims of
2293+
the Pod where this field is used. It makes that resource available
2294+
inside a container.
2295+
type: string
2296+
request:
2297+
description: |-
2298+
Request is the name chosen for a request in the referenced claim.
2299+
If empty, everything from the claim is made available, otherwise
2300+
only the result of this request.
2301+
type: string
2302+
required:
2303+
- name
2304+
type: object
2305+
type: array
2306+
x-kubernetes-list-map-keys:
2307+
- name
2308+
x-kubernetes-list-type: map
22782309
command:
22792310
description: Entrypoint array. Not executed within a shell.
22802311
items:
@@ -2284,6 +2315,30 @@ spec:
22842315
description: Image for doris initialization, default is
22852316
selectdb/alpine:latest.
22862317
type: string
2318+
limits:
2319+
additionalProperties:
2320+
anyOf:
2321+
- type: integer
2322+
- type: string
2323+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
2324+
x-kubernetes-int-or-string: true
2325+
description: |-
2326+
Limits describes the maximum amount of compute resources allowed.
2327+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
2328+
type: object
2329+
requests:
2330+
additionalProperties:
2331+
anyOf:
2332+
- type: integer
2333+
- type: string
2334+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
2335+
x-kubernetes-int-or-string: true
2336+
description: |-
2337+
Requests describes the minimum amount of compute resources required.
2338+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
2339+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
2340+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
2341+
type: object
22872342
type: object
22882343
tolerations:
22892344
description: (Optional) Tolerations for scheduling pods onto
@@ -4509,6 +4564,37 @@ spec:
45094564
items:
45104565
type: string
45114566
type: array
4567+
claims:
4568+
description: |-
4569+
Claims lists the names of resources, defined in spec.resourceClaims,
4570+
that are used by this container.
4571+
4572+
This is an alpha field and requires enabling the
4573+
DynamicResourceAllocation feature gate.
4574+
4575+
This field is immutable. It can only be set for containers.
4576+
items:
4577+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
4578+
properties:
4579+
name:
4580+
description: |-
4581+
Name must match the name of one entry in pod.spec.resourceClaims of
4582+
the Pod where this field is used. It makes that resource available
4583+
inside a container.
4584+
type: string
4585+
request:
4586+
description: |-
4587+
Request is the name chosen for a request in the referenced claim.
4588+
If empty, everything from the claim is made available, otherwise
4589+
only the result of this request.
4590+
type: string
4591+
required:
4592+
- name
4593+
type: object
4594+
type: array
4595+
x-kubernetes-list-map-keys:
4596+
- name
4597+
x-kubernetes-list-type: map
45124598
command:
45134599
description: Entrypoint array. Not executed within a shell.
45144600
items:
@@ -4517,6 +4603,30 @@ spec:
45174603
initImage:
45184604
description: Image for doris initialization, default is selectdb/alpine:latest.
45194605
type: string
4606+
limits:
4607+
additionalProperties:
4608+
anyOf:
4609+
- type: integer
4610+
- type: string
4611+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
4612+
x-kubernetes-int-or-string: true
4613+
description: |-
4614+
Limits describes the maximum amount of compute resources allowed.
4615+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
4616+
type: object
4617+
requests:
4618+
additionalProperties:
4619+
anyOf:
4620+
- type: integer
4621+
- type: string
4622+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
4623+
x-kubernetes-int-or-string: true
4624+
description: |-
4625+
Requests describes the minimum amount of compute resources required.
4626+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
4627+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
4628+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
4629+
type: object
45204630
type: object
45214631
tolerations:
45224632
description: (Optional) Tolerations for scheduling pods onto some
@@ -6763,6 +6873,37 @@ spec:
67636873
items:
67646874
type: string
67656875
type: array
6876+
claims:
6877+
description: |-
6878+
Claims lists the names of resources, defined in spec.resourceClaims,
6879+
that are used by this container.
6880+
6881+
This is an alpha field and requires enabling the
6882+
DynamicResourceAllocation feature gate.
6883+
6884+
This field is immutable. It can only be set for containers.
6885+
items:
6886+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
6887+
properties:
6888+
name:
6889+
description: |-
6890+
Name must match the name of one entry in pod.spec.resourceClaims of
6891+
the Pod where this field is used. It makes that resource available
6892+
inside a container.
6893+
type: string
6894+
request:
6895+
description: |-
6896+
Request is the name chosen for a request in the referenced claim.
6897+
If empty, everything from the claim is made available, otherwise
6898+
only the result of this request.
6899+
type: string
6900+
required:
6901+
- name
6902+
type: object
6903+
type: array
6904+
x-kubernetes-list-map-keys:
6905+
- name
6906+
x-kubernetes-list-type: map
67666907
command:
67676908
description: Entrypoint array. Not executed within a shell.
67686909
items:
@@ -6771,6 +6912,30 @@ spec:
67716912
initImage:
67726913
description: Image for doris initialization, default is selectdb/alpine:latest.
67736914
type: string
6915+
limits:
6916+
additionalProperties:
6917+
anyOf:
6918+
- type: integer
6919+
- type: string
6920+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6921+
x-kubernetes-int-or-string: true
6922+
description: |-
6923+
Limits describes the maximum amount of compute resources allowed.
6924+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6925+
type: object
6926+
requests:
6927+
additionalProperties:
6928+
anyOf:
6929+
- type: integer
6930+
- type: string
6931+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6932+
x-kubernetes-int-or-string: true
6933+
description: |-
6934+
Requests describes the minimum amount of compute resources required.
6935+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
6936+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
6937+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6938+
type: object
67746939
type: object
67756940
tolerations:
67766941
description: (Optional) Tolerations for scheduling pods onto some

0 commit comments

Comments
 (0)