Skip to content

Commit c11cb47

Browse files
committed
Provide both a host and guest profile
openshift-node-host and openshift-node-guest profiles are to be used for bare metal and virtual machine installations respectively. The rpm installation scripts determine which profile is most appropriate based on the output of the 'tuned-adm recommend' command so the user should not need to make a selection on their own. A manpage has been created as well.
1 parent bd16bec commit c11cb47

File tree

4 files changed

+90
-4
lines changed

4 files changed

+90
-4
lines changed

openshift.spec

+15-4
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
124124

125125
ln -s %{_bindir}/openshift %{buildroot}%{_bindir}/osc
126126

127-
mkdir -p %{buildroot}%{_libdir}/tuned/openshift-node
128-
install -m 0644 -t %{buildroot}%{_libdir}/tuned/openshift-node tuned/openshift-node/tuned.conf
127+
install -d -m 0755 %{buildroot}%{_libdir}/tuned/openshift-node-{guest,host}
128+
install -m 0644 tuned/openshift-node-guest/tuned.conf %{buildroot}%{_libdir}/tuned/openshift-node-guest/
129+
install -m 0644 tuned/openshift-node-host/tuned.conf %{buildroot}%{_libdir}/tuned/openshift-node-host/
130+
install -d -m 0755 %{buildroot}%{_mandir}/man7
131+
install -m 0644 tuned/man/tuned-profiles-openshift-node.7 %{buildroot}%{_mandir}/man7/tuned-profiles-openshift-node.7
132+
129133

130134
%files
131135
%defattr(-,root,root,-)
@@ -165,10 +169,17 @@ install -m 0644 -t %{buildroot}%{_libdir}/tuned/openshift-node tuned/openshift-n
165169

166170
%files -n tuned-profiles-openshift-node
167171
%defattr(-,root,root,-)
168-
%{_libdir}/tuned/openshift-node
172+
%{_libdir}/tuned/openshift-node-host
173+
%{_libdir}/tuned/openshift-node-guest
174+
%{_mandir}/man7/tuned-profiles-openshift-node.7*
169175

170176
%post -n tuned-profiles-openshift-node
171-
/usr/sbin/tuned-adm profile openshift-node > /dev/null 2>&1
177+
recommended=`/usr/sbin/tuned-adm recommend`
178+
if [[ "${recommended}" =~ guest ]] ; then
179+
/usr/sbin/tuned-adm profile openshift-node-guest > /dev/null 2>&1
180+
else
181+
/usr/sbin/tuned-adm profile openshift-node-host > /dev/null 2>&1
182+
fi
172183

173184
%preun -n tuned-profiles-openshift-node
174185
# reset the tuned profile to the recommended profile
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.\"/*
2+
.\" * All rights reserved
3+
.\" * Copyright (C) 2015 Red Hat, Inc.
4+
.\" * Authors: Jaroslav Škarvada, Scott Dodson
5+
.\" *
6+
.\" * This program is free software; you can redistribute it and/or
7+
.\" * modify it under the terms of the GNU General Public License
8+
.\" * as published by the Free Software Foundation; either version 2
9+
.\" * of the License, or (at your option) any later version.
10+
.\" *
11+
.\" * This program is distributed in the hope that it will be useful,
12+
.\" * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
.\" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
.\" * GNU General Public License for more details.
15+
.\" *
16+
.\" * You should have received a copy of the GNU General Public License
17+
.\" * along with this program; if not, write to the Free Software
18+
.\" * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
.\" */
20+
.\"
21+
.TH TUNED_PROFILES_OPENSHIFT_NODE "7" "12 Feb 2015" "OpenShift" "tuned"
22+
.SH NAME
23+
tuned\-profiles\-openshift-node - description of profiles provided for OpenShift
24+
25+
.SH DESCRIPTION
26+
These profiles are provided for OpenShift nodes. They provide performance
27+
optimizations for OpenShift Nodes running on either bare metal
28+
(openshift-node-host) or virtual machines (openshift-node-guest).
29+
30+
.SH PROFILES
31+
The following profiles are provided:
32+
33+
.TP
34+
.BI "openshift-node\-host"
35+
Profile optimized for OpenShift hosts (bare metal). It is based on throughput\-performance
36+
profile. It additionally increases SELinux AVC cache, PID limit and tunes
37+
netfilter connections tracking.
38+
39+
.TP
40+
.BI "openshift-node\-guest"
41+
Profile optimized for virtual OpenShift guests. It is based on virtual\-guest
42+
profile. It additionally increases SELinux AVC cache, PID limit and tunes
43+
netfilter connections tracking.
44+
45+
.SH "FILES"
46+
.NF
47+
.I /etc/tuned/*
48+
.I /usr/lib/tuned/*
49+
50+
.SH "SEE ALSO"
51+
.BR tuned (8)
52+
.BR tuned\-adm (8)
53+
.BR tuned\-profiles (7)
54+
.BR tuned\-profiles\-sap (7)
55+
.BR tuned\-profiles\-sap\-hana (7)
56+
.BR tuned\-profiles\-compat (7)
57+
.SH AUTHOR
58+
.NF
59+
Scott Dodson <[email protected]>

tuned/openshift-node-guest/tuned.conf

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# tuned configuration
3+
#
4+
5+
[main]
6+
include=virtual-guest
7+
8+
[selinux]
9+
avc_cache_threshold=65536
10+
11+
[net]
12+
nf_conntrack_hashsize=131072
13+
14+
[sysctl]
15+
kernel.pid_max=131072
16+
net.netfilter.nf_conntrack_max=1048576
File renamed without changes.

0 commit comments

Comments
 (0)