Skip to content

Commit

Permalink
Merge pull request #54 from alchemy-fr/PS-702_resources_limits
Browse files Browse the repository at this point in the history
PS-702 Pod Replicas and resources definition WIP
  • Loading branch information
nmaillat authored Feb 11, 2025
2 parents 31a2e62 + 717d5c2 commit 4b95a59
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 5 deletions.
4 changes: 2 additions & 2 deletions charts/phrasea/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ 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.
version: 2.6.0
version: 2.7.0-alpha1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 1.17.0
appVersion: 3.6.0-alpha

dependencies:
- name: elasticsearch
Expand Down
2 changes: 1 addition & 1 deletion charts/phrasea/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ stack:
Restore stack:
If you are porgresql service is enabled, you need to disable migrations so ot will start the pod.
If your PostgreSQL service is enabled, you will need to disable migrations for the pod to start.
Change the:
Expand Down
11 changes: 10 additions & 1 deletion charts/phrasea/templates/api-php-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kind: Deployment
metadata:
name: {{ $appName }}-api-php
spec:
replicas: 1
replicas: {{(index $.Values $appName).api.replicas}}
selector:
matchLabels:
app: phrasea
Expand All @@ -32,6 +32,15 @@ spec:
- name: {{ $appName }}-api-php
image: {{ $.Values.repository.baseurl }}/ps-{{ $appName }}-api-php:{{ $.Values.repository.tag }}
imagePullPolicy: {{ $.Values.repository.imagePullPolicy }}
{{- if (index $.Values $appName).resourcesquota }}
resources:
requests:
memory: {{(index $.Values $appName).api.resources.requests.memory}}
cpu: {{(index $.Values $appName).api.resources.requests.cpu}}
limits:
memory: {{(index $.Values $appName).api.resources.limits.memory}}
cpu: {{(index $.Values $appName).api.resources.limits.cpu}}
{{- end }}
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- name: configs
Expand Down
11 changes: 10 additions & 1 deletion charts/phrasea/templates/worker-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kind: Deployment
metadata:
name: {{ $appName }}-worker
spec:
replicas: 1
replicas: {{(index $.Values $appName).worker.replicas }}
selector:
matchLabels:
app: phrasea
Expand All @@ -30,6 +30,15 @@ spec:
- name: {{ $appName }}-worker
image: {{ $.Values.repository.baseurl }}/ps-{{ $appName }}-worker:{{ $.Values.repository.tag }}
imagePullPolicy: {{ $.Values.repository.imagePullPolicy }}
{{- if (index $.Values $appName).resourcesquotas }}
resources:
requests:
memory: {{(index $.Values $appName).worker.resources.requests.memory}}
cpu: {{(index $.Values $appName).worker.resources.requests.cpu}}
limits:
memory: {{(index $.Values $appName).worker.resources.limits.memory}}
cpu: {{(index $.Values $appName).worker.resources.limits.cpu}}
{{- end }}
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- name: configs
Expand Down
66 changes: 66 additions & 0 deletions charts/phrasea/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ novu:
databox:
enabled: true
api:
replicas: 1
ingress:
enabled: true
annotations:
Expand All @@ -106,6 +107,14 @@ databox:
tls: []
hostname:
baseUrl:
ressourcesquota: false
resources:
requests:
cpu: "50m"
memory: "256Mi"
limits:
cpu: "2000m"
memory: "2048Mi"
config:
requestSignatureTtl: 86400
s3Storage:
Expand Down Expand Up @@ -147,6 +156,16 @@ databox:
tls: []
oauthClient:
id: databox-app
worker:
replicas: 1
ressourcesquota: false
resources:
requests:
cpu: "50m"
memory: "256Mi"
limits:
cpu: "2000m"
memory: "2048Mi"
rabbitmq:
vhost: databox
database:
Expand Down Expand Up @@ -174,6 +193,7 @@ expose:
enabled: false
schedule: '30 5 * * *'
api:
replicas: 1
subnet: 0.0.0.0/0
ingress:
enabled: true
Expand All @@ -185,6 +205,14 @@ expose:
tls: []
hostname:
baseUrl:
ressourcesquota: false
resources:
requests:
cpu: "50m"
memory: "256Mi"
limits:
cpu: "2000m"
memory: "2048Mi"
config:
requestSignatureTtl: 86400
s3Storage:
Expand Down Expand Up @@ -213,6 +241,16 @@ expose:
externalSecretName:
id: expose-admin
secret: '__CHANGE_ME_71EuDQ2H$ei3sHwIB0sfy'
worker:
replicas: 1
ressourcesquota: false
resources:
requests:
cpu: "50m"
memory: "256Mi"
limits:
cpu: "2000m"
memory: "2048Mi"
client:
hostname:
baseUrl:
Expand Down Expand Up @@ -242,6 +280,7 @@ expose:
uploader:
enabled: true
api:
replicas: 1
ingress:
enabled: true
annotations:
Expand All @@ -252,6 +291,14 @@ uploader:
tls: []
hostname:
baseUrl:
ressourcesquota: false
resources:
requests:
cpu: "50m"
memory: "256Mi"
limits:
cpu: "2000m"
memory: "2048Mi"
config:
deleteAssetGracefulTime: 0
assetConsumerCommitUri:
Expand All @@ -274,8 +321,19 @@ uploader:
externalSecretName:
id: uploader-admin
secret: '__CHANGE_ME_p@P@CSnZi3sHwIB0sfy'
worker:
replicas: 1
ressourcesquota: false
resources:
requests:
cpu: "50m"
memory: "256Mi"
limits:
cpu: "2000m"
memory: "2048Mi"
client:
hostname:
baseUrl:
ingress:
enabled: true
annotations: {}
Expand All @@ -298,6 +356,14 @@ report:
api:
hostname: report-api
baseUrl: http://report-api
ressourcesquota: false
resources:
requests:
cpu: "50m"
memory: "256Mi"
limits:
cpu: "2000m"
memory: "2048Mi"
databaseName: report
createDatabase: true

Expand Down

0 comments on commit 4b95a59

Please sign in to comment.