Skip to content

Commit bf27ccd

Browse files
committed
Allow 8gb mem OCP workers
1 parent 5ef8fb8 commit bf27ccd

2 files changed

Lines changed: 74 additions & 2 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
# Copyright Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Reduce cluster logging to minimum
18+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
19+
gather_facts: false
20+
environment:
21+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
22+
tasks:
23+
- name: Get all MachineConfigPools
24+
kubernetes.core.k8s_info:
25+
api_version: machineconfiguration.openshift.io/v1
26+
kind: MachineConfigPool
27+
register: _mcp_list
28+
29+
- name: Apply KubeletConfig per MachineConfigPool
30+
kubernetes.core.k8s:
31+
state: present
32+
definition:
33+
apiVersion: machineconfiguration.openshift.io/v1
34+
kind: KubeletConfig
35+
metadata:
36+
name: "reduce-container-logs-{{ item }}"
37+
spec:
38+
machineConfigPoolSelector:
39+
matchLabels:
40+
pools.operator.machineconfiguration.openshift.io/{{ item }}: ""
41+
kubeletConfig:
42+
containerLogMaxSize: "1Mi"
43+
containerLogMaxFiles: 2
44+
loop: >-
45+
{{ _mcp_list.resources | map(attribute='metadata.name') | list }}
46+
47+
- name: Apply ContainerRuntimeConfig per MachineConfigPool
48+
kubernetes.core.k8s:
49+
state: present
50+
definition:
51+
apiVersion: machineconfiguration.openshift.io/v1
52+
kind: ContainerRuntimeConfig
53+
metadata:
54+
name: "reduce-crio-logs-{{ item }}"
55+
spec:
56+
machineConfigPoolSelector:
57+
matchLabels:
58+
pools.operator.machineconfiguration.openshift.io/{{ item }}: ""
59+
containerRuntimeConfig:
60+
logLevel: "error"
61+
logSizeMax: "1Mi"
62+
loop: >-
63+
{{ _mcp_list.resources | map(attribute='metadata.name') | list }}
64+
65+
- name: Wait for MachineConfigPool rollouts to complete
66+
when: cifmw_reduce_cluster_logging_wait | default(true) | bool
67+
ansible.builtin.command:
68+
cmd: >-
69+
oc wait mcp --all
70+
--for=condition=Updated
71+
--timeout=1800s
72+
changed_when: false

roles/reproducer/tasks/ocp_layout_assertions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
- _cifmw_libvirt_manager_layout.vms.ocp_worker is defined
6464
vars:
6565
_element: "{{ _cifmw_libvirt_manager_layout.vms.ocp_worker | default({}) }}"
66-
_memory: 16
66+
_memory: 8
6767
_cpus: 10
6868
_disk: 50
6969
ansible.builtin.assert:
@@ -78,7 +78,7 @@
7878
- _element.disksize | int > _disk
7979
quiet: true
8080
msg: >-
81-
Ensure you provide enough memory (>=16), cpus (>=10) and
81+
Ensure you provide enough memory (>=8), cpus (>=10) and
8282
disksize (>50) to ocp_worker nodes, and uefi is set to true
8383
in cifmw_libvirt_manager.vms.ocp_worker
8484

0 commit comments

Comments
 (0)