Implement container-cluster aware capacity determination

* Added two settings values for declaring absolute cpu and memory
  capacity that will be picked up by the capacity utility methods
* installer inventory variables for controlling the amount of cpu and
  memory container requests/limits for the awx task containers
* Added fixed values for cpu and memory container requests for other
  containers
* configmap uses the declared inventory variables to define the
  capacity inputs that will be used by AWX to correspond to the same
  inputs for requests/limits on the deployment.
This commit is contained in:
Matthew Jones
2018-03-14 13:03:55 -04:00
parent 5eed816c4d
commit b0cf4de072
6 changed files with 88 additions and 16 deletions

View File

@@ -16,6 +16,9 @@ data:
# Automatically deprovision pods that go offline
AWX_AUTO_DEPROVISION_INSTANCES = True
SYSTEM_TASK_ABS_CPU = {{ ((awx_task_cpu_request|default(1500) / 1000) * 4)|int }}
SYSTEM_TASK_ABS_MEM = {{ ((awx_task_mem_request|default(2) * 1024) / 100)|int }}
#Autoprovisioning should replace this
CLUSTER_HOST_ID = socket.gethostname()
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'

View File

@@ -21,6 +21,10 @@ spec:
volumeMounts:
- mountPath: /etc/tower
name: awx-application-config
resources:
requests:
memory: "1Gi"
cpu: "500m"
- name: awx-celery
image: {{ awx_task_openshift_image }}
imagePullPolicy: Always
@@ -46,6 +50,13 @@ spec:
value: {{ default_admin_user|default('admin') }}
- name: AWX_ADMIN_PASSWORD
value: {{ default_admin_password|default('password') }}
resources:
requests:
memory: "{{ awx_task_cpu_request|default('2') }}Gi"
cpu: "{{ awx_task_mem_request|default('1500') }}m"
limit:
memory: "{{ awx_task_cpu_request|default('2') }}Gi"
cpu: "{{ awx_task_mem_request|default('1500') }}m"
- name: awx-rabbit
image: ansible/awx_rabbitmq:{{ rabbitmq_version }}
imagePullPolicy: Always
@@ -81,8 +92,16 @@ spec:
value: "awx"
- name: RABBITMQ_CONFIG_FILE
value: "/etc/rabbitmq/rabbitmq"
resources:
requests:
memory: "2Gi"
cpu: "500m"
- name: awx-memcached
image: memcached
resources:
requests:
memory: "1Gi"
cpu: "500m"
volumes:
- name: awx-application-config
configMap: