From 5427bf85aebc63f002d08f95c81b97518d3993c4 Mon Sep 17 00:00:00 2001 From: thedoubl3j Date: Wed, 8 Feb 2023 15:33:40 -0500 Subject: [PATCH 1/3] add replicas to both deployments with separate toggle --- config/crd/bases/awx.ansible.com_awxs.yaml | 5 +++++ roles/installer/defaults/main.yml | 1 + roles/installer/templates/deployments/task.yaml.j2 | 4 ++++ roles/installer/templates/deployments/web.yaml.j2 | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index df0c3b880..b812c810e 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -1433,6 +1433,11 @@ spec: service_account_annotations: description: ServiceAccount annotations type: string + replicas: + description: Number of instance replicas + type: integer + default: 1 + format: int32 web_replicas: description: Number of web instance replicas type: integer diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index 1afaca9ce..c47916e43 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -236,6 +236,7 @@ _init_projects_container_image: quay.io/centos/centos:stream9 create_preload_data: true +replicas: "1" web_replicas: "1" task_replicas: "1" diff --git a/roles/installer/templates/deployments/task.yaml.j2 b/roles/installer/templates/deployments/task.yaml.j2 index 3cbc92344..33c333007 100644 --- a/roles/installer/templates/deployments/task.yaml.j2 +++ b/roles/installer/templates/deployments/task.yaml.j2 @@ -8,7 +8,11 @@ metadata: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} {{ lookup("template", "../common/templates/labels/version.yaml.j2") | indent(width=4) | trim }} spec: +{% if task_replicas %} replicas: {{ task_replicas }} +{% elif replicas %} + replicas: {{ replicas }} +{% endif %} selector: matchLabels: app.kubernetes.io/name: '{{ ansible_operator_meta.name }}-task' diff --git a/roles/installer/templates/deployments/web.yaml.j2 b/roles/installer/templates/deployments/web.yaml.j2 index 413e96c85..855861cd0 100644 --- a/roles/installer/templates/deployments/web.yaml.j2 +++ b/roles/installer/templates/deployments/web.yaml.j2 @@ -9,7 +9,11 @@ metadata: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} {{ lookup("template", "../common/templates/labels//version.yaml.j2") | indent(width=4) | trim }} spec: +{% if web_replicas %} replicas: {{ web_replicas }} +{% elif replicas %} + replicas: {{ replicas }} +{% endif %} selector: matchLabels: app.kubernetes.io/name: '{{ ansible_operator_meta.name }}-web' From 4b2b3af468be5dcd6dd6f0b1b5abe5b2ae40f081 Mon Sep 17 00:00:00 2001 From: thedoubl3j Date: Thu, 9 Feb 2023 11:19:09 -0500 Subject: [PATCH 2/3] remove web and task replica defaults and leave as empty strings --- roles/installer/defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index c47916e43..fbeba1381 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -237,8 +237,8 @@ _init_projects_container_image: quay.io/centos/centos:stream9 create_preload_data: true replicas: "1" -web_replicas: "1" -task_replicas: "1" +web_replicas: '' +task_replicas: '' task_args: - /usr/bin/launch_awx_task.sh From 4622a801fb21ccb1acd6f2ab1c8f303f4f73ee1a Mon Sep 17 00:00:00 2001 From: thedoubl3j Date: Thu, 9 Feb 2023 14:04:10 -0500 Subject: [PATCH 3/3] remove defaults --- config/crd/bases/awx.ansible.com_awxs.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index b812c810e..21948bf50 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -1441,12 +1441,10 @@ spec: web_replicas: description: Number of web instance replicas type: integer - default: 1 format: int32 task_replicas: description: Number of task instance replicas type: integer - default: 1 format: int32 garbage_collect_secrets: description: Whether or not to remove secrets upon instance removal