-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE-572] ability to set mem/cpu for csi containers (#82)
Signed-off-by: Anton Yurkov <[email protected]> - Add `Resources *corev1.ResourceRequirements` to all components `api/v1/components` - Add follow tree to each csi component in csi-baremetal-deployment and value.yaml: ``` resources: requests: memory: cpu: limits: memory: cpu: ```
- Loading branch information
1 parent
5b71659
commit 3af3d6f
Showing
21 changed files
with
423 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Copyright © 2021 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package components | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
) | ||
|
||
// ResourceRequirements contain information for mem/cpu requirements | ||
type ResourceRequirements struct { | ||
// +nullable | ||
// +optional | ||
Limits corev1.ResourceList `json:"limits,omitempty"` | ||
// +nullable | ||
// +optional | ||
Requests corev1.ResourceList `json:"requests,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{- define "setResources" }} | ||
{{- if .resources }} | ||
{{- if or .resources.requests .resources.limits }} | ||
|
||
{{- $requestsValues := .resources.requests | values | compact }} | ||
{{- $limitsValues := .resources.limits | values | compact }} | ||
|
||
{{- if $limitsValues }} | ||
limits: | ||
{{- if .resources.limits.memory }} | ||
memory: {{ .resources.limits.memory }} | ||
{{- end }} | ||
{{- if .resources.limits.cpu }} | ||
cpu: {{ .resources.limits.cpu }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- if $requestsValues }} | ||
requests: | ||
{{- if .resources.requests.memory }} | ||
memory: {{ .resources.requests.memory }} | ||
{{- end }} | ||
{{- if .resources.requests.cpu }} | ||
cpu: {{ .resources.requests.cpu }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.