Rate This Document
Findability
Accuracy
Completeness
Readability

Creating a Pod and Adding It to a Resource Group

To add a Pod to a resource group, specify the resource group when creating the Pod.

  1. Modify the Pod configuration file (in .yaml format). The following uses example-pod.yaml as an example.
    1. Go to the samples directory and open the example-pod.yaml file.
      cd samples
      vi example-pod.yaml
    2. Press i to enter the insert mode and add the following content to the file:
      labels:
          rcgroup: group2
      nodeSelector:
          MPAM: enabled
      • In the labels field, set the rcgroup field to specify the associated resource group. For example, add the Pod to group2.
      • Add MPAM: enabled to the nodeSelector field so that the scheduler can schedule the Pod to a node that supports the MPAM feature.

      The updated example-pod.yaml file has the following content:

      apiVersion: v1
      kind: Pod
      metadata:
        name: nginx
        labels:
          rcgroup: group2
      spec:
        containers:
        - name: nginx
          image: nginx:1.16.1
          ports:
          - containerPort: 80
            hostPort: 8088
        nodeSelector:
          MPAM: enabled
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  2. Create a Pod.
    kubectl apply -f example-pod.yaml
  3. On the node, go to the /sys/fs/resctrl directory and then the owning resource group (for example group1) of the Pod. You can view the configuration and monitoring data in the resource group and the PIDs of the restricted applications in the current resource group.
    cd /sys/fs/resctrl/group1
    • Run the following command to view the configuration of the resource group:
      cat schemata
    • Run the following command to view the PIDs of the resource group:
      cat tasks
    • Run the following command to view the monitoring data of the resource group:
      grep . mon_data/*