#
# This example creates 3 ConfigMaps:
#  - nri-resmgr-config.default: the default configuration
#  - nri-resmgr-config.group.foo: the configuration for nodes in group foo
#  - nri-resmgr-config.node.cl0-slave1: the configuration for node cl0-slave1
#
# You can assign nodes to group foo using the command
#   kubectl label --overwrite node $NODE_NAME nri-resmgr.intel.com/group=foo
#
# You can remove nodes from group foo using the command
#   kubectl label node $NODE_NAME nri-resmgr.intel.com/group-
#

apiVersion: v1
kind: ConfigMap
metadata:
  name: nri-resmgr-config.default
  namespace: kube-system
data:
  policy: |+
    Active: topology-aware
    AvailableResources:
      cpu: cpuset:0-63
    ReservedResources:
      cpu: cpuset:0-1
    topology-aware:
      PinCPU: true
      PinMemory: true
      PreferIsolatedCPUs: true
      PreferSharedCPUs: false
    static:
      RelaxedIsolation: true
    static-pools:
      # Filesystem path to legacy configuration directory structure
      ConfDirPath: "/etc/cmk"
      # Filesystem path to legacy configuration file
      ConfFilePath: ""
      # Whether to create CMK node label
      LabelNode: false
      # Whether to create CMK node taint
      TaintNode: false
      # Pool configuration.
      # The imaginary example system below consists of 4 sockets, 4 cores, 2
      # threads each.
      pools:
        exclusive:
          # 6 exclusive cores, 3 on sockets 1, 2 and 3 each
          cpuLists:
          - Cpuset: 8,9
            Socket: 1
          - Cpuset: 10,11
            Socket: 1
          - Cpuset: 16,17
            Socket: 2
          - Cpuset: 18,19
            Socket: 2
          - Cpuset: 24,25
            Socket: 3
          - Cpuset: 26,27
            Socket: 3
          exclusive: true
        shared:
          # 2 cores in shared pool, all on socket 1
          cpuLists:
          - Cpuset: 12,13,14,15
            Socket: 1
          exclusive: false
        infra:
          # Rest of cores designated to infra pool
          cpuLists:
          - Cpuset: 0,1,2,3,4,5,6,7
            Socket: 0
          - Cpuset: 20,21,22,23
            Socket: 2
          - Cpuset: 28,29,30,31
            Socket: 3
          exclusive: false
---
apiVersion: v1
kind: ConfigMap
metadata:
  ## Configuration specific to a group of nodes can be specified with
  #name: nri-resmgr-config.group.<node-group-label-name>
  namespace: kube-system
data:
  policy: |+
    Active: topology-aware
    AvailableResources:
      cpu: cpuset:0-63
    ReservedResources:
      cpu: cpuset:0-1
    topology-aware:
      PinCPU: true
      PinMemory: false
      PreferIsolatedCPUs: false
      PreferSharedCPUs: false
    static:
      RelaxedIsolation: true
    static-pools:
      # This is an example configuration for static-pools policy.
      # The imaginary example system here consists of 4 sockets, 4 cores, 2 threads each.
      pools:
        exclusive:
          # 6 exclusive cores, 3 on sockets 1, 2 and 3 each
          cpuLists:
          - Cpuset: 8,9
            Socket: 1
          - Cpuset: 10,11
            Socket: 1
          - Cpuset: 16,17
            Socket: 2
          - Cpuset: 18,19
            Socket: 2
          - Cpuset: 24,25
            Socket: 3
          - Cpuset: 26,27
            Socket: 3
          exclusive: true
        shared:
          # 2 cores in shared pool, all on socket 1
          cpuLists:
          - Cpuset: 12,13,14,15
            Socket: 1
          exclusive: false
        infra:
          # Rest of cores designated to infra pool
          cpuLists:
          - Cpuset: 0,1,2,3,4,5,6,7
            Socket: 0
          - Cpuset: 20,21,22,23
            Socket: 2
          - Cpuset: 28,29,30,31
            Socket: 3
          exclusive: false
---
apiVersion: v1
kind: ConfigMap
metadata:
  ## Node-specific configuration can be specified with
  #name: nri-resmgr-config.node.<node-name>
  namespace: kube-system
data:
  policy: |+
    Active: topology-aware
    AvailableResources:
      cpu: cpuset:0-63
    ReservedResources:
      cpu: cpuset:0-1
    topology-aware:
      PinCPU: false
      PinMemory: true
      PreferIsolatedCPUs: false
      PreferSharedCPUs: false
    static:
      RelaxedIsolation: true
    static-pools:
      # This is an example configuration for static-pools policy.
      # The imaginary example system here consists of 4 sockets, 4 cores, 2 threads each.
      pools:
        exclusive:
          # 6 exclusive cores, 3 on sockets 1, 2 and 3 each
          cpuLists:
          - Cpuset: 8,9
            Socket: 1
          - Cpuset: 10,11
            Socket: 1
          - Cpuset: 16,17
            Socket: 2
          - Cpuset: 18,19
            Socket: 2
          - Cpuset: 24,25
            Socket: 3
          - Cpuset: 26,27
            Socket: 3
          exclusive: true
        shared:
          # 2 cores in shared pool, all on socket 1
          cpuLists:
          - Cpuset: 12,13,14,15
            Socket: 1
          exclusive: false
        infra:
          # Rest of cores designated to infra pool
          cpuLists:
          - Cpuset: 0,1,2,3,4,5,6,7
            Socket: 0
          - Cpuset: 20,21,22,23
            Socket: 2
          - Cpuset: 28,29,30,31
            Socket: 3
          exclusive: false
  logger: |+
    Debug: resource-manager,cache
