From ae32caf1502dd1f8db90dc9e30e945d55d8818b7 Mon Sep 17 00:00:00 2001 From: David Kirwan Date: Aug 23 2022 08:06:20 +0000 Subject: communishift: Added task for creating Openshift ResourceQuota Signed-off-by: David Kirwan Signed-off-by: Lenka Segura Signed-off-by: Patrik Polakovic --- diff --git a/roles/communishift/tasks/create-resource-quota.yml b/roles/communishift/tasks/create-resource-quota.yml new file mode 100644 index 0000000..e061255 --- /dev/null +++ b/roles/communishift/tasks/create-resource-quota.yml @@ -0,0 +1,22 @@ +--- +- name: Create a k8s ResourceQuota + community.okd.k8s: + api_key: "{{ communishift_ocp_api_token }}" + host: "{{ communishift_ocp_api_host }}" + state: present + definition: + apiVersion: v1 + kind: ResourceQuota + metadata: + name: "{{ communishift_project_name }}-quota" + namespace: "{{ communishift_project_name }}" + spec: + hard: + cpu: "1" # requests.cpu + memory: "1Gi" # requests.memory + limits.cpu: "1" + limits.memory: "2Gi" + requests.storage: "5Gi" + persistentvolumeclaims: "1" + pods: "2" + replicationcontrollers: 1 diff --git a/roles/communishift/tasks/main.yml b/roles/communishift/tasks/main.yml index 1cf8e3d..aeeac3f 100644 --- a/roles/communishift/tasks/main.yml +++ b/roles/communishift/tasks/main.yml @@ -11,3 +11,4 @@ - include_tasks: create-efs-secret.yml - include_tasks: create-role.yml - include_tasks: create-role-binding.yml +- include_tasks: create-resource-quota.yml