From 3bf9971e6d22c295717cc6f9b78d4517d30d5b1c Mon Sep 17 00:00:00 2001 From: Sergi Philipsen Date: Mon, 2 Oct 2023 18:59:36 +0200 Subject: [PATCH] feat: make it possible to use percentages for memory --- charts/zaakbrug/Chart.lock | 6 +++--- charts/zaakbrug/Chart.yaml | 4 ++-- charts/zaakbrug/README.md | 8 ++++++- .../templates/configmap.zaakbrug.env.yaml | 11 ++++------ charts/zaakbrug/templates/deployment.yaml | 10 ++++----- charts/zaakbrug/templates/manifest.yaml | 2 +- charts/zaakbrug/values.schema.json | 21 ++++++++++++++++--- charts/zaakbrug/values.yaml | 11 ++++++++-- 8 files changed, 48 insertions(+), 25 deletions(-) diff --git a/charts/zaakbrug/Chart.lock b/charts/zaakbrug/Chart.lock index 15a55f9..db95108 100644 --- a/charts/zaakbrug/Chart.lock +++ b/charts/zaakbrug/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: ff-common repository: https://ibissource.github.io/charts/ - version: 0.1.14 + version: 0.1.15 - name: openzaak repository: https://maykinmedia.github.io/charts/ version: 1.1.0 -digest: sha256:8f446f6cccc3dd378596d50ad8892b01ace8868158851e6d49f14e4a078d54f7 -generated: "2023-09-26T12:13:19.382494004+02:00" +digest: sha256:0bb3c64a3532bc2434bce6614b0f9457b858410ae47208de4ab6e5954dd04a49 +generated: "2023-10-03T02:34:00.982031261+02:00" diff --git a/charts/zaakbrug/Chart.yaml b/charts/zaakbrug/Chart.yaml index 3298cc1..28c77a7 100644 --- a/charts/zaakbrug/Chart.yaml +++ b/charts/zaakbrug/Chart.yaml @@ -4,11 +4,11 @@ description: A Helm chart for running ZaakBrug on Kubernetes name: zaakbrug icon: https://raw.githubusercontent.com/wearefrank/charts/master/charts/zaakbrug/icon.png type: application -version: 2.0.10 +version: 2.0.11 dependencies: - name: ff-common - version: ~0.1.14 + version: ~0.1.15 repository: https://ibissource.github.io/charts/ - name: openzaak alias: staging diff --git a/charts/zaakbrug/README.md b/charts/zaakbrug/README.md index 87ff80d..c224de5 100644 --- a/charts/zaakbrug/README.md +++ b/charts/zaakbrug/README.md @@ -54,7 +54,9 @@ helm delete zaakbrug | Name | Description | Value | | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | ------- | -| `frank.memory` | Sets the initial and maximum size of the heap that will be used by the Frank!Framework | `4G` | +| `frank.memory.percentage` | Set if the values for the memory are in percentages | `false` | +| `frank.memory.minimum` | Sets the initial size of the heap that will be used by the Frank!Framework | `4G` | +| `frank.memory.maximum` | Sets the maximum size of the heap that will be used by the Frank!Framework | `4G` | | `frank.dtap.stage` | (Required) Set the `DTAP` stage. Options: `LOC`, `DEV`, `TST`, `ACC`, `PRD` | `""` | | `frank.dtap.side` | Set the `DTAP` side of where the instance is running | `""` | | `frank.credentials.secret` | Set the secret name of the existing secret | `""` | @@ -298,6 +300,10 @@ For more information about DTAP stages read: https://frank-manual.readthedocs.io ## Notable changes +### 2.0.11 + +The `.Values.frank.memory` notation has been changed. It is now possible to define a minimum and a maximum, and to set percentages. + ### 2.0.10 The `.Values.frank.dtap.stage` and `.Values.frank.dtap.side` are now empty by default. diff --git a/charts/zaakbrug/templates/configmap.zaakbrug.env.yaml b/charts/zaakbrug/templates/configmap.zaakbrug.env.yaml index 0a22f80..9619e4b 100644 --- a/charts/zaakbrug/templates/configmap.zaakbrug.env.yaml +++ b/charts/zaakbrug/templates/configmap.zaakbrug.env.yaml @@ -1,8 +1,5 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "ff-common.fullname" . }}-zaakbrug-env - labels: - {{- include "ff-common.labels" . | nindent 4 }} +{{- template "ff-common.configmap.env" (list . "zaakbrug.configmap.env") -}} +{{- define "zaakbrug.configmap.env" -}} data: - zaakbrug.zds.timezone: "{{ .Values.zaakbrug.zds.timezone | default "UTC" }}" \ No newline at end of file + zaakbrug.zds.timezone: "{{ .Values.zaakbrug.zds.timezone | default "UTC" }}" +{{- end -}} \ No newline at end of file diff --git a/charts/zaakbrug/templates/deployment.yaml b/charts/zaakbrug/templates/deployment.yaml index 5fbef9d..9d548c5 100644 --- a/charts/zaakbrug/templates/deployment.yaml +++ b/charts/zaakbrug/templates/deployment.yaml @@ -1,11 +1,11 @@ -{{- template "ff-common.deployment" (list . "ff-test.deployment") -}} -{{- define "ff-test.deployment" -}} +{{- template "ff-common.deployment" (list . "zaakbrug.deployment") -}} +{{- define "zaakbrug.deployment" -}} spec: template: spec: containers: - - {{ include "ff-common.container" (list . "ff-test.deployment.container") | nindent 10}} + {{ include "ff-common.container" (list . "zaakbrug.deployment.container") | nindent 10}} volumes: {{- if .Values.securityContext.readOnlyRootFilesystem }} - name: tmpfs @@ -42,12 +42,10 @@ spec: name: {{ template "ff-common.fullname" . }}-profiles {{- end -}} {{- end -}} -{{- define "ff-test.deployment.container" -}} +{{- define "zaakbrug.deployment.container" -}} envFrom: - configMapRef: name: {{ template "ff-common.fullname" . }}-env - - configMapRef: - name: {{ template "ff-common.fullname" . }}-zaakbrug-env - configMapRef: name: {{ template "ff-common.fullname" . }}-specifics volumeMounts: diff --git a/charts/zaakbrug/templates/manifest.yaml b/charts/zaakbrug/templates/manifest.yaml index 8004314..786b8fd 100644 --- a/charts/zaakbrug/templates/manifest.yaml +++ b/charts/zaakbrug/templates/manifest.yaml @@ -1,6 +1,6 @@ {{ template "ff-common.configmap.context.tpl" . }} --- -{{ template "ff-common.configmap.env.tpl" . }} +{{/*{{ template "ff-common.configmap.env.tpl" . }}*/}} --- {{ template "ff-common.configmap.tomcat-users.tpl" . }} --- diff --git a/charts/zaakbrug/values.schema.json b/charts/zaakbrug/values.schema.json index 7f3fa25..392ae8d 100644 --- a/charts/zaakbrug/values.schema.json +++ b/charts/zaakbrug/values.schema.json @@ -47,9 +47,24 @@ "type": "object", "properties": { "memory": { - "type": "string", - "description": "Sets the initial and maximum size of the heap that will be used by the Frank!Framework", - "default": "4G" + "type": "object", + "properties": { + "percentage": { + "type": "boolean", + "description": "Set if the values for the memory are in percentages", + "default": false + }, + "minimum": { + "type": "string", + "description": "Sets the initial size of the heap that will be used by the Frank!Framework", + "default": "4G" + }, + "maximum": { + "type": "string", + "description": "Sets the maximum size of the heap that will be used by the Frank!Framework", + "default": "4G" + } + } }, "dtap": { "type": "object", diff --git a/charts/zaakbrug/values.yaml b/charts/zaakbrug/values.yaml index 8adf6c6..b3474df 100644 --- a/charts/zaakbrug/values.yaml +++ b/charts/zaakbrug/values.yaml @@ -43,10 +43,17 @@ image: ## @skip frank [object] ## frank: - ## @param frank.memory Sets the initial and maximum size of the heap that will be used by the Frank!Framework + ## @param frank.memory.percentage Set if the values for the memory are in percentages + ## @param frank.memory.minimum Sets the initial size of the heap that will be used by the Frank!Framework + ## @param frank.memory.maximum Sets the maximum size of the heap that will be used by the Frank!Framework + ## For Java 8 it is best suited to use the same amount of memory for both the minimum and maximum. + ## For Java 11 and above, it is possible to use percentages. E.g. minimum: 20.0, maximum: 80.0. ## ref: https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BABDJJFI ## - memory: 4G + memory: + percentage: false + minimum: 4G + maximum: 4G ## @skip frank.dtap [object] ## @param frank.dtap.stage (Required) Set the `DTAP` stage. Options: `LOC`, `DEV`, `TST`, `ACC`, `PRD` ## @param frank.dtap.side Set the `DTAP` side of where the instance is running