Skip to content

Commit

Permalink
feat: make it possible to use percentages for memory
Browse files Browse the repository at this point in the history
  • Loading branch information
philipsens committed Oct 3, 2023
1 parent b34df76 commit 3bf9971
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 25 deletions.
6 changes: 3 additions & 3 deletions charts/zaakbrug/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions charts/zaakbrug/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion charts/zaakbrug/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `""` |
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 4 additions & 7 deletions charts/zaakbrug/templates/configmap.zaakbrug.env.yaml
Original file line number Diff line number Diff line change
@@ -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" }}"
zaakbrug.zds.timezone: "{{ .Values.zaakbrug.zds.timezone | default "UTC" }}"
{{- end -}}
10 changes: 4 additions & 6 deletions charts/zaakbrug/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/zaakbrug/templates/manifest.yaml
Original file line number Diff line number Diff line change
@@ -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" . }}
---
Expand Down
21 changes: 18 additions & 3 deletions charts/zaakbrug/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions charts/zaakbrug/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3bf9971

Please sign in to comment.