From ae32caf1502dd1f8db90dc9e30e945d55d8818b7 Mon Sep 17 00:00:00 2001 From: David Kirwan Date: Tue, 23 Aug 2022 09:05:09 +0100 Subject: [PATCH] communishift: Added task for creating Openshift ResourceQuota Signed-off-by: David Kirwan Signed-off-by: Lenka Segura Signed-off-by: Patrik Polakovic --- .../tasks/create-resource-quota.yml | 22 +++++++++++++++++++ roles/communishift/tasks/main.yml | 1 + 2 files changed, 23 insertions(+) create mode 100644 roles/communishift/tasks/create-resource-quota.yml diff --git a/roles/communishift/tasks/create-resource-quota.yml b/roles/communishift/tasks/create-resource-quota.yml new file mode 100644 index 0000000000..e061255a01 --- /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 1cf8e3dc93..aeeac3fffa 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