Documentation ¶
Index ¶
- Constants
- func AllocatableResourceListFromNodeResourceTopology(nodeTopo *v1alpha2.NodeResourceTopology) map[string]corev1.ResourceList
- func CompareAllocatableResources(expected, got map[string]corev1.ResourceList) (string, string, int, bool)
- func CompareResourceList(expected, got corev1.ResourceList) (string, int, bool)
- func ConfigureRBAC(ctx context.Context, cs clientset.Interface, ns string) error
- func CreateNfdCRDs(ctx context.Context, cli extclient.Interface) ([]*apiextensionsv1.CustomResourceDefinition, error)
- func CreateNodeFeature(ctx context.Context, cli nfdclientset.Interface, ...) error
- func CreateNodeFeatureRulesFromFile(ctx context.Context, cli nfdclientset.Interface, filename string) error
- func CreateNodeResourceTopologies(ctx context.Context, extClient extclient.Interface) (*apiextensionsv1.CustomResourceDefinition, error)
- func CreateNodeResourceTopology(ctx context.Context, topologyClient *topologyclientset.Clientset, ...) error
- func CreateOrUpdateNodeFeaturesFromFile(ctx context.Context, cli nfdclientset.Interface, ...) ([]string, error)
- func CreateService(ctx context.Context, cs clientset.Interface, ns string) (*corev1.Service, error)
- func DeconfigureRBAC(ctx context.Context, cs clientset.Interface, ns string) error
- func FilterNodesWithEnoughCores(nodes []corev1.Node, cpuAmount string) ([]corev1.Node, error)
- func GetNodeTopology(ctx context.Context, topologyClient *topologyclientset.Clientset, ...) *v1alpha2.NodeResourceTopology
- func GetNodesByRole(ctx context.Context, f *framework.Framework, role string) ([]corev1.Node, error)
- func GetNodesBySelector(ctx context.Context, f *framework.Framework, selector labels.Selector) ([]corev1.Node, error)
- func GetWorkerNodes(ctx context.Context, f *framework.Framework) ([]corev1.Node, error)
- func IsValidNodeTopology(nodeTopology *v1alpha2.NodeResourceTopology, ...) bool
- func NewConfigMap(name, key, data string) *corev1.ConfigMap
- func NewNodeResourceTopologies() (*apiextensionsv1.CustomResourceDefinition, error)
- func UpdateConfigMap(ctx context.Context, c clientset.Interface, name, namespace, key, data string) error
- func UpdateNodeFeatureRulesFromFile(ctx context.Context, cli nfdclientset.Interface, filename string) error
- type E2EConfig
- type KubeletConfig
- type NodeConfig
Constants ¶
const ( DefaultConfigPath = "/var/lib/kubelet/config.yaml" DefaultPodResourcesSocketPath = "/var/lib/kubelet/pod-resources/kubelet.sock" )
const ( // LabelRole contains the key for the role label LabelRole = "node-role.kubernetes.io" // LabelHostname contains the key for the hostname label LabelHostname = "kubernetes.io/hostname" )
const (
// RoleWorker contains the worker role
RoleWorker = "worker"
)
Variables ¶
This section is empty.
Functions ¶
func AllocatableResourceListFromNodeResourceTopology ¶
func AllocatableResourceListFromNodeResourceTopology(nodeTopo *v1alpha2.NodeResourceTopology) map[string]corev1.ResourceList
AllocatableResourceListFromNodeResourceTopology extract the map zone:allocatableResources from the given NodeResourceTopology instance.
func CompareAllocatableResources ¶
func CompareAllocatableResources(expected, got map[string]corev1.ResourceList) (string, string, int, bool)
CompareAllocatableResources compares `expected` and `got` map zone:allocatableResources respectively (see: AllocatableResourceListFromNodeResourceTopology), and informs the caller if the maps are equal. Here `equal` means the same zoneNames with the same resources, where the resources are equal if they have the same resources with the same quantities. Returns the name of the different zone, the name of the different resources within the zone, the comparison result (same semantic as strings.Compare) and a boolean that reports if the resourceLists are consistent. See `CompareResourceList`.
func CompareResourceList ¶
func CompareResourceList(expected, got corev1.ResourceList) (string, int, bool)
CompareResourceList compares `expected` and `got` ResourceList respectively, and informs the caller if the two ResourceList are equal. Here `equal` means the same resources with the same quantities. Returns the different resource, the comparison result (same semantic as strings.Compare) and a boolean that reports if the resourceLists are consistent. The ResourceLists are consistent only if the represent the same resource set (all the resources listed in one are also present in the another; no ResourceList is a superset nor a subset of the other)
func ConfigureRBAC ¶
ConfigureRBAC creates required RBAC configuration
func CreateNfdCRDs ¶
func CreateNfdCRDs(ctx context.Context, cli extclient.Interface) ([]*apiextensionsv1.CustomResourceDefinition, error)
CreateNfdCRDs creates the NodeFeatureRule CRD in the API server.
func CreateNodeFeature ¶ added in v0.14.0
func CreateNodeFeature(ctx context.Context, cli nfdclientset.Interface, namespace, name, nodeName string) error
CreateNodeFeature creates a dummy NodeFeature object for a node
func CreateNodeFeatureRulesFromFile ¶
func CreateNodeFeatureRulesFromFile(ctx context.Context, cli nfdclientset.Interface, filename string) error
CreateNodeFeatureRuleFromFile creates a NodeFeatureRule object from a given file located under test data directory.
func CreateNodeResourceTopologies ¶
func CreateNodeResourceTopologies(ctx context.Context, extClient extclient.Interface) (*apiextensionsv1.CustomResourceDefinition, error)
CreateNodeResourceTopologies creates the NodeResourceTopology in the cluster if the CRD doesn't exists already. Returns the CRD golang object present in the cluster.
func CreateNodeResourceTopology ¶ added in v0.14.0
func CreateNodeResourceTopology(ctx context.Context, topologyClient *topologyclientset.Clientset, nodeName string) error
CreateNodeResourceTopology creates a dummy NodeResourceTopology object for a node
func CreateOrUpdateNodeFeaturesFromFile ¶ added in v0.13.0
func CreateOrUpdateNodeFeaturesFromFile(ctx context.Context, cli nfdclientset.Interface, filename, namespace, nodename string) ([]string, error)
CreateOrUpdateNodeFeaturesFromFile creates/updates a NodeFeature object from a given file located under test data directory.
func CreateService ¶
CreateService creates nfd-master Service
func DeconfigureRBAC ¶
DeconfigureRBAC removes RBAC configuration
func FilterNodesWithEnoughCores ¶
FilterNodesWithEnoughCores returns all nodes with at least the amount of given CPU allocatable
func GetNodeTopology ¶
func GetNodeTopology(ctx context.Context, topologyClient *topologyclientset.Clientset, nodeName string) *v1alpha2.NodeResourceTopology
GetNodeTopology returns the NodeResourceTopology data for the node identified by `nodeName`.
func GetNodesByRole ¶
func GetNodesByRole(ctx context.Context, f *framework.Framework, role string) ([]corev1.Node, error)
GetByRole returns all nodes with the specified role
func GetNodesBySelector ¶
func GetNodesBySelector(ctx context.Context, f *framework.Framework, selector labels.Selector) ([]corev1.Node, error)
GetBySelector returns all nodes with the specified selector
func GetWorkerNodes ¶
GetWorkerNodes returns all nodes labeled as worker
func IsValidNodeTopology ¶
func IsValidNodeTopology(nodeTopology *v1alpha2.NodeResourceTopology, kubeletConfig *kubeletconfig.KubeletConfiguration) bool
IsValidNodeTopology checks the provided NodeResourceTopology object if it is well-formad, internally consistent and consistent with the given kubelet config object. Returns true if the NodeResourceTopology object is consistent and well formet, false otherwise; if return false, logs the failure reason.
func NewConfigMap ¶
CreateConfigMap is a helper for creating a simple ConfigMap object with one key.
func NewNodeResourceTopologies ¶
func NewNodeResourceTopologies() (*apiextensionsv1.CustomResourceDefinition, error)
NewNodeResourceTopologies makes a CRD golang object representing NodeResourceTopology definition
func UpdateConfigMap ¶ added in v0.13.0
func UpdateConfigMap(ctx context.Context, c clientset.Interface, name, namespace, key, data string) error
UpdateConfigMap is a helper for updating a ConfigMap object.
func UpdateNodeFeatureRulesFromFile ¶
func UpdateNodeFeatureRulesFromFile(ctx context.Context, cli nfdclientset.Interface, filename string) error
UpdateNodeFeatureRulesFromFile updates existing NodeFeatureRule object from a given file located under test data directory.
Types ¶
type E2EConfig ¶
type E2EConfig struct { DefaultFeatures *struct { LabelWhitelist lookupMap AnnotationWhitelist lookupMap Nodes []NodeConfig } Kubelet *KubeletConfig }
func (*E2EConfig) GetKubeletConfig ¶
func (conf *E2EConfig) GetKubeletConfig() KubeletConfig
GetKubeletConfig returns a KubeletConfig object with default values, possibly overridden by user settings.
type KubeletConfig ¶
type NodeConfig ¶
type NodeConfig struct { Name string NodeNameRegexp string ExpectedLabelValues map[string]string ExpectedLabelKeys lookupMap ExpectedAnnotationValues map[string]string ExpectedAnnotationKeys lookupMap // contains filtered or unexported fields }
func FindNodeConfig ¶
func FindNodeConfig(cfg *E2EConfig, nodeName string) *NodeConfig