diff --git a/dist/resource-overlay.yaml b/dist/resource-overlay.yaml new file mode 100644 index 00000000..4ac39b86 --- /dev/null +++ b/dist/resource-overlay.yaml @@ -0,0 +1,34 @@ +#! Copyright 2021-2022 VMware Inc. +#! +#! 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. + +#@ load("@ytt:overlay", "overlay") +#@ load("@ytt:data", "data") + +#@ def conventions_deployment(): +kind: Deployment +metadata: + name: cartographer-conventions-controller-manager + namespace: conventions-system +#@ end + +#@overlay/match by=overlay.subset(conventions_deployment()), expects="0+" +--- +spec: + template: + spec: + containers: + #@overlay/match by="name" + - name: manager + #@overlay/match missing_ok=True + resources: #@ data.values.resources \ No newline at end of file diff --git a/dist/schema.yaml b/dist/schema.yaml index f7d44bc4..1d519c23 100644 --- a/dist/schema.yaml +++ b/dist/schema.yaml @@ -7,3 +7,38 @@ #@schema/desc "Optional: Arn role that has access to pull images from ECR container registry" aws_iam_role_arn: "" + +#@schema/desc "Optional: Cartographer Conventions controller resource limit configuration" + resources: + type: object + properties: + limits: + type: object + properties: + #@schema/description "Optional: maximum amount of cpu resources to allow the controller to use" + cpu: + type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + default: 100m + #@schema/description "Optional: maximum amount of memory to allow the controller to use" + memory: + type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + default: 512Mi + requests: + type: object + properties: + #@schema/description "Optional: minimum amount of cpu to reserve" + cpu: + type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + default: 100m + #@schema/description "Optional: minimum amount of memory to reserve" + memory: + type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + default: 20Mi \ No newline at end of file