Skip to content
Snippets Groups Projects
Commit af643535 authored by Pierre-Gilles LEVALLOIS's avatar Pierre-Gilles LEVALLOIS
Browse files

Resources Optimization

parent 274bbbcf
Branches
Tags
1 merge request!6Fully functional version that calculate layer with all stages
Pipeline #60691 canceled
...@@ -252,8 +252,8 @@ Build Calqul Git-lfs: ...@@ -252,8 +252,8 @@ Build Calqul Git-lfs:
variables: variables:
CALQUL_ACTION: "compute-factors" CALQUL_ACTION: "compute-factors"
MEM_REQUEST: "2000Mi" MEM_REQUEST: "2000Mi"
CPU_REQUEST: "1500m" CPU_REQUEST: "2000m"
MEM_LIMIT: "2000Mi" MEM_LIMIT: "4000Mi"
CPU_LIMIT: "2000m" CPU_LIMIT: "2000m"
4. Compute Indices: 4. Compute Indices:
......
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: calqul-db-__NAMESPACE_ENV__ name: calqul-db-__NAMESPACE_ENV__
namespace: __NAMESPACE__ namespace: __NAMESPACE__
labels: labels:
apps: calqul-db-__NAMESPACE_ENV__ apps: calqul-db-__NAMESPACE_ENV__
spec: spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: calqul-db-__NAMESPACE_ENV__ app: calqul-db-__NAMESPACE_ENV__
role: primary role: primary
tier: database tier: database
template: template:
metadata: metadata:
labels: labels:
app: calqul-db-__NAMESPACE_ENV__ app: calqul-db-__NAMESPACE_ENV__
role: primary role: primary
tier: database tier: database
spec: spec:
imagePullSecrets: imagePullSecrets:
- name: forge-secret - name: forge-secret
volumes: volumes:
- name: arb-data - name: arb-data
persistentVolumeClaim: persistentVolumeClaim:
claimName: pvc-01-__NAMESPACE__-claim claimName: pvc-01-__NAMESPACE__-claim
containers: containers:
- name: calqul-db-__NAMESPACE_ENV__ - name: calqul-db-__NAMESPACE_ENV__
image: registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-db-__NAMESPACE_ENV__ image: registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-db-__NAMESPACE_ENV__
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 5432 - containerPort: 5432
protocol: TCP protocol: TCP
readinessProbe: readinessProbe:
tcpSocket: tcpSocket:
port: 5432 port: 5432
initialDelaySeconds: 15 initialDelaySeconds: 15
periodSeconds: 10 periodSeconds: 10
livenessProbe: livenessProbe:
tcpSocket: tcpSocket:
port: 5432 port: 5432
initialDelaySeconds: 15 initialDelaySeconds: 15
periodSeconds: 20 periodSeconds: 20
resources: resources:
limits: limits:
cpu: 400m cpu: 400m
memory: 500Mi memory: 500Mi
requests: requests:
cpu: 200m cpu: 400m
memory: 256Mi memory: 500Mi
env: env:
- name: POSTGRES_DB - name: POSTGRES_DB
value: "__POSTGRES_DB__" value: "__POSTGRES_DB__"
- name: POSTGRES_PASSWORD - name: POSTGRES_PASSWORD
value: "__POSTGRES_PASSWORD__" value: "__POSTGRES_PASSWORD__"
- name: POSTGRES_PORT - name: POSTGRES_PORT
value: "__POSTGRES_PORT__" value: "__POSTGRES_PORT__"
- name: POSTGRES_SERVER - name: POSTGRES_SERVER
value: "__POSTGRES_SERVER__" value: "__POSTGRES_SERVER__"
- name: POSTGRES_USER - name: POSTGRES_USER
value: "__POSTGRES_USER__" value: "__POSTGRES_USER__"
- name: POSTGRES_SCHEMA - name: POSTGRES_SCHEMA
value: "__POSTGRES_SCHEMA__" value: "__POSTGRES_SCHEMA__"
# need to define PGDATA env var because not using the default /var/lib/postgresql/data, but a subpath under it. # need to define PGDATA env var because not using the default /var/lib/postgresql/data, but a subpath under it.
- name: PGDATA - name: PGDATA
value: /arb-data/pgdata value: /arb-data/pgdata
volumeMounts: volumeMounts:
# need a subpath as postgres wants an empty folder (the mounted folder `$PGDATA` has a `lost+found` directory) # need a subpath as postgres wants an empty folder (the mounted folder `$PGDATA` has a `lost+found` directory)
# see https://stackoverflow.com/questions/51168558/how-to-mount-a-postgresql-volume-using-aws-ebs-in-kubernete # see https://stackoverflow.com/questions/51168558/how-to-mount-a-postgresql-volume-using-aws-ebs-in-kubernete
- name: arb-data - name: arb-data
mountPath: "/arb-data" mountPath: "/arb-data"
subpath: pgdata subpath: pgdata
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment