From 077045b094fe91e9b38abb8fa44f6fa791ea5cae Mon Sep 17 00:00:00 2001 From: kklinch0 Date: Wed, 19 Mar 2025 00:57:13 +0300 Subject: [PATCH] fix apps resources Signed-off-by: kklinch0 --- packages/apps/http-cache/Chart.yaml | 2 +- packages/apps/http-cache/README.md | 18 +++--- .../apps/http-cache/templates/_resources.tpl | 50 +++++++++++++++ .../templates/haproxy/deployment.yaml | 5 ++ .../templates/nginx/deployment.yaml | 12 ++++ packages/apps/http-cache/values.schema.json | 20 ++++++ packages/apps/http-cache/values.yaml | 24 +++++++ packages/apps/kafka/Chart.yaml | 2 +- packages/apps/kafka/README.md | 30 ++++----- packages/apps/kafka/templates/kafka.yaml | 13 ++-- packages/apps/kafka/values.schema.json | 30 ++++++--- packages/apps/kafka/values.yaml | 38 ++++++++---- packages/apps/kubernetes/Chart.yaml | 2 +- .../cluster-autoscaler/deployment.yaml | 7 +++ .../apps/kubernetes/templates/csi/deploy.yaml | 28 +++++++-- .../kubernetes/templates/kccm/manager.yaml | 6 +- packages/apps/tcp-balancer/Chart.yaml | 2 +- packages/apps/tcp-balancer/README.md | 18 +++--- .../tcp-balancer/templates/_resources.tpl | 50 +++++++++++++++ .../tcp-balancer/templates/deployment.yaml | 5 ++ packages/apps/tcp-balancer/values.schema.json | 62 ------------------- packages/apps/tcp-balancer/values.yaml | 13 ++++ packages/apps/versions_map | 15 +++-- packages/apps/vpn/Chart.yaml | 2 +- packages/apps/vpn/README.md | 12 ++-- packages/apps/vpn/templates/_resources.tpl | 50 +++++++++++++++ packages/apps/vpn/templates/deployment.yaml | 5 ++ packages/apps/vpn/values.schema.json | 10 +++ packages/apps/vpn/values.yaml | 13 ++++ packages/core/installer/values.yaml | 2 +- 30 files changed, 405 insertions(+), 141 deletions(-) create mode 100644 packages/apps/http-cache/templates/_resources.tpl create mode 100644 packages/apps/tcp-balancer/templates/_resources.tpl create mode 100644 packages/apps/vpn/templates/_resources.tpl diff --git a/packages/apps/http-cache/Chart.yaml b/packages/apps/http-cache/Chart.yaml index fdb62f9e..2224053c 100644 --- a/packages/apps/http-cache/Chart.yaml +++ b/packages/apps/http-cache/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.1 +version: 0.4.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/http-cache/README.md b/packages/apps/http-cache/README.md index 904fdf61..cb482fc0 100644 --- a/packages/apps/http-cache/README.md +++ b/packages/apps/http-cache/README.md @@ -60,13 +60,17 @@ VTS module shows wrong upstream resonse time ### Common parameters -| Name | Description | Value | -| ------------------ | ----------------------------------------------- | ------- | -| `external` | Enable external access from outside the cluster | `false` | -| `size` | Persistent Volume size | `10Gi` | -| `storageClass` | StorageClass used to store the data | `""` | -| `haproxy.replicas` | Number of HAProxy replicas | `2` | -| `nginx.replicas` | Number of Nginx replicas | `2` | +| Name | Description | Value | +| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `external` | Enable external access from outside the cluster | `false` | +| `size` | Persistent Volume size | `10Gi` | +| `storageClass` | StorageClass used to store the data | `""` | +| `haproxy.replicas` | Number of HAProxy replicas | `2` | +| `nginx.replicas` | Number of Nginx replicas | `2` | +| `haproxy.resources` | Resources | `{}` | +| `haproxy.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `nano` | +| `nginx.resources` | Resources | `{}` | +| `nginx.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `nano` | ### Configuration parameters diff --git a/packages/apps/http-cache/templates/_resources.tpl b/packages/apps/http-cache/templates/_resources.tpl new file mode 100644 index 00000000..7ada56d4 --- /dev/null +++ b/packages/apps/http-cache/templates/_resources.tpl @@ -0,0 +1,50 @@ +{{/* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{/* vim: set filetype=mustache: */}} + +{{/* +Return a resource request/limit object based on a given preset. +These presets are for basic testing and not meant to be used in production +{{ include "resources.preset" (dict "type" "nano") -}} +*/}} +{{- define "resources.preset" -}} +{{/* The limits are the requests increased by 50% (except ephemeral-storage and xlarge/2xlarge sizes)*/}} +{{- $presets := dict + "nano" (dict + "requests" (dict "cpu" "100m" "memory" "128Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "150m" "memory" "192Mi" "ephemeral-storage" "2Gi") + ) + "micro" (dict + "requests" (dict "cpu" "250m" "memory" "256Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "375m" "memory" "384Mi" "ephemeral-storage" "2Gi") + ) + "small" (dict + "requests" (dict "cpu" "500m" "memory" "512Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "750m" "memory" "768Mi" "ephemeral-storage" "2Gi") + ) + "medium" (dict + "requests" (dict "cpu" "500m" "memory" "1024Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "750m" "memory" "1536Mi" "ephemeral-storage" "2Gi") + ) + "large" (dict + "requests" (dict "cpu" "1.0" "memory" "2048Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "1.5" "memory" "3072Mi" "ephemeral-storage" "2Gi") + ) + "xlarge" (dict + "requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "3.0" "memory" "6144Mi" "ephemeral-storage" "2Gi") + ) + "2xlarge" (dict + "requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "6.0" "memory" "12288Mi" "ephemeral-storage" "2Gi") + ) + }} +{{- if hasKey $presets .type -}} +{{- index $presets .type | toYaml -}} +{{- else -}} +{{- printf "ERROR: Preset key '%s' invalid. Allowed values are %s" .type (join "," (keys $presets)) | fail -}} +{{- end -}} +{{- end -}} diff --git a/packages/apps/http-cache/templates/haproxy/deployment.yaml b/packages/apps/http-cache/templates/haproxy/deployment.yaml index 10ef9b55..b60814dc 100644 --- a/packages/apps/http-cache/templates/haproxy/deployment.yaml +++ b/packages/apps/http-cache/templates/haproxy/deployment.yaml @@ -33,6 +33,11 @@ spec: containers: - image: haproxy:latest name: haproxy + {{- if .Values.haproxy.resources }} + resources: {{- toYaml .Values.haproxy.resources | nindent 10 }} + {{- else if ne .Values.haproxy.resourcesPreset "none" }} + resources: {{- include "resources.preset" (dict "type" .Values.haproxy.resourcesPreset "Release" .Release) | nindent 10 }} + {{- end }} ports: - containerPort: 8080 name: http diff --git a/packages/apps/http-cache/templates/nginx/deployment.yaml b/packages/apps/http-cache/templates/nginx/deployment.yaml index e83e81e1..ae640fd5 100644 --- a/packages/apps/http-cache/templates/nginx/deployment.yaml +++ b/packages/apps/http-cache/templates/nginx/deployment.yaml @@ -52,6 +52,11 @@ spec: shareProcessNamespace: true containers: - name: nginx + {{- if $.Values.nginx.resources }} + resources: {{- toYaml $.Values.nginx.resources | nindent 10 }} + {{- else if ne $.Values.nginx.resourcesPreset "none" }} + resources: {{- include "resources.preset" (dict "type" $.Values.nginx.resourcesPreset "Release" $.Release) | nindent 10 }} + {{- end }} image: "{{ $.Files.Get "images/nginx-cache.tag" | trim }}" readinessProbe: httpGet: @@ -83,6 +88,13 @@ spec: - name: reloader image: "{{ $.Files.Get "images/nginx-cache.tag" | trim }}" command: ["/usr/bin/nginx-reloader.sh"] + resources: + limits: + cpu: 50m + memory: 50Mi + requests: + cpu: 50m + memory: 50Mi #command: ["sleep", "infinity"] volumeMounts: - mountPath: /etc/nginx/nginx.conf diff --git a/packages/apps/http-cache/values.schema.json b/packages/apps/http-cache/values.schema.json index cb1dfc86..ab3fbb7b 100644 --- a/packages/apps/http-cache/values.schema.json +++ b/packages/apps/http-cache/values.schema.json @@ -24,6 +24,16 @@ "type": "number", "description": "Number of HAProxy replicas", "default": 2 + }, + "resources": { + "type": "object", + "description": "Resources", + "default": {} + }, + "resourcesPreset": { + "type": "string", + "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).", + "default": "nano" } } }, @@ -34,6 +44,16 @@ "type": "number", "description": "Number of Nginx replicas", "default": 2 + }, + "resources": { + "type": "object", + "description": "Resources", + "default": {} + }, + "resourcesPreset": { + "type": "string", + "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).", + "default": "nano" } } }, diff --git a/packages/apps/http-cache/values.yaml b/packages/apps/http-cache/values.yaml index 526cb62c..e514ebcc 100644 --- a/packages/apps/http-cache/values.yaml +++ b/packages/apps/http-cache/values.yaml @@ -12,8 +12,32 @@ size: 10Gi storageClass: "" haproxy: replicas: 2 + ## @param haproxy.resources Resources + resources: {} + # resources: + # limits: + # cpu: 4000m + # memory: 4Gi + # requests: + # cpu: 100m + # memory: 512Mi + + ## @param haproxy.resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). + resourcesPreset: "nano" nginx: replicas: 2 + ## @param nginx.resources Resources + resources: {} + # resources: + # limits: + # cpu: 4000m + # memory: 4Gi + # requests: + # cpu: 100m + # memory: 512Mi + + ## @param nginx.resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). + resourcesPreset: "nano" ## @section Configuration parameters diff --git a/packages/apps/kafka/Chart.yaml b/packages/apps/kafka/Chart.yaml index 3d1d6e36..d4e910d4 100644 --- a/packages/apps/kafka/Chart.yaml +++ b/packages/apps/kafka/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.5.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/kafka/README.md b/packages/apps/kafka/README.md index 7cd045cc..d6a23fc8 100644 --- a/packages/apps/kafka/README.md +++ b/packages/apps/kafka/README.md @@ -4,20 +4,22 @@ ### Common parameters -| Name | Description | Value | -| ------------------------ | ----------------------------------------------- | ------- | -| `external` | Enable external access from outside the cluster | `false` | -| `kafka.size` | Persistent Volume size for Kafka | `10Gi` | -| `kafka.replicas` | Number of Kafka replicas | `3` | -| `kafka.storageClass` | StorageClass used to store the Kafka data | `""` | -| `zookeeper.size` | Persistent Volume size for ZooKeeper | `5Gi` | -| `zookeeper.replicas` | Number of ZooKeeper replicas | `3` | -| `zookeeper.storageClass` | StorageClass used to store the ZooKeeper data | `""` | +| Name | Description | Value | +| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `external` | Enable external access from outside the cluster | `false` | +| `kafka.size` | Persistent Volume size for Kafka | `10Gi` | +| `kafka.replicas` | Number of Kafka replicas | `3` | +| `kafka.storageClass` | StorageClass used to store the Kafka data | `""` | +| `zookeeper.size` | Persistent Volume size for ZooKeeper | `5Gi` | +| `zookeeper.replicas` | Number of ZooKeeper replicas | `3` | +| `zookeeper.storageClass` | StorageClass used to store the ZooKeeper data | `""` | +| `kafka.resources` | Resources | `{}` | +| `kafka.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `nano` | +| `zookeeper.resources` | Resources | `{}` | +| `zookeeper.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `nano` | ### Configuration parameters -| Name | Description | Value | -| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -| `topics` | Topics configuration | `[]` | -| `resources` | Resources | `{}` | -| `resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `nano` | +| Name | Description | Value | +| -------- | -------------------- | ----- | +| `topics` | Topics configuration | `[]` | diff --git a/packages/apps/kafka/templates/kafka.yaml b/packages/apps/kafka/templates/kafka.yaml index 742f365d..c981580c 100644 --- a/packages/apps/kafka/templates/kafka.yaml +++ b/packages/apps/kafka/templates/kafka.yaml @@ -8,10 +8,10 @@ metadata: spec: kafka: replicas: {{ .Values.kafka.replicas }} - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 6 }} - {{- else if ne .Values.resourcesPreset "none" }} - resources: {{- include "resources.preset" (dict "type" .Values.resourcesPreset "Release" .Release) | nindent 6 }} + {{- if .Values.kafka.resources }} + resources: {{- toYaml .Values.kafka.resources | nindent 6 }} + {{- else if ne .Values.kafka.resourcesPreset "none" }} + resources: {{- include "resources.preset" (dict "type" .Values.kafka.resourcesPreset "Release" .Release) | nindent 6 }} {{- end }} listeners: - name: plain @@ -70,6 +70,11 @@ spec: key: kafka-metrics-config.yml zookeeper: replicas: {{ .Values.zookeeper.replicas }} + {{- if .Values.zookeeper.resources }} + resources: {{- toYaml .Values.zookeeper.resources | nindent 6 }} + {{- else if ne .Values.zookeeper.resourcesPreset "none" }} + resources: {{- include "resources.preset" (dict "type" .Values.zookeeper.resourcesPreset "Release" .Release) | nindent 6 }} + {{- end }} storage: type: persistent-claim {{- with .Values.zookeeper.size }} diff --git a/packages/apps/kafka/values.schema.json b/packages/apps/kafka/values.schema.json index eb7e2488..8a1b33f8 100644 --- a/packages/apps/kafka/values.schema.json +++ b/packages/apps/kafka/values.schema.json @@ -24,6 +24,16 @@ "type": "string", "description": "StorageClass used to store the Kafka data", "default": "" + }, + "resources": { + "type": "object", + "description": "Resources", + "default": {} + }, + "resourcesPreset": { + "type": "string", + "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).", + "default": "nano" } } }, @@ -44,6 +54,16 @@ "type": "string", "description": "StorageClass used to store the ZooKeeper data", "default": "" + }, + "resources": { + "type": "object", + "description": "Resources", + "default": {} + }, + "resourcesPreset": { + "type": "string", + "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).", + "default": "nano" } } }, @@ -52,16 +72,6 @@ "description": "Topics configuration", "default": [], "items": {} - }, - "resources": { - "type": "object", - "description": "Resources", - "default": {} - }, - "resourcesPreset": { - "type": "string", - "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).", - "default": "nano" } } } \ No newline at end of file diff --git a/packages/apps/kafka/values.yaml b/packages/apps/kafka/values.yaml index 7b05c6de..185f8841 100644 --- a/packages/apps/kafka/values.yaml +++ b/packages/apps/kafka/values.yaml @@ -14,10 +14,35 @@ kafka: size: 10Gi replicas: 3 storageClass: "" + ## @param kafka.resources Resources + resources: {} + # resources: + # limits: + # cpu: 4000m + # memory: 4Gi + # requests: + # cpu: 100m + # memory: 512Mi + + ## @param kafka.resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). + resourcesPreset: "nano" + zookeeper: size: 5Gi replicas: 3 storageClass: "" + ## @param zookeeper.resources Resources + resources: {} + # resources: + # limits: + # cpu: 4000m + # memory: 4Gi + # requests: + # cpu: 100m + # memory: 512Mi + + ## @param zookeeper.resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). + resourcesPreset: "nano" ## @section Configuration parameters @@ -39,16 +64,3 @@ zookeeper: ## replicas: 3 ## topics: [] - -## @param resources Resources -resources: {} - # resources: - # limits: - # cpu: 4000m - # memory: 4Gi - # requests: - # cpu: 100m - # memory: 512Mi - -## @param resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). -resourcesPreset: "nano" diff --git a/packages/apps/kubernetes/Chart.yaml b/packages/apps/kubernetes/Chart.yaml index 58d8c8ff..16617d5d 100644 --- a/packages/apps/kubernetes/Chart.yaml +++ b/packages/apps/kubernetes/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.15.2 +version: 0.16.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/kubernetes/templates/cluster-autoscaler/deployment.yaml b/packages/apps/kubernetes/templates/cluster-autoscaler/deployment.yaml index 6b31f53a..73d14cf5 100644 --- a/packages/apps/kubernetes/templates/cluster-autoscaler/deployment.yaml +++ b/packages/apps/kubernetes/templates/cluster-autoscaler/deployment.yaml @@ -26,6 +26,13 @@ spec: containers: - image: "{{ $.Files.Get "images/cluster-autoscaler.tag" | trim }}" name: cluster-autoscaler + resources: + limits: + cpu: 512m + memory: 512Mi + requests: + cpu: 124m + memory: 124Mi command: - /cluster-autoscaler args: diff --git a/packages/apps/kubernetes/templates/csi/deploy.yaml b/packages/apps/kubernetes/templates/csi/deploy.yaml index d0d83e37..a93dfd2a 100644 --- a/packages/apps/kubernetes/templates/csi/deploy.yaml +++ b/packages/apps/kubernetes/templates/csi/deploy.yaml @@ -63,11 +63,21 @@ spec: mountPath: /etc/kubernetes/kubeconfig readOnly: true resources: + limits: + cpu: 512m + memory: 512Mi requests: - memory: 50Mi - cpu: 10m + cpu: 124m + memory: 124Mi - name: csi-provisioner image: quay.io/openshift/origin-csi-external-provisioner:latest + resources: + limits: + cpu: 512m + memory: 512Mi + requests: + cpu: 124m + memory: 124Mi args: - "--csi-address=$(ADDRESS)" - "--default-fstype=ext4" @@ -102,9 +112,12 @@ spec: mountPath: /etc/kubernetes/kubeconfig readOnly: true resources: + limits: + cpu: 512m + memory: 512Mi requests: - memory: 50Mi - cpu: 10m + cpu: 124m + memory: 124Mi - name: csi-liveness-probe image: quay.io/openshift/origin-csi-livenessprobe:latest args: @@ -115,9 +128,12 @@ spec: - name: socket-dir mountPath: /csi resources: + limits: + cpu: 512m + memory: 512Mi requests: - memory: 50Mi - cpu: 10m + cpu: 124m + memory: 124Mi volumes: - name: socket-dir emptyDir: {} diff --git a/packages/apps/kubernetes/templates/kccm/manager.yaml b/packages/apps/kubernetes/templates/kccm/manager.yaml index 12e48245..dd5ad50f 100644 --- a/packages/apps/kubernetes/templates/kccm/manager.yaml +++ b/packages/apps/kubernetes/templates/kccm/manager.yaml @@ -36,8 +36,12 @@ spec: #securityContext: # privileged: true resources: + limits: + cpu: 512m + memory: 512Mi requests: - cpu: 100m + cpu: 124m + memory: 124Mi volumeMounts: - mountPath: /etc/kubernetes/kubeconfig name: kubeconfig diff --git a/packages/apps/tcp-balancer/Chart.yaml b/packages/apps/tcp-balancer/Chart.yaml index c4e9744f..9d701dcd 100644 --- a/packages/apps/tcp-balancer/Chart.yaml +++ b/packages/apps/tcp-balancer/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/tcp-balancer/README.md b/packages/apps/tcp-balancer/README.md index 1e5d7dd9..bbdf88c3 100644 --- a/packages/apps/tcp-balancer/README.md +++ b/packages/apps/tcp-balancer/README.md @@ -19,11 +19,13 @@ Managed TCP Load Balancer Service efficiently utilizes HAProxy for load balancin ### Configuration parameters -| Name | Description | Value | -| -------------------------------- | ------------------------------------------------------------- | ------- | -| `httpAndHttps.mode` | Mode for balancer. Allowed values: `tcp` and `tcp-with-proxy` | `tcp` | -| `httpAndHttps.targetPorts.http` | HTTP port number. | `80` | -| `httpAndHttps.targetPorts.https` | HTTPS port number. | `443` | -| `httpAndHttps.endpoints` | Endpoint addresses list | `[]` | -| `whitelistHTTP` | Secure HTTP by enabling client networks whitelisting | `false` | -| `whitelist` | List of client networks | `[]` | +| Name | Description | Value | +| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `httpAndHttps.mode` | Mode for balancer. Allowed values: `tcp` and `tcp-with-proxy` | `tcp` | +| `httpAndHttps.targetPorts.http` | HTTP port number. | `80` | +| `httpAndHttps.targetPorts.https` | HTTPS port number. | `443` | +| `httpAndHttps.endpoints` | Endpoint addresses list | `[]` | +| `whitelistHTTP` | Secure HTTP by enabling client networks whitelisting | `false` | +| `whitelist` | List of client networks | `[]` | +| `resources` | Resources | `{}` | +| `resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `nano` | diff --git a/packages/apps/tcp-balancer/templates/_resources.tpl b/packages/apps/tcp-balancer/templates/_resources.tpl new file mode 100644 index 00000000..7ada56d4 --- /dev/null +++ b/packages/apps/tcp-balancer/templates/_resources.tpl @@ -0,0 +1,50 @@ +{{/* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{/* vim: set filetype=mustache: */}} + +{{/* +Return a resource request/limit object based on a given preset. +These presets are for basic testing and not meant to be used in production +{{ include "resources.preset" (dict "type" "nano") -}} +*/}} +{{- define "resources.preset" -}} +{{/* The limits are the requests increased by 50% (except ephemeral-storage and xlarge/2xlarge sizes)*/}} +{{- $presets := dict + "nano" (dict + "requests" (dict "cpu" "100m" "memory" "128Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "150m" "memory" "192Mi" "ephemeral-storage" "2Gi") + ) + "micro" (dict + "requests" (dict "cpu" "250m" "memory" "256Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "375m" "memory" "384Mi" "ephemeral-storage" "2Gi") + ) + "small" (dict + "requests" (dict "cpu" "500m" "memory" "512Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "750m" "memory" "768Mi" "ephemeral-storage" "2Gi") + ) + "medium" (dict + "requests" (dict "cpu" "500m" "memory" "1024Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "750m" "memory" "1536Mi" "ephemeral-storage" "2Gi") + ) + "large" (dict + "requests" (dict "cpu" "1.0" "memory" "2048Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "1.5" "memory" "3072Mi" "ephemeral-storage" "2Gi") + ) + "xlarge" (dict + "requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "3.0" "memory" "6144Mi" "ephemeral-storage" "2Gi") + ) + "2xlarge" (dict + "requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "6.0" "memory" "12288Mi" "ephemeral-storage" "2Gi") + ) + }} +{{- if hasKey $presets .type -}} +{{- index $presets .type | toYaml -}} +{{- else -}} +{{- printf "ERROR: Preset key '%s' invalid. Allowed values are %s" .type (join "," (keys $presets)) | fail -}} +{{- end -}} +{{- end -}} diff --git a/packages/apps/tcp-balancer/templates/deployment.yaml b/packages/apps/tcp-balancer/templates/deployment.yaml index 0f70bbae..fff64a4c 100644 --- a/packages/apps/tcp-balancer/templates/deployment.yaml +++ b/packages/apps/tcp-balancer/templates/deployment.yaml @@ -33,6 +33,11 @@ spec: containers: - image: haproxy:latest name: haproxy + {{- if .Values.resources }} + resources: {{- toYaml .Values.resources | nindent 10 }} + {{- else if ne .Values.resourcesPreset "none" }} + resources: {{- include "resources.preset" (dict "type" .Values.resourcesPreset "Release" .Release) | nindent 10 }} + {{- end }} ports: {{- with .Values.httpAndHttps }} - containerPort: 8080 diff --git a/packages/apps/tcp-balancer/values.schema.json b/packages/apps/tcp-balancer/values.schema.json index 43cf639d..e69de29b 100644 --- a/packages/apps/tcp-balancer/values.schema.json +++ b/packages/apps/tcp-balancer/values.schema.json @@ -1,62 +0,0 @@ -{ - "title": "Chart Values", - "type": "object", - "properties": { - "external": { - "type": "boolean", - "description": "Enable external access from outside the cluster", - "default": false - }, - "replicas": { - "type": "number", - "description": "Number of HAProxy replicas", - "default": 2 - }, - "httpAndHttps": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "description": "Mode for balancer. Allowed values: `tcp` and `tcp-with-proxy`", - "default": "tcp", - "enum": [ - "tcp", - "tcp-with-proxy" - ] - }, - "targetPorts": { - "type": "object", - "properties": { - "http": { - "type": "number", - "description": "HTTP port number.", - "default": 80 - }, - "https": { - "type": "number", - "description": "HTTPS port number.", - "default": 443 - } - } - }, - "endpoints": { - "type": "array", - "description": "Endpoint addresses list", - "default": [], - "items": {} - } - } - }, - "whitelistHTTP": { - "type": "boolean", - "description": "Secure HTTP by enabling client networks whitelisting", - "default": false - }, - "whitelist": { - "type": "array", - "description": "List of client networks", - "default": [], - "items": {} - } - } -} diff --git a/packages/apps/tcp-balancer/values.yaml b/packages/apps/tcp-balancer/values.yaml index 439283f0..fb14c01a 100644 --- a/packages/apps/tcp-balancer/values.yaml +++ b/packages/apps/tcp-balancer/values.yaml @@ -43,3 +43,16 @@ httpAndHttps: ## whitelistHTTP: false whitelist: [] + +## @param resources Resources +resources: {} +# resources: +# limits: +# cpu: 4000m +# memory: 4Gi +# requests: +# cpu: 100m +# memory: 512Mi + +## @param resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). +resourcesPreset: "nano" diff --git a/packages/apps/versions_map b/packages/apps/versions_map index cfd912ab..5f0d7e0e 100644 --- a/packages/apps/versions_map +++ b/packages/apps/versions_map @@ -20,7 +20,8 @@ ferretdb 0.5.0 HEAD http-cache 0.1.0 a956713 http-cache 0.2.0 5ca8823 http-cache 0.3.0 fab5940 -http-cache 0.3.1 HEAD +http-cache 0.3.1 fab5940b +http-cache 0.4.0 HEAD kafka 0.1.0 760f86d2 kafka 0.2.0 a2cc83d kafka 0.2.1 3ac17018 @@ -30,7 +31,8 @@ kafka 0.3.0 c07c4bbd kafka 0.3.1 b7375f73 kafka 0.3.2 b75aaf17 kafka 0.3.3 425ce77f -kafka 0.4.0 HEAD +kafka 0.4.0 0e10f952 +kafka 0.5.0 HEAD kubernetes 0.1.0 f642698 kubernetes 0.2.0 7cd7de73 kubernetes 0.3.0 7caccec1 @@ -52,7 +54,8 @@ kubernetes 0.14.0 bfbde07c kubernetes 0.14.1 fde4bcfa kubernetes 0.15.0 cb7b8158 kubernetes 0.15.1 43e593c7 -kubernetes 0.15.2 HEAD +kubernetes 0.15.2 43e593c7 +kubernetes 0.16.0 HEAD mysql 0.1.0 f642698 mysql 0.2.0 8b975ff0 mysql 0.3.0 5ca8823 @@ -100,7 +103,8 @@ redis 0.4.0 abc8f082 redis 0.5.0 0e728870 redis 0.6.0 HEAD tcp-balancer 0.1.0 f642698 -tcp-balancer 0.2.0 HEAD +tcp-balancer 0.2.0 a9567139 +tcp-balancer 0.3.0 HEAD tenant 0.1.3 3d1b86c tenant 0.1.4 d200480 tenant 0.1.5 e3ab858 @@ -147,4 +151,5 @@ vm-instance 0.5.1 HEAD vpn 0.1.0 f642698 vpn 0.2.0 7151424 vpn 0.3.0 a2bcf100 -vpn 0.3.1 HEAD +vpn 0.3.1 f7220f19 +vpn 0.4.0 HEAD diff --git a/packages/apps/vpn/Chart.yaml b/packages/apps/vpn/Chart.yaml index 8fe285f6..c82e77dd 100644 --- a/packages/apps/vpn/Chart.yaml +++ b/packages/apps/vpn/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.1 +version: 0.4.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/vpn/README.md b/packages/apps/vpn/README.md index b89b7ca9..3920302d 100644 --- a/packages/apps/vpn/README.md +++ b/packages/apps/vpn/README.md @@ -22,8 +22,10 @@ The VPN Service is powered by the Outline Server, an advanced and user-friendly ### Configuration parameters -| Name | Description | Value | -| ------------- | ------------------------------------------- | ----- | -| `host` | Host used to substitute into generated URLs | `""` | -| `users` | Users configuration | `{}` | -| `externalIPs` | List of externalIPs for service. | `[]` | +| Name | Description | Value | +| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| `host` | Host used to substitute into generated URLs | `""` | +| `users` | Users configuration | `{}` | +| `externalIPs` | List of externalIPs for service. | `[]` | +| `resources` | Resources | `{}` | +| `resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `nano` | diff --git a/packages/apps/vpn/templates/_resources.tpl b/packages/apps/vpn/templates/_resources.tpl new file mode 100644 index 00000000..7ada56d4 --- /dev/null +++ b/packages/apps/vpn/templates/_resources.tpl @@ -0,0 +1,50 @@ +{{/* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{/* vim: set filetype=mustache: */}} + +{{/* +Return a resource request/limit object based on a given preset. +These presets are for basic testing and not meant to be used in production +{{ include "resources.preset" (dict "type" "nano") -}} +*/}} +{{- define "resources.preset" -}} +{{/* The limits are the requests increased by 50% (except ephemeral-storage and xlarge/2xlarge sizes)*/}} +{{- $presets := dict + "nano" (dict + "requests" (dict "cpu" "100m" "memory" "128Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "150m" "memory" "192Mi" "ephemeral-storage" "2Gi") + ) + "micro" (dict + "requests" (dict "cpu" "250m" "memory" "256Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "375m" "memory" "384Mi" "ephemeral-storage" "2Gi") + ) + "small" (dict + "requests" (dict "cpu" "500m" "memory" "512Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "750m" "memory" "768Mi" "ephemeral-storage" "2Gi") + ) + "medium" (dict + "requests" (dict "cpu" "500m" "memory" "1024Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "750m" "memory" "1536Mi" "ephemeral-storage" "2Gi") + ) + "large" (dict + "requests" (dict "cpu" "1.0" "memory" "2048Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "1.5" "memory" "3072Mi" "ephemeral-storage" "2Gi") + ) + "xlarge" (dict + "requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "3.0" "memory" "6144Mi" "ephemeral-storage" "2Gi") + ) + "2xlarge" (dict + "requests" (dict "cpu" "1.0" "memory" "3072Mi" "ephemeral-storage" "50Mi") + "limits" (dict "cpu" "6.0" "memory" "12288Mi" "ephemeral-storage" "2Gi") + ) + }} +{{- if hasKey $presets .type -}} +{{- index $presets .type | toYaml -}} +{{- else -}} +{{- printf "ERROR: Preset key '%s' invalid. Allowed values are %s" .type (join "," (keys $presets)) | fail -}} +{{- end -}} +{{- end -}} diff --git a/packages/apps/vpn/templates/deployment.yaml b/packages/apps/vpn/templates/deployment.yaml index 72050a25..8de539ab 100644 --- a/packages/apps/vpn/templates/deployment.yaml +++ b/packages/apps/vpn/templates/deployment.yaml @@ -42,6 +42,11 @@ spec: containers: - name: outline-vpn image: quay.io/outline/shadowbox:stable + {{- if .Values.resources }} + resources: {{- toYaml .Values.resources | nindent 10 }} + {{- else if ne .Values.resourcesPreset "none" }} + resources: {{- include "resources.preset" (dict "type" .Values.resourcesPreset "Release" .Release) | nindent 10 }} + {{- end }} ports: - containerPort: 40000 protocol: TCP diff --git a/packages/apps/vpn/values.schema.json b/packages/apps/vpn/values.schema.json index 30f6807c..84f9c71d 100644 --- a/packages/apps/vpn/values.schema.json +++ b/packages/apps/vpn/values.schema.json @@ -24,6 +24,16 @@ "items": { "type": "string" } + }, + "resources": { + "type": "object", + "description": "Resources", + "default": {} + }, + "resourcesPreset": { + "type": "string", + "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).", + "default": "nano" } } } \ No newline at end of file diff --git a/packages/apps/vpn/values.yaml b/packages/apps/vpn/values.yaml index 817c1041..f781e50a 100644 --- a/packages/apps/vpn/values.yaml +++ b/packages/apps/vpn/values.yaml @@ -29,3 +29,16 @@ users: {} ## - "11.22.33.46" ## externalIPs: [] + +## @param resources Resources +resources: {} +# resources: +# limits: +# cpu: 4000m +# memory: 4Gi +# requests: +# cpu: 100m +# memory: 512Mi + +## @param resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). +resourcesPreset: "nano" diff --git a/packages/core/installer/values.yaml b/packages/core/installer/values.yaml index 65d539ad..f058ed3f 100644 --- a/packages/core/installer/values.yaml +++ b/packages/core/installer/values.yaml @@ -1,2 +1,2 @@ cozystack: - image: kklinch0/installer:0.27.39@sha256:9f62b963a79fcd5774af28e248c74082a0fe5f7c443e18648101da01d36cf715 + image: kklinch0/installer:0.27.49@sha256:baf71ad11ade3ef10b9c77325a6385438054541f44248332afa3f95f8f66f7e5