config/puppet-manifests/src/modules/platform/manifests
Jim Gauld 209e346ab4 Container pinning on worker nodes and All-in-one servers
This story will pin the infrastructure and openstack pods to the
platform cores for worker nodes and All-in-one servers.

This configures systemd system.conf parameter
CPUAffinity=<platform_cpus> by generating
/etc/systemd/system.conf.d/platform-cpuaffinity.conf .
All services launch tasks with the appropriate cpu affinity.

This creates the cgroup called 'k8s-infra' for the following subset
of controllers ('cpuacct', 'cpuset', 'cpu', 'memory', 'systemd').
This configures custom cpuset.cpus (i.e., cpuset) and cpuset.mems
(i.e., nodeset) based on sysinv platform configurable cores. This is
generated by puppet using sysinv host cpu information and is stored
to the hieradata variables:
- platform::kubernetes::params::k8s_cpuset
- platform::kubernetes::params::k8s_nodeset

This creates the cgroup called 'machine.slice' for the controller
'cpuset' and sets cpuset.cpus and cpuset.mems to the parent values.
This prevents VMs from inheriting those settings from libvirt.

Note: systemd automatically mounts cgroups and all available
resource controllers, so the new puppet code does not need to do
that.

Kubelet is now launched with --cgroup-root /k8s-infra by configuring
kubeadm.yaml with the option: cgroupRoot: "/k8s-infra" .

For openstack based worker nodes including AIO
(i.e., host-label openstack-compute-node=enabled):
- the k8s cpuset and nodeset include the assigned platform cores

For non-openstack based worker nodes including AIO:
- the k8s cpuset and nodeset include all cpus except the assigned
  platform cores. This will be refined in a later update since
  we need isolate cpusets of k8s infrastructure from other pods.

The cpuset topology can be viewed with the following:
 sudo systemd-cgls cpuset

The task cpu affinity can be verified with the following:
 ps-sched.sh

The dynamic affining of platform tasks during start-up is disabled,
that code requires cleanup, and likely no longer required
since we are using systemd CPUAffinity and cgroups.

This includes a few small fixes to enable testing of this feature:
- facter platform_res_mem was updated to not require 'memtop', since
  that depends on existance of numa nodes. This was failing on QEMU
  environment when the host does not have Numa nodes. This occurs
  when there is no CPU topology specified.
- cpumap_functions.sh updated parameter defaults so that calling
  bash scripts may enable 'set -u' undefined variable checking.
- the generation of platform_cpu_list did not have all threads.
- the cpulist-to-ranges inline code was incorrect; in certain
  senarios the rstrip(',') would take out the wrong commas.

Story: 2004762
Task: 28879

Change-Id: I6fd21bac59fc2d408132905b88710da48aa8d928
Signed-off-by: Jim Gauld <james.gauld@windriver.com>
2019-04-11 01:39:44 -04:00
..
amqp.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
anchors.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
ceph.pp Remove swift endpoints from baremetal 2019-04-08 15:09:33 -05:00
client.pp Optional https for containerized openstack 2019-03-22 12:55:36 -04:00
collectd.pp Make collectd startup dependent on networking Anchor 2019-01-03 19:58:30 +00:00
compute.pp Container pinning on worker nodes and All-in-one servers 2019-04-11 01:39:44 -04:00
config.pp Cluster network cleanup 2019-04-03 11:19:27 -04:00
dcmanager.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
dcorch.pp Update manifests to remove unused openstack components 2019-03-08 18:43:22 -06:00
devices.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
dhclient.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
dns.pp Update manifests to remove unused openstack components 2019-03-08 18:43:22 -06:00
docker.pp Remove optionality of kubernetes from manifests 2019-03-04 15:37:08 -06:00
dockerdistribution.pp Docker Registry Keystone Authentication 2019-03-07 12:55:59 -05:00
drbd.pp Update manifests to remove unused openstack components 2019-03-08 18:43:22 -06:00
etcd.pp Remove optionality of kubernetes from manifests 2019-03-04 15:37:08 -06:00
exports.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
filesystem.pp Update manifests to remove unused openstack components 2019-03-08 18:43:22 -06:00
firewall.pp Initial firewall config causes temporary packet loss 2019-02-05 15:20:47 +00:00
fm.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
fstab.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
grub.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
haproxy.pp Remove unused puppet modules 2019-03-20 08:03:07 -05:00
helm.pp Update kubernetes, tiller and calico 2019-04-03 12:06:59 -05:00
influxdb.pp Make collectd startup dependent on networking Anchor 2019-01-03 19:58:30 +00:00
kubernetes.pp Container pinning on worker nodes and All-in-one servers 2019-04-11 01:39:44 -04:00
ldap.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
lldp.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
lvm.pp Remove unused puppet modules 2019-03-20 08:03:07 -05:00
memcached.pp Fix additional puppet-lint warnings and errors 2018-12-27 16:23:13 -06:00
mtce.pp Remove Resource Monitor ; aka rmon, from the load 2019-03-19 13:27:23 -04:00
multipath.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
network.pp Kubernetes Cluster Network Configuration 2019-01-09 12:41:25 -05:00
nfv.pp Remove optionality of kubernetes from manifests 2019-03-04 15:37:08 -06:00
ntp.pp Fix additional puppet-lint warnings and errors 2018-12-27 16:23:13 -06:00
params.pp Fix additional puppet-lint warnings and errors 2018-12-27 16:23:13 -06:00
partitions.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
password.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
patching.pp Configurable Host HTTP/HTTPS Port Binding 2019-02-06 12:47:00 -06:00
postgresql.pp Remove puppet SM calls for obsoleted services 2019-04-08 08:14:47 -05:00
ptp.pp Add PTP monitoring to collectd 2019-03-25 12:16:15 -04:00
remotelogging.pp Fix additional puppet-lint warnings and errors 2018-12-27 16:23:13 -06:00
scratch.pp StarlingX open source release updates 2018-05-31 07:35:52 -07:00
sm.pp Remove puppet SM calls for obsoleted services 2019-04-08 08:14:47 -05:00
smapi.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
snmp.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
sysctl.pp Set bridge-nf-call-arptables 2019-01-11 13:13:12 -05:00
sysinv.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
users.pp Fix puppet-lint warnings and errors 2018-12-27 15:08:37 -06:00
vswitch.pp Support ovs in container 2019-03-27 10:05:07 +08:00
worker.pp Remove unused puppet modules 2019-03-20 08:03:07 -05:00