Documentation
¶
Index ¶
- func NewServer(client *Client) kubepb.KubeAPIServer
- type AddListener
- type Client
- func (c *Client) GetAllNodes() []*corev1.Node
- func (c *Client) GetCloudProvider() cloudtypes.Type
- func (c *Client) GetClusterInfo(ctx context.Context) (*ClusterInfo, error)
- func (c *Client) GetIPInfo(ip netip.Addr) (IPInfo, bool)
- func (c *Client) GetKvisorAgentImageDetails() (ImageDetails, error)
- func (c *Client) GetNodeInfo(name string) (*corev1.Node, bool)
- func (c *Client) GetNodeStatsSummary(ctx context.Context, nodeName string) (*kubepb.GetNodeStatsSummaryResponse, error)
- func (c *Client) GetOwnerUID(obj Object) string
- func (c *Client) GetPVByName(name string) (*corev1.PersistentVolume, bool)
- func (c *Client) GetPVCByName(namespace, name string) (*corev1.PersistentVolumeClaim, bool)
- func (c *Client) GetPodInfo(uid string) (*PodInfo, bool)
- func (c *Client) GetPodsOnNode(nodeName string) []*PodInfo
- func (c *Client) GetVPCIndex() *VPCIndex
- func (c *Client) GetVolumesForNode(nodeName string) []cloudtypes.Volume
- func (c *Client) RegisterHandlers(factory informers.SharedInformerFactory)
- func (c *Client) RegisterKubernetesChangeListener(l KubernetesChangeEventListener)
- func (c *Client) RegisterPodsHandlers(factory informers.SharedInformerFactory)
- func (c *Client) Run(ctx context.Context) error
- func (c *Client) SetCloudProvider(provider cloudtypes.Type)
- func (c *Client) SetVPCIndex(vpcIndex *VPCIndex)
- func (c *Client) SetVolumeIndex(volumeIndex *VolumeIndex)
- func (c *Client) UnregisterKubernetesChangeListener(l KubernetesChangeEventListener)
- type ClusterInfo
- type DeleteListener
- type EventType
- type IPEndpoint
- type IPInfo
- type IPVPCInfo
- type ImageDetails
- type Index
- type KubernetesChangeEventListener
- type NodeStatsSummary
- type Object
- type PodInfo
- type PodLogProvider
- type Server
- func (s *Server) GetCloudVolumes(ctx context.Context, req *kubepb.GetCloudVolumesRequest) (*kubepb.GetCloudVolumesResponse, error)
- func (s *Server) GetClusterInfo(ctx context.Context, req *kubepb.GetClusterInfoRequest) (*kubepb.GetClusterInfoResponse, error)
- func (s *Server) GetIPInfo(ctx context.Context, req *kubepb.GetIPInfoRequest) (*kubepb.GetIPInfoResponse, error)
- func (s *Server) GetIPsInfo(ctx context.Context, req *kubepb.GetIPsInfoRequest) (*kubepb.GetIPsInfoResponse, error)
- func (s *Server) GetNode(ctx context.Context, req *kubepb.GetNodeRequest) (*kubepb.GetNodeResponse, error)
- func (s *Server) GetNodeStatsSummary(ctx context.Context, req *kubepb.GetNodeStatsSummaryRequest) (*kubepb.GetNodeStatsSummaryResponse, error)
- func (s *Server) GetPod(ctx context.Context, req *kubepb.GetPodRequest) (*kubepb.GetPodResponse, error)
- func (s *Server) GetPodVolumes(ctx context.Context, req *kubepb.GetPodVolumesRequest) (*kubepb.GetPodVolumesResponse, error)
- type UpdateListener
- type VPCIndex
- type Version
- type VolumeIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶ added in v1.7.0
func NewServer(client *Client) kubepb.KubeAPIServer
Types ¶
type AddListener ¶ added in v1.7.0
type AddListener interface {
OnAdd(obj Object)
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetAllNodes ¶ added in v1.49.0
GetAllNodes returns all nodes currently in the index.
func (*Client) GetCloudProvider ¶ added in v1.49.0
func (c *Client) GetCloudProvider() cloudtypes.Type
func (*Client) GetClusterInfo ¶ added in v1.7.0
func (c *Client) GetClusterInfo(ctx context.Context) (*ClusterInfo, error)
func (*Client) GetKvisorAgentImageDetails ¶
func (c *Client) GetKvisorAgentImageDetails() (ImageDetails, error)
GetKvisorAgentImageDetails returns kvisor agent image details. This is used for image analyzer and kube-bench dynamic jobs to schedule using the same image.
func (*Client) GetNodeInfo ¶ added in v1.43.1
func (*Client) GetNodeStatsSummary ¶ added in v1.46.0
func (c *Client) GetNodeStatsSummary(ctx context.Context, nodeName string) (*kubepb.GetNodeStatsSummaryResponse, error)
GetNodeStatsSummary retrieves stats summary for a given node from the kubelet stats API.
func (*Client) GetOwnerUID ¶
func (*Client) GetPVByName ¶ added in v1.48.4
func (c *Client) GetPVByName(name string) (*corev1.PersistentVolume, bool)
func (*Client) GetPVCByName ¶ added in v1.48.4
func (c *Client) GetPVCByName(namespace, name string) (*corev1.PersistentVolumeClaim, bool)
func (*Client) GetPodInfo ¶ added in v1.9.2
func (*Client) GetPodsOnNode ¶ added in v1.48.4
func (*Client) GetVPCIndex ¶ added in v1.48.4
GetVPCIndex returns the VPC index if available.
func (*Client) GetVolumesForNode ¶ added in v1.49.0
func (c *Client) GetVolumesForNode(nodeName string) []cloudtypes.Volume
func (*Client) RegisterHandlers ¶
func (c *Client) RegisterHandlers(factory informers.SharedInformerFactory)
func (*Client) RegisterKubernetesChangeListener ¶
func (c *Client) RegisterKubernetesChangeListener(l KubernetesChangeEventListener)
func (*Client) RegisterPodsHandlers ¶
func (c *Client) RegisterPodsHandlers(factory informers.SharedInformerFactory)
func (*Client) SetCloudProvider ¶ added in v1.49.0
func (c *Client) SetCloudProvider(provider cloudtypes.Type)
func (*Client) SetVPCIndex ¶ added in v1.48.4
SetVPCIndex sets the VPC index for enriching external IPs with VPC metadata.
func (*Client) SetVolumeIndex ¶ added in v1.49.0
func (c *Client) SetVolumeIndex(volumeIndex *VolumeIndex)
SetVolumeIndex sets the volume index for enriching volume information with cloud metadata.
func (*Client) UnregisterKubernetesChangeListener ¶ added in v1.7.0
func (c *Client) UnregisterKubernetesChangeListener(l KubernetesChangeEventListener)
type ClusterInfo ¶ added in v1.7.0
type DeleteListener ¶ added in v1.7.0
type DeleteListener interface {
OnDelete(obj Object)
}
type IPEndpoint ¶ added in v1.7.0
type IPVPCInfo ¶ added in v1.48.4
type IPVPCInfo struct {
Zone string // filled only for AWS
Region string
CloudDomain string // filled when IP is public cloud service
}
IPVPCInfo contains network state for a specific IP address.
type ImageDetails ¶
type ImageDetails struct {
ScannerImageName string
ImagePullSecrets []corev1.LocalObjectReference
}
type Index ¶ added in v1.7.0
type Index struct {
// contains filtered or unexported fields
}
func (*Index) GetPVByName ¶ added in v1.48.4
func (i *Index) GetPVByName(name string) (*corev1.PersistentVolume, bool)
func (*Index) GetPVCByName ¶ added in v1.48.4
func (i *Index) GetPVCByName(namespace, name string) (*corev1.PersistentVolumeClaim, bool)
func (*Index) GetPodsOnNode ¶ added in v1.48.4
type NodeStatsSummary ¶ added in v1.46.0
type NodeStatsSummary struct {
Node nodeStatsJSON `json:"node"`
}
NodeStatsSummary represents the summary API response from kubelet. This matches the structure returned by /api/v1/nodes/{name}/proxy/stats/summary
type PodLogProvider ¶
type PodLogProvider interface {
GetLogReader(ctx context.Context, podNs, podName string) (io.ReadCloser, error)
}
func NewPodLogReader ¶
func NewPodLogReader(client kubernetes.Interface) PodLogProvider
type Server ¶ added in v1.7.0
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetCloudVolumes ¶ added in v1.49.0
func (s *Server) GetCloudVolumes(ctx context.Context, req *kubepb.GetCloudVolumesRequest) (*kubepb.GetCloudVolumesResponse, error)
func (*Server) GetClusterInfo ¶ added in v1.7.0
func (s *Server) GetClusterInfo(ctx context.Context, req *kubepb.GetClusterInfoRequest) (*kubepb.GetClusterInfoResponse, error)
func (*Server) GetIPInfo ¶ added in v1.7.0
func (s *Server) GetIPInfo(ctx context.Context, req *kubepb.GetIPInfoRequest) (*kubepb.GetIPInfoResponse, error)
func (*Server) GetIPsInfo ¶ added in v1.45.0
func (s *Server) GetIPsInfo(ctx context.Context, req *kubepb.GetIPsInfoRequest) (*kubepb.GetIPsInfoResponse, error)
func (*Server) GetNode ¶ added in v1.43.1
func (s *Server) GetNode(ctx context.Context, req *kubepb.GetNodeRequest) (*kubepb.GetNodeResponse, error)
func (*Server) GetNodeStatsSummary ¶ added in v1.46.0
func (s *Server) GetNodeStatsSummary(ctx context.Context, req *kubepb.GetNodeStatsSummaryRequest) (*kubepb.GetNodeStatsSummaryResponse, error)
func (*Server) GetPod ¶ added in v1.7.0
func (s *Server) GetPod(ctx context.Context, req *kubepb.GetPodRequest) (*kubepb.GetPodResponse, error)
func (*Server) GetPodVolumes ¶ added in v1.48.4
func (s *Server) GetPodVolumes(ctx context.Context, req *kubepb.GetPodVolumesRequest) (*kubepb.GetPodVolumesResponse, error)
type UpdateListener ¶ added in v1.7.0
type UpdateListener interface {
OnUpdate(obj Object)
}
type VPCIndex ¶ added in v1.48.4
type VPCIndex struct {
// contains filtered or unexported fields
}
func NewVPCIndex ¶ added in v1.48.4
NewVPCIndex creates a new VPC index.
func (*VPCIndex) CloudServiceCIDRs ¶ added in v1.48.4
func (*VPCIndex) Update ¶ added in v1.48.4
func (vi *VPCIndex) Update(state *cloudtypes.NetworkState) error
Update updates the VPC state and rebuilds the CIDR tree.
type Version ¶
func GetVersion ¶
func GetVersion(clientset kubernetes.Interface) (Version, error)
type VolumeIndex ¶ added in v1.49.0
type VolumeIndex struct {
// contains filtered or unexported fields
}
VolumeIndex maintains a mapping of node names to cloud volumes.
func NewVolumeIndex ¶ added in v1.49.0
func NewVolumeIndex(log *logging.Logger) *VolumeIndex
NewVolumeIndex creates a new volume index.
func (*VolumeIndex) GetVolumesForNode ¶ added in v1.49.0
func (i *VolumeIndex) GetVolumesForNode(nodeName string) []cloudtypes.Volume
GetVolumesForNode returns volumes attached to a specific node.
func (*VolumeIndex) UpdateNodeVolumes ¶ added in v1.49.0
func (i *VolumeIndex) UpdateNodeVolumes(nodeToVolumes map[string][]cloudtypes.Volume)
Update replaces the entire volume index with a new mapping.