Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resources requests and limits management #127

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,51 @@ every deployments which are making use of Persistent volumes:
* geoserver
* mapstore
* openldap

# Resources allocations and limits

The requested and limits to allocated CPU and RAM is configurable in the `values.yaml` file for each component.

You can configure it with the availables `resources` parameter :

```
resources:
limits:
cpu: 2000m
memory: 4Gi
requests:
cpu: 1000m
memory: 2Gi
```

This config will request 1 CPU and 2Gi RAM to launch and limits consumption to 2 CPU and 4Gi RAM.

Bellow are default configs, they were determined for a test environment (request) and are limited (limits) to what an average production environment might require :

| | CPU - Requests | CPU - Limits | RAM - Requests | RAM - Limits |
| ------------------- | -------------- | ------------- | -------------- | ------------ |
| analytics | 500 | 1000 | 512Mi | 2Gi |
| cas | 1000 | 2000 | 2Gi | 4Gi |
| console | 500 | 1000 | 512Mi | 2Gi |
| datafeeder | 200 | 500 | 512Mi | 2Gi |
| datafeeder-frontend | 100 | 200 | 128Mi | 256Mi |
| geonetwork | 2000 | 4000 | 2Gi | 4Gi |
| ogc-api-records | 100 | 500 | 512Mi | 1Gi |
| elasticsearch | 1000 | 2000 | 3Gi | 6Gi |
| kibana | 500 | 1000 | 1Gi | 2Gi |
| housekeeping | 100 | 200 | 8Mi | 8Mi |
| geoserver | 2000 | 4000 | 4Gi | 8Gi |
| geowebcache | 1000 | 2000 | 2Gi | 4Gi |
| header | 200 | 1000 | 512Mi | 1Gi |
| mapstore | 1000 | 2000 | 2Gi | 4Gi |
| openldap | 500 | 1000 | 2Gi | 4Gi |
| proxy | 2000 | 4000 | 2Gi | 4Gi |
| gateway | 2000 | 4000 | 2Gi | 4Gi |
| database (PG) | 2000 | 4000 | 4Gi | 8Gi |
| smtp | 200 | 500 | 128Mi | 256Mi |

Feel free to suggest modifications based on your use cases.

***/!\ Important /!\ :*** Default values are for testing purposes !

It _should_ work for an average production, but for production use, you are strongly advised to document yourself on how to estimate resource consumption based on your data and platform traffic.
2 changes: 2 additions & 0 deletions templates/analytics/analytics-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ spec:
port: 8080
failureThreshold: 5
periodSeconds: 10
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/cas/cas-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ spec:
port: 8080
failureThreshold: 5
periodSeconds: 60
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/console/console-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ spec:
lifecycle:
{{- toYaml . | nindent 10 }}
{{- end }}
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/datafeeder/datafeeder-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ spec:
port: http-proxy
periodSeconds: 10
initialDelaySeconds: 20
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/datafeeder/import-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
volumeMounts:
- mountPath: /etc/georchestra
name: georchestra-datadir
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/gateway/gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ spec:
port: 8080
failureThreshold: 5
periodSeconds: 15
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
4 changes: 2 additions & 2 deletions templates/geonetwork/elasticsearch/es-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ spec:
value: -Dlog4j2.formatMsgNoLookups=true -Dlog4j2.disable.jmx=true
- name: discovery.type
value: single-node
resources:
{{- toYaml $webapp.resources | nindent 12 }}
ports:
- containerPort: 9200
name: elastic
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: gn4-es-data
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: gn4-es-data
persistentVolumeClaim:
Expand Down
2 changes: 2 additions & 0 deletions templates/geonetwork/geonetwork-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ spec:
port: 8080
failureThreshold: 5
periodSeconds: 50
resources:
{{- toYaml $webapp.resources | nindent 10 }}
{{- if $webapp.jetty_monitoring }}
- name: jmx-collectd
image: camptocamp/jmx-collectd:bookworm
Expand Down
4 changes: 3 additions & 1 deletion templates/geonetwork/housekeeping/clean-harvester-logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ spec:
volumeMounts:
- mountPath: /mnt/geonetwork_datadir
name: geonetwork-datadir
resources:
{{- toYaml $webapp.resources | nindent 14 }}
volumes:
- name: geonetwork-datadir
persistentVolumeClaim:
claimName: {{ include "georchestra.fullname" . }}-geonetwork-datadir
restartPolicy: OnFailure
{{- if $webapp.housekeeping.tolerations }}
tolerations:
{{- $webapp.housekeeping.tolerations | toYaml | nindent 10}}
{{- $webapp.housekeeping.tolerations | toYaml | nindent 12}}
{{- end }}
{{- end -}}
2 changes: 2 additions & 0 deletions templates/geonetwork/kibana/kibana-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
volumeMounts:
- mountPath: /usr/share/kibana/config
name: gn4-kibana-config
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: gn4-kibana-config
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ spec:
volumeMounts:
- mountPath: /etc/georchestra
name: georchestra-datadir
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/geoserver/geoserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ spec:
port: 8080
failureThreshold: 5
periodSeconds: 40
resources:
{{- toYaml $webapp.resources | nindent 10 }}
{{- if $webapp.jetty_monitoring }}
- name: jmx-collectd
image: camptocamp/jmx-collectd:bookworm
Expand Down
2 changes: 2 additions & 0 deletions templates/geowebcache/geowebcache-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ spec:
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 1
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/header/header-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ spec:
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 1
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/ldap/openldap-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ spec:
- -b{{ .Values.ldap.baseDn }}
- {{ .Values.ldap.adminDn }}
initialDelaySeconds: 30
resources:
{{- toYaml $webapp.resources | nindent 10 }}
{{- if $webapp.extraContainers }}
{{ toYaml $webapp.extraContainers | nindent 6 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions templates/mapstore/mapstore-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ spec:
port: 8080
failureThreshold: 5
periodSeconds: 15
resources:
{{- toYaml $webapp.resources | nindent 10 }}
volumes:
- name: georchestra-datadir
emptyDir: {}
Expand Down
2 changes: 2 additions & 0 deletions templates/security-proxy/security-proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ spec:
port: 8080
failureThreshold: 5
periodSeconds: 15
resources:
{{- toYaml $webapp.resources | nindent 10 }}
{{- if $webapp.jetty_monitoring }}
- name: jmx-collectd
image: camptocamp/jmx-collectd:bookworm
Expand Down
2 changes: 2 additions & 0 deletions templates/smtp-smarthost/smtp-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ spec:
tcpSocket:
port: smtp
initialDelaySeconds: 30
resources:
{{- toYaml $webapp.resources | nindent 10 }}
{{- if $webapp.tolerations }}
tolerations:
{{- $webapp.tolerations | toYaml | nindent 8 }}
Expand Down
Loading
Loading