From 4b5b002c291f25ea091159055e38b6451273a263 Mon Sep 17 00:00:00 2001 From: Andrew Bays Date: Tue, 19 May 2026 09:13:30 -0400 Subject: [PATCH] Allow 8gb mem OCP workers --- hooks/playbooks/reduce_cluster_logging.yml | 76 +++++++++++++++++++ .../tasks/ocp_layout_assertions.yml | 4 +- 2 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 hooks/playbooks/reduce_cluster_logging.yml diff --git a/hooks/playbooks/reduce_cluster_logging.yml b/hooks/playbooks/reduce_cluster_logging.yml new file mode 100644 index 000000000..6850bba2b --- /dev/null +++ b/hooks/playbooks/reduce_cluster_logging.yml @@ -0,0 +1,76 @@ +--- +# Copyright Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +- name: Reduce cluster logging to minimum + hosts: "{{ cifmw_target_hook_host | default('localhost') }}" + gather_facts: false + environment: + KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" + tasks: + - name: Get all MachineConfigPools + kubernetes.core.k8s_info: + api_version: machineconfiguration.openshift.io/v1 + kind: MachineConfigPool + register: _mcp_list + + - name: Apply KubeletConfig per MachineConfigPool + vars: + _pool_labels: >- + {{ {'pools.operator.machineconfiguration.openshift.io/' + item: ''} }} + kubernetes.core.k8s: + state: present + definition: + apiVersion: machineconfiguration.openshift.io/v1 + kind: KubeletConfig + metadata: + name: "reduce-container-logs-{{ item }}" + spec: + machineConfigPoolSelector: + matchLabels: "{{ _pool_labels }}" + kubeletConfig: + containerLogMaxSize: "1Mi" + containerLogMaxFiles: 2 + loop: >- + {{ _mcp_list.resources | map(attribute='metadata.name') | list }} + + - name: Apply ContainerRuntimeConfig per MachineConfigPool + vars: + _pool_labels: >- + {{ {'pools.operator.machineconfiguration.openshift.io/' + item: ''} }} + kubernetes.core.k8s: + state: present + definition: + apiVersion: machineconfiguration.openshift.io/v1 + kind: ContainerRuntimeConfig + metadata: + name: "reduce-crio-logs-{{ item }}" + spec: + machineConfigPoolSelector: + matchLabels: "{{ _pool_labels }}" + containerRuntimeConfig: + logLevel: "error" + logSizeMax: "1Mi" + loop: >- + {{ _mcp_list.resources | map(attribute='metadata.name') | list }} + + - name: Wait for MachineConfigPool rollouts to complete + when: cifmw_reduce_cluster_logging_wait | default(true) | bool + ansible.builtin.command: + cmd: >- + oc wait mcp --all + --for=condition=Updated + --timeout=3600s + changed_when: false diff --git a/roles/reproducer/tasks/ocp_layout_assertions.yml b/roles/reproducer/tasks/ocp_layout_assertions.yml index d48736bc4..4f2f5f40f 100644 --- a/roles/reproducer/tasks/ocp_layout_assertions.yml +++ b/roles/reproducer/tasks/ocp_layout_assertions.yml @@ -63,7 +63,7 @@ - _cifmw_libvirt_manager_layout.vms.ocp_worker is defined vars: _element: "{{ _cifmw_libvirt_manager_layout.vms.ocp_worker | default({}) }}" - _memory: 16 + _memory: 8 _cpus: 10 _disk: 50 ansible.builtin.assert: @@ -78,7 +78,7 @@ - _element.disksize | int > _disk quiet: true msg: >- - Ensure you provide enough memory (>=16), cpus (>=10) and + Ensure you provide enough memory (>=8), cpus (>=10) and disksize (>50) to ocp_worker nodes, and uefi is set to true in cifmw_libvirt_manager.vms.ocp_worker