Documentation
¶
Index ¶
- type Generator
- func (g *Generator) AddCreateContainerHook(hook rspec.Hook)
- func (g *Generator) AddCreateRuntimeHook(hook rspec.Hook)
- func (g *Generator) AddStartContainerHook(hook rspec.Hook)
- func (g *Generator) Adjust(adjust *nri.ContainerAdjustment) error
- func (g *Generator) AdjustAnnotations(annotations map[string]string) error
- func (g *Generator) AdjustBlockIOClass(blockIOClass *string) error
- func (g *Generator) AdjustCgroupsPath(path string)
- func (g *Generator) AdjustDevices(devices []*nri.LinuxDevice)
- func (g *Generator) AdjustEnv(env []*nri.KeyValue)
- func (g *Generator) AdjustHooks(hooks *nri.Hooks)
- func (g *Generator) AdjustMounts(mounts []*nri.Mount) error
- func (g *Generator) AdjustOomScoreAdj(score *nri.OptionalInt)
- func (g *Generator) AdjustRdtClass(rdtClass *string) error
- func (g *Generator) AdjustResources(r *nri.LinuxResources) error
- func (g *Generator) AdjustRlimits(rlimits []*nri.POSIXRlimit) error
- func (g *Generator) ClearLinuxIntelRdt()
- func (g *Generator) ClearLinuxResourcesBlockIO()
- func (g *Generator) InjectCDIDevices(devices []*nri.CDIDevice) error
- func (g *Generator) SetLinuxIntelRdt(rdt *rspec.LinuxIntelRdt)
- func (g *Generator) SetLinuxResourcesBlockIO(blockIO *rspec.LinuxBlockIO)
- type GeneratorOption
- func WithAnnotationFilter(fn func(map[string]string) (map[string]string, error)) GeneratorOption
- func WithBlockIOResolver(fn func(string) (*rspec.LinuxBlockIO, error)) GeneratorOption
- func WithCDIDeviceInjector(fn func(*rspec.Spec, []string) error) GeneratorOption
- func WithLabelFilter(fn func(map[string]string) (map[string]string, error)) GeneratorOption
- func WithRdtResolver(fn func(string) (*rspec.LinuxIntelRdt, error)) GeneratorOption
- func WithResourceChecker(fn func(*rspec.LinuxResources) error) GeneratorOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
Generator extends a stock runtime-tools Generator and extends it with a few functions for handling NRI container adjustment.
func SpecGenerator ¶
func SpecGenerator(gg *generate.Generator, opts ...GeneratorOption) *Generator
SpecGenerator returns a wrapped OCI Spec Generator.
func (*Generator) AddCreateContainerHook ¶
AddCreateContainerHook adds a hooks new CreateContainer hooks.
func (*Generator) AddCreateRuntimeHook ¶
AddCreateRuntimeHook adds a hooks new CreateRuntime hooks.
func (*Generator) AddStartContainerHook ¶
AddStartContainerHook adds a hooks new StartContainer hooks.
func (*Generator) Adjust ¶
func (g *Generator) Adjust(adjust *nri.ContainerAdjustment) error
Adjust adjusts all aspects of the OCI Spec that NRI knows/cares about.
func (*Generator) AdjustAnnotations ¶
AdjustAnnotations adjusts the annotations in the OCI Spec.
func (*Generator) AdjustBlockIOClass ¶
AdjustBlockIOClass adjusts the block I/O class in the OCI Spec.
func (*Generator) AdjustCgroupsPath ¶
AdjustCgroupsPath adjusts the cgroup pseudofs path in the OCI Spec.
func (*Generator) AdjustDevices ¶
func (g *Generator) AdjustDevices(devices []*nri.LinuxDevice)
AdjustDevices adjusts the (Linux) devices in the OCI Spec.
func (*Generator) AdjustHooks ¶
AdjustHooks adjusts the OCI hooks in the OCI Spec.
func (*Generator) AdjustMounts ¶
AdjustMounts adjusts the mounts in the OCI Spec.
func (*Generator) AdjustOomScoreAdj ¶ added in v0.7.0
func (g *Generator) AdjustOomScoreAdj(score *nri.OptionalInt)
AdjustOomScoreAdj adjusts the kernel's Out-Of-Memory (OOM) killer score for the container. This may override kubelet's settings for OOM score.
func (*Generator) AdjustRdtClass ¶
AdjustRdtClass adjusts the RDT class in the OCI Spec.
func (*Generator) AdjustResources ¶
func (g *Generator) AdjustResources(r *nri.LinuxResources) error
AdjustResources adjusts the (Linux) resources in the OCI Spec.
func (*Generator) AdjustRlimits ¶ added in v0.4.0
func (g *Generator) AdjustRlimits(rlimits []*nri.POSIXRlimit) error
func (*Generator) ClearLinuxIntelRdt ¶
func (g *Generator) ClearLinuxIntelRdt()
ClearLinuxIntelRdt clears RDT CLOS.
func (*Generator) ClearLinuxResourcesBlockIO ¶
func (g *Generator) ClearLinuxResourcesBlockIO()
ClearLinuxResourcesBlockIO clears Block I/O settings.
func (*Generator) InjectCDIDevices ¶ added in v0.7.0
InjectCDIDevices injects the requested CDI devices into the OCI Spec. Devices are given by their fully qualified CDI device names. The actual device injection is done using a runtime-specific CDI injection function, set using the WithCDIDeviceInjector option.
func (*Generator) SetLinuxIntelRdt ¶
func (g *Generator) SetLinuxIntelRdt(rdt *rspec.LinuxIntelRdt)
SetLinuxIntelRdt sets RDT CLOS.
func (*Generator) SetLinuxResourcesBlockIO ¶
func (g *Generator) SetLinuxResourcesBlockIO(blockIO *rspec.LinuxBlockIO)
SetLinuxResourcesBlockIO sets Block I/O settings.
type GeneratorOption ¶
type GeneratorOption func(*Generator)
GeneratorOption is an option for Generator().
func WithAnnotationFilter ¶
WithAnnotationFilter provides an option for filtering or rejecting annotations.
func WithBlockIOResolver ¶
func WithBlockIOResolver(fn func(string) (*rspec.LinuxBlockIO, error)) GeneratorOption
WithBlockIOResolver specifies a function for resolving Block I/O classes by name.
func WithCDIDeviceInjector ¶ added in v0.7.0
func WithCDIDeviceInjector(fn func(*rspec.Spec, []string) error) GeneratorOption
WithCDIDeviceInjector specifies a runtime-specific function to use for CDI device resolution and injection into an OCI Spec.
func WithLabelFilter ¶
WithLabelFilter provides an option for filtering or rejecting labels.
func WithRdtResolver ¶
func WithRdtResolver(fn func(string) (*rspec.LinuxIntelRdt, error)) GeneratorOption
WithRdtResolver specifies a function for resolving RDT classes by name.
func WithResourceChecker ¶
func WithResourceChecker(fn func(*rspec.LinuxResources) error) GeneratorOption
WithResourceChecker specifies a function to perform final resource adjustment.