mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-09-03 01:46:12 +00:00
add kubelet client for Pod resource info
This change introduces kubelet client to get allocated device information of a Pod from newly added Kubelet grpc service. For more information please see: [kubernetes/kubernetes#70508](https://github.com/kubernetes/kubernetes/pull/70508) Change-Id: I11e58ccdd52662601f445fa24c7d55c225441efc Signed-off-by: Abdul Halim <abdul.halim@intel.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
|
||||
"github.com/containernetworking/cni/pkg/types"
|
||||
"github.com/containernetworking/cni/pkg/types/current"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
@@ -50,9 +51,9 @@ type NetConf struct {
|
||||
// Option to isolate the usage of CR's to the namespace in which a pod resides.
|
||||
NamespaceIsolation bool `json:"namespaceIsolation"`
|
||||
// Option to set system namespaces (to avoid to add defaultNetworks)
|
||||
SystemNamespaces []string `json:"systemNamespaces"`
|
||||
SystemNamespaces []string `json:"systemNamespaces"`
|
||||
// Option to set the namespace that multus-cni uses (clusterNetwork/defaultNetworks)
|
||||
MultusNamespace string `json:"multusNamespace"`
|
||||
MultusNamespace string `json:"multusNamespace"`
|
||||
}
|
||||
|
||||
type RuntimeConfig struct {
|
||||
@@ -149,3 +150,9 @@ type ResourceInfo struct {
|
||||
Index int
|
||||
DeviceIDs []string
|
||||
}
|
||||
|
||||
// ResourceClient provides a kubelet Pod resource handle
|
||||
type ResourceClient interface {
|
||||
// GetPodResourceMap returns an instance of a map of Pod ResourceInfo given a (Pod name, namespace) tuple
|
||||
GetPodResourceMap(*v1.Pod) (map[string]*ResourceInfo, error)
|
||||
}
|
||||
|
Reference in New Issue
Block a user