Skip to content

Commit

Permalink
RHCLOUD-34086 Configure CPU and Memory requests as variables (#404)
Browse files Browse the repository at this point in the history
* Configure cpu and memory requests as variables in clowdapp
* Set CPU and Memory vars in event-consumer deployment
* name vars in singular case
* Define different vars for each deployment

---------

Co-authored-by: dehort <[email protected]>
  • Loading branch information
Fynardo and dehort authored Oct 21, 2024
1 parent 3c237ff commit a7c5bdd
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 26 deletions.
48 changes: 34 additions & 14 deletions deploy/clowdapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ objects:

resources:
limits:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
cpu: ${API_CPU_LIMIT}
memory: ${API_MEMORY_LIMIT}
requests:
cpu: 250m
memory: 256Mi
cpu: ${API_CPU_REQUEST}
memory: ${API_MEMORY_REQUEST}

- name: response-consumer
minReplicas: ${{REPLICAS_RESPONSE_CONSUMER}}
Expand Down Expand Up @@ -226,11 +226,11 @@ objects:
value: ${DB_SSLMODE}
resources:
limits:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
cpu: ${RESPONSE_CONSUMER_CPU_LIMIT}
memory: ${RESPONSE_CONSUMER_MEMORY_LIMIT}
requests:
cpu: 250m
memory: 256Mi
cpu: ${RESPONSE_CONSUMER_CPU_REQUEST}
memory: ${RESPONSE_CONSUMER_MEMORY_REQUEST}

- name: validator
minReplicas: ${{REPLICAS_VALIDATOR}}
Expand Down Expand Up @@ -273,11 +273,11 @@ objects:
value: ${BLOCKLIST_ORG_IDS}
resources:
limits:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
cpu: ${VALIDATOR_CPU_LIMIT}
memory: ${VALIDATOR_MEMORY_LIMIT}
requests:
cpu: 250m
memory: 256Mi
cpu: ${VALIDATOR_CPU_REQUEST}
memory: ${VALIDATOR_MEMORY_REQUEST}

jobs:
- name: cleaner
Expand Down Expand Up @@ -312,10 +312,30 @@ parameters:

- name: LOG_LEVEL
value: INFO
- name: CPU_LIMIT
- name: API_CPU_LIMIT
value: 500m
- name: MEMORY_LIMIT
- name: API_CPU_REQUEST
value: 250m
- name: API_MEMORY_LIMIT
value: 512Mi
- name: API_MEMORY_REQUEST
value: 256Mi
- name: RESPONSE_CONSUMER_CPU_LIMIT
value: 500m
- name: RESPONSE_CONSUMER_CPU_REQUEST
value: 250m
- name: RESPONSE_CONSUMER_MEMORY_LIMIT
value: 512Mi
- name: RESPONSE_CONSUMER_MEMORY_REQUEST
value: 256Mi
- name: VALIDATOR_CPU_LIMIT
value: 500m
- name: VALIDATOR_CPU_REQUEST
value: 250m
- name: VALIDATOR_MEMORY_LIMIT
value: 512Mi
- name: VALIDATOR_MEMORY_REQUEST
value: 256Mi

- name: REPLICAS_API
value: "3"
Expand Down
32 changes: 20 additions & 12 deletions deploy/connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,22 @@ parameters:
value: '1'
- name: VERSION
value: '2.7.1'
- name: CPU_REQUESTS
- name: CPU_REQUEST
value: 500m
- name: CPU_LIMITS
- name: CPU_LIMIT
value: '1'
- name: MEMORY_REQUESTS
- name: MEMORY_REQUEST
value: 2Gi
- name: MEMORY_LIMITS
- name: MEMORY_LIMIT
value: 4Gi
- name: EVENT_CONSUMER_CPU_REQUEST
value: 100m
- name: EVENT_CONSUMER_CPU_LIMIT
value: 200m
- name: EVENT_CONSUMER_MEMORY_REQUEST
value: 128Mi
- name: EVENT_CONSUMER_MEMORY_LIMIT
value: 256Mi
- name: XMX
value: 4G
- name: XMS
Expand Down Expand Up @@ -187,11 +195,11 @@ objects:
replicas: ${{NUM_REPLICAS}}
resources:
limits:
cpu: ${CPU_LIMITS}
memory: ${MEMORY_LIMITS}
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
requests:
cpu: ${CPU_REQUESTS}
memory: ${MEMORY_REQUESTS}
cpu: ${CPU_REQUEST}
memory: ${MEMORY_REQUEST}
jvmOptions:
"-Xmx": ${XMX}
"-Xms": ${XMS}
Expand Down Expand Up @@ -336,11 +344,11 @@ objects:
name: playbook-dispatcher-event-consumer
resources:
requests:
cpu: 100m
memory: 128Mi
cpu: ${EVENT_CONSUMER_CPU_REQUEST}
memory: ${EVENT_CONSUMER_MEMORY_REQUEST}
limits:
cpu: 200m
memory: 256Mi
cpu: ${EVENT_CONSUMER_CPU_LIMIT}
memory: ${EVENT_CONSUMER_MEMORY_LIMIT}

# this service is only used in ephemeral to give the ephemeral kafka a stable address
- apiVersion: v1
Expand Down

0 comments on commit a7c5bdd

Please sign in to comment.