cri: annotations for controlling RDT class
Use goresctrl for parsing container and pod annotations related to RDT. In practice, from the users' point of view, this patchs adds support for a container annotation and two separate pod annotations for controlling the RDT class of containers. Container annotation can be used by a CRI client: "io.kubernetes.cri.rdt-class" Pod annotations for specifying the RDT class in the K8s pod spec level: "rdt.resources.beta.kubernetes.io/pod" (pod-wide default for all containers within) "rdt.resources.beta.kubernetes.io/container.<container_name>" (container-specific overrides) Annotations are intended as an intermediate step before the CRI API supports RDT. Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
This commit is contained in:
@@ -256,6 +256,15 @@ func (c *criService) containerSpec(
|
||||
|
||||
supplementalGroups := securityContext.GetSupplementalGroups()
|
||||
|
||||
// Get RDT class
|
||||
rdtClass, err := rdtClassFromAnnotations(config.GetMetadata().GetName(), config.Annotations, sandboxConfig.Annotations)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to set RDT class")
|
||||
}
|
||||
if rdtClass != "" {
|
||||
specOpts = append(specOpts, oci.WithRdt(rdtClass, "", ""))
|
||||
}
|
||||
|
||||
for pKey, pValue := range getPassthroughAnnotations(sandboxConfig.Annotations,
|
||||
ociRuntime.PodAnnotations) {
|
||||
specOpts = append(specOpts, customopts.WithAnnotation(pKey, pValue))
|
||||
|
||||
Reference in New Issue
Block a user