diff --git a/README.md b/README.md index 63a4743..7e454c2 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/templates/analytics/analytics-deployment.yaml b/templates/analytics/analytics-deployment.yaml index ef3c73c..d049d3a 100644 --- a/templates/analytics/analytics-deployment.yaml +++ b/templates/analytics/analytics-deployment.yaml @@ -52,6 +52,8 @@ spec: port: 8080 failureThreshold: 5 periodSeconds: 10 + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/cas/cas-deployment.yaml b/templates/cas/cas-deployment.yaml index 3bd4f99..dfca238 100644 --- a/templates/cas/cas-deployment.yaml +++ b/templates/cas/cas-deployment.yaml @@ -54,6 +54,8 @@ spec: port: 8080 failureThreshold: 5 periodSeconds: 60 + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/console/console-deployment.yaml b/templates/console/console-deployment.yaml index 915838e..3956bed 100644 --- a/templates/console/console-deployment.yaml +++ b/templates/console/console-deployment.yaml @@ -61,6 +61,8 @@ spec: lifecycle: {{- toYaml . | nindent 10 }} {{- end }} + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/datafeeder/datafeeder-deployment.yaml b/templates/datafeeder/datafeeder-deployment.yaml index 83a709e..479d493 100644 --- a/templates/datafeeder/datafeeder-deployment.yaml +++ b/templates/datafeeder/datafeeder-deployment.yaml @@ -111,6 +111,8 @@ spec: port: http-proxy periodSeconds: 10 initialDelaySeconds: 20 + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/datafeeder/import-deployment.yaml b/templates/datafeeder/import-deployment.yaml index c989ee8..43405a6 100644 --- a/templates/datafeeder/import-deployment.yaml +++ b/templates/datafeeder/import-deployment.yaml @@ -56,6 +56,8 @@ spec: volumeMounts: - mountPath: /etc/georchestra name: georchestra-datadir + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/gateway/gateway-deployment.yaml b/templates/gateway/gateway-deployment.yaml index 013db63..7c92ca6 100644 --- a/templates/gateway/gateway-deployment.yaml +++ b/templates/gateway/gateway-deployment.yaml @@ -61,6 +61,8 @@ spec: port: 8080 failureThreshold: 5 periodSeconds: 15 + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/geonetwork/elasticsearch/es-deployment.yaml b/templates/geonetwork/elasticsearch/es-deployment.yaml index 6cf0c03..89d94c9 100644 --- a/templates/geonetwork/elasticsearch/es-deployment.yaml +++ b/templates/geonetwork/elasticsearch/es-deployment.yaml @@ -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: diff --git a/templates/geonetwork/geonetwork-deployment.yaml b/templates/geonetwork/geonetwork-deployment.yaml index 88f70b4..e05b5da 100644 --- a/templates/geonetwork/geonetwork-deployment.yaml +++ b/templates/geonetwork/geonetwork-deployment.yaml @@ -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 diff --git a/templates/geonetwork/housekeeping/clean-harvester-logs.yaml b/templates/geonetwork/housekeeping/clean-harvester-logs.yaml index 8c382c3..7a5e483 100644 --- a/templates/geonetwork/housekeeping/clean-harvester-logs.yaml +++ b/templates/geonetwork/housekeeping/clean-harvester-logs.yaml @@ -29,6 +29,8 @@ spec: volumeMounts: - mountPath: /mnt/geonetwork_datadir name: geonetwork-datadir + resources: + {{- toYaml $webapp.resources | nindent 14 }} volumes: - name: geonetwork-datadir persistentVolumeClaim: @@ -36,6 +38,6 @@ spec: restartPolicy: OnFailure {{- if $webapp.housekeeping.tolerations }} tolerations: - {{- $webapp.housekeeping.tolerations | toYaml | nindent 10}} + {{- $webapp.housekeeping.tolerations | toYaml | nindent 12}} {{- end }} {{- end -}} diff --git a/templates/geonetwork/kibana/kibana-deployment.yaml b/templates/geonetwork/kibana/kibana-deployment.yaml index 25b2748..a74d78f 100644 --- a/templates/geonetwork/kibana/kibana-deployment.yaml +++ b/templates/geonetwork/kibana/kibana-deployment.yaml @@ -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: diff --git a/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml b/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml index bedd1ab..150797b 100644 --- a/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml +++ b/templates/geonetwork/ogc-api-records/ogc-api-records-deployment.yaml @@ -77,6 +77,8 @@ spec: volumeMounts: - mountPath: /etc/georchestra name: georchestra-datadir + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/geoserver/geoserver-deployment.yaml b/templates/geoserver/geoserver-deployment.yaml index 2bfed19..7c7fc75 100644 --- a/templates/geoserver/geoserver-deployment.yaml +++ b/templates/geoserver/geoserver-deployment.yaml @@ -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 diff --git a/templates/geowebcache/geowebcache-deployment.yaml b/templates/geowebcache/geowebcache-deployment.yaml index 61df4eb..c065641 100644 --- a/templates/geowebcache/geowebcache-deployment.yaml +++ b/templates/geowebcache/geowebcache-deployment.yaml @@ -87,6 +87,8 @@ spec: periodSeconds: 15 successThreshold: 1 timeoutSeconds: 1 + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/header/header-deployment.yaml b/templates/header/header-deployment.yaml index c0cd860..6a21345 100644 --- a/templates/header/header-deployment.yaml +++ b/templates/header/header-deployment.yaml @@ -64,6 +64,8 @@ spec: periodSeconds: 15 successThreshold: 1 timeoutSeconds: 1 + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/ldap/openldap-deployment.yaml b/templates/ldap/openldap-deployment.yaml index bff6b37..e8aa9e5 100644 --- a/templates/ldap/openldap-deployment.yaml +++ b/templates/ldap/openldap-deployment.yaml @@ -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 }} diff --git a/templates/mapstore/mapstore-deployment.yaml b/templates/mapstore/mapstore-deployment.yaml index 7684847..7f0d201 100644 --- a/templates/mapstore/mapstore-deployment.yaml +++ b/templates/mapstore/mapstore-deployment.yaml @@ -74,6 +74,8 @@ spec: port: 8080 failureThreshold: 5 periodSeconds: 15 + resources: + {{- toYaml $webapp.resources | nindent 10 }} volumes: - name: georchestra-datadir emptyDir: {} diff --git a/templates/security-proxy/security-proxy-deployment.yaml b/templates/security-proxy/security-proxy-deployment.yaml index 6eefd96..56e3bc3 100644 --- a/templates/security-proxy/security-proxy-deployment.yaml +++ b/templates/security-proxy/security-proxy-deployment.yaml @@ -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 diff --git a/templates/smtp-smarthost/smtp-deployment.yaml b/templates/smtp-smarthost/smtp-deployment.yaml index 7c0886c..5dfe405 100644 --- a/templates/smtp-smarthost/smtp-deployment.yaml +++ b/templates/smtp-smarthost/smtp-deployment.yaml @@ -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 }} diff --git a/values.yaml b/values.yaml index 6e748a5..7515253 100644 --- a/values.yaml +++ b/values.yaml @@ -22,6 +22,13 @@ georchestra: service: annotations: {} tolerations: [] + resources: + requests: + cpu: 500m + memory: 512Mi + limits: + cpu: 1000m + memory: 2Gi cas: enabled: true replicaCount: "1" @@ -31,6 +38,13 @@ georchestra: service: annotations: {} tolerations: [] + resources: + requests: + cpu: 1000m + memory: 2Gi + limits: + cpu: 2000m + memory: 4Gi console: enabled: true replicaCount: "1" @@ -41,6 +55,13 @@ georchestra: service: annotations: {} tolerations: [] + resources: + requests: + cpu: 500m + memory: 512Mi + limits: + cpu: 1000m + memory: 2Gi datafeeder: enabled: true # won't deploy if datafeeder_frontend is not enable replicaCount: "1" @@ -56,6 +77,13 @@ georchestra: service: annotations: {} tolerations: [] + resources: + requests: + cpu: 200m + memory: 512Mi + limits: + cpu: 500m + memory: 2Gi datafeeder_frontend: # Matches datafeeder/import-xxx.yaml templates in the helm chart enabled: true # won't deploy if datafeeder is not enable @@ -67,6 +95,13 @@ georchestra: service: annotations: {} tolerations: [] + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 200m + memory: 256Mi geonetwork: enabled: true replicaCount: "1" @@ -83,6 +118,13 @@ georchestra: # variable above. extra_volumeMounts: [] tolerations: [] + resources: + requests: + cpu: 2000m + memory: 2Gi + limits: + cpu: 4000m + memory: 4Gi ogc_api_records: enabled: true replicaCount: "1" @@ -93,29 +135,46 @@ georchestra: service: annotations: {} tolerations: [] - elasticsearch: - replicaCount: "1" resources: - limits: - memory: 5120Mi requests: - memory: 5120Mi + cpu: 100m + memory: 512Mi + limits: + cpu: 500m + memory: 1Gi + elasticsearch: + replicaCount: "1" image: docker.elastic.co/elasticsearch/elasticsearch:7.17.21 service: annotations: {} tolerations: [] + resources: + requests: + cpu: 1000m + memory: 3Gi + limits: + cpu: 2000m + memory: 6Gi kibana: replicaCount: "1" image: docker.elastic.co/kibana/kibana:7.15.1 service: annotations: {} tolerations: [] + resources: + requests: + cpu: 500m + memory: 1Gi + limits: + cpu: 1000m + memory: 2Gi # automatically clean some logs of geonetwork housekeeping: harvester_logs: enabled: false schedule: "0 1 * * *" tolerations: [] + resources: {} service: annotations: {} geoserver: @@ -135,6 +194,13 @@ georchestra: # registry_secret: default service: annotations: {} + resources: + requests: + cpu: 2000m + memory: 4Gi + limits: + cpu: 4000m + memory: 8Gi geowebcache: enabled: false replicaCount: "1" @@ -145,6 +211,13 @@ georchestra: tolerations: [] service: annotations: {} + resources: + requests: + cpu: 1000m + memory: 2Gi + limits: + cpu: 2000m + memory: 4Gi header: enabled: true replicaCount: "1" @@ -154,6 +227,13 @@ georchestra: # registry_secret: default service: annotations: {} + resources: + requests: + cpu: 200m + memory: 512Mi + limits: + cpu: 1000m + memory: 1Gi mapstore: enabled: true replicaCount: "1" @@ -167,6 +247,13 @@ georchestra: lifecycle: {} service: annotations: {} + resources: + requests: + cpu: 1000m + memory: 2Gi + limits: + cpu: 2000m + memory: 4Gi openldap: enabled: true replicaCount: "1" @@ -184,6 +271,13 @@ georchestra: service: annotations: {} tolerations: [] + resources: + requests: + cpu: 500m + memory: 2Gi + limits: + cpu: 1000m + memory: 4Gi proxy: enabled: false replicaCount: "1" @@ -196,6 +290,13 @@ georchestra: service: annotations: {} tolerations: [] + resources: + requests: + cpu: 2000m + memory: 2Gi + limits: + cpu: 4000m + memory: 4Gi gateway: enabled: true replicaCount: "1" @@ -206,6 +307,13 @@ georchestra: service: annotations: {} tolerations: [] + resources: + requests: + cpu: 2000m + memory: 2Gi + limits: + cpu: 4000m + memory: 4Gi datadir: volume: - name: georchestra-datadir @@ -263,6 +371,13 @@ georchestra: # relay_username: aaaa # relay_password: aaaa extra_environment: [] + resources: + requests: + cpu: 200m + memory: 128Mi + limits: + cpu: 500m + memory: 256Mi fqdn: "georchestra-127-0-1-1.traefik.me" @@ -347,6 +462,13 @@ database: initdb: username: georchestra password: georchestra + resources: + requests: + cpu: 2000m + memory: 4Gi + limits: + cpu: 4000m + memory: 8Gi geodata: auth: database: geodata