Fixes #10: Allow setting resources.requests.memory so Tower gets enough memory.

This commit is contained in:
Jeff Geerling
2019-11-25 17:02:32 -06:00
parent dfc5de5b8e
commit 3673a2b33a
5 changed files with 18 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ This environment is meant for headless testing (e.g. in a CI environment, or whe
#### Testing in Minikube
minikube start --memory 6g --cpus 2
minikube start --memory 6g --cpus 4
minikube addons enable ingress
molecule test -s test-minikube
@@ -130,7 +130,7 @@ Once the versions are updated, run the playbook in the `build/` directory:
After it is built, test it on a local cluster:
minikube start --memory 6g --cpus 2
minikube start --memory 6g --cpus 4
kubectl apply -f deploy/tower-operator.yaml
kubectl create namespace example-tower
kubectl apply -f deploy/crds/tower_v1alpha1_tower_cr_awx.yaml

View File

@@ -18,6 +18,12 @@ tower_create_preload_data: true
tower_task_replicas: "1"
tower_task_mem_request: 1Gi
tower_task_cpu_request: 500m
tower_web_mem_request: 2Gi
tower_web_cpu_request: 1000m
tower_memcached_image: memcached:alpine
tower_rabbitmq_image: rabbitmq:3

View File

@@ -8,7 +8,7 @@
- tower_postgres.yaml.j2
- tower_rabbitmq.yaml.j2
- tower_config.yaml.j2
- tower.yaml.j2
- tower_web.yaml.j2
- tower_task.yaml.j2
- name: Get the Tower pod information.

View File

@@ -42,6 +42,10 @@ spec:
mountPath: /etc/tower/settings.py
subPath: settings.py
readOnly: true
resources:
requests:
memory: '{{ tower_task_mem_request }}'
cpu: '{{ tower_task_cpu_request }}'
volumes:
- name: secret-key
secret:

View File

@@ -14,7 +14,7 @@ data:
apiVersion: apps/v1
kind: Deployment
metadata:
name: '{{ meta.name }}-tower'
name: '{{ meta.name }}-tower-web'
namespace: '{{ meta.namespace }}'
labels:
app: tower
@@ -50,6 +50,10 @@ spec:
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
resources:
requests:
memory: '{{ tower_web_mem_request }}'
cpu: '{{ tower_web_cpu_request }}'
volumes:
- name: secret-key
secret: