From 125f956f062f4b9ec5471814973b3447487b0587 Mon Sep 17 00:00:00 2001 From: Leo Puvilland Date: Nov 16 2023 19:52:58 +0000 Subject: rework communishift to allow for per-project resource requirements --- diff --git a/inventory/group_vars/all b/inventory/group_vars/all index 78be216..8e3f99e 100644 --- a/inventory/group_vars/all +++ b/inventory/group_vars/all @@ -33,6 +33,26 @@ br0_nm: 255.255.255.0 br1_nm: 255.255.255.0 # assume collectd apache collectd_apache: true +# communishift project resource overrides +communishift_projects: + communishift-dev-test: + name: communishift-dev-test + communishift-fedora-review-service: + name: communishift-fedora-review-service + communishift-lightspeed-build: + name: communishift-lightspeed-build + communishift-log-detective: + name: communishift-log-detective + communishift-mattdm: + name: communishift-mattdm + communishift-openscanhub: + name: communishift-openscanhub + cpu_requests: 2 + memory_requests: 2Gi + cpu_limits: 2 + memory_limits: 4Gi + communishift-planet: + name: communishift-planet # true or false if we are or are not a copr build virthost. # Default to false copr_build_virthost: false diff --git a/playbooks/manual/communishift.yml b/playbooks/manual/communishift.yml index 0d22693..ecf8740 100644 --- a/playbooks/manual/communishift.yml +++ b/playbooks/manual/communishift.yml @@ -32,10 +32,7 @@ apply: tags: - create_efs - vars: - communishift_project_name: "{{ outer_item }}" - loop_control: - loop_var: outer_item + loop: "{{ lookup('dict', communishift_projects) }}" vars: communishift_package_list: - kubernetes diff --git a/roles/communishift/tasks/create-resource-quota.yml b/roles/communishift/tasks/create-resource-quota.yml index e061255..ac6661b 100644 --- a/roles/communishift/tasks/create-resource-quota.yml +++ b/roles/communishift/tasks/create-resource-quota.yml @@ -12,11 +12,11 @@ namespace: "{{ communishift_project_name }}" spec: hard: - cpu: "1" # requests.cpu - memory: "1Gi" # requests.memory - limits.cpu: "1" - limits.memory: "2Gi" - requests.storage: "5Gi" + cpu: "{{ item.value.cpu_requests | 1 }}" # requests.cpu + memory: "{{ item.value.memory_requests | 1Gi }}" # requests.memory + limits.cpu: "{{ item.value.cpu_limits | 1 }}" + limits.memory: "{{ item.value.memory_limits | 2Gi }}" + requests.storage: "{{ item.value.storage_requests | 5Gi }}" persistentvolumeclaims: "1" pods: "2" replicationcontrollers: 1 diff --git a/vars/global.yml b/vars/global.yml index 6ae891e..c6c1c78 100644 --- a/vars/global.yml +++ b/vars/global.yml @@ -69,7 +69,7 @@ global_pkgs_inst: ['bind-utils', 'nc', 'openssh-clients', 'patch', 'postfix', 'rsync', 'strace', 'tmpwatch', 'traceroute', 'vim-enhanced', 'xz', 'zsh', 'bash-completion', - 'atop', 'htop', 'rsyslog' ] + 'atop', 'htop', 'rsyslog'] # Set up variables for various files to make sure we don't forget to use. repoSpanner_rpms_http: 8445 repoSpanner_ansible_http: 8443