Documentation ¶
Overview ¶
Package k8sinfo used to create k8s client and get some k8s info
Index ¶
- func MatchLabel(selector, labels map[string]string) bool
- type K8sClient
- func (c *K8sClient) GetDeployment(ns string) (map[string]*K8sDeployment, error)
- func (c *K8sClient) GetEndpointNet(ns string) (map[string]*K8sEndpointsNet, error)
- func (c *K8sClient) GetNamespaces() ([]string, error)
- func (c *K8sClient) GetPodNet(ns string) (map[string][]*K8sPodNet, error)
- func (c *K8sClient) GetServiceNet(ns string) (map[string]*K8sServicesNet, error)
- type K8sDeployment
- type K8sEndpointsNet
- type K8sNetInfo
- func (kinfo *K8sNetInfo) AutoUpdate(ctx context.Context)
- func (kinfo *K8sNetInfo) IsServer(srcIP string, srcPort uint32, protocol string) bool
- func (kinfo *K8sNetInfo) QueryPodInfo(ip string, port uint32, protocol string) (string, string, string, string, error)
- func (kinfo *K8sNetInfo) QuerySvcInfo(ip string, port uint32, protocol string) (string, string, string, error)
- func (kinfo *K8sNetInfo) Update() error
- type K8sPodNet
- type K8sServicesNet
- type Port
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchLabel ¶
Types ¶
type K8sClient ¶
type K8sClient struct {
*kubernetes.Clientset
}
func (*K8sClient) GetDeployment ¶
func (c *K8sClient) GetDeployment(ns string) (map[string]*K8sDeployment, error)
func (*K8sClient) GetEndpointNet ¶
func (c *K8sClient) GetEndpointNet(ns string) (map[string]*K8sEndpointsNet, error)
func (*K8sClient) GetNamespaces ¶
func (*K8sClient) GetServiceNet ¶
func (c *K8sClient) GetServiceNet(ns string) (map[string]*K8sServicesNet, error)
type K8sDeployment ¶
type K8sEndpointsNet ¶
type K8sNetInfo ¶
func NewK8sNetInfo ¶
func NewK8sNetInfo(cli *K8sClient) (*K8sNetInfo, error)
func (*K8sNetInfo) AutoUpdate ¶
func (kinfo *K8sNetInfo) AutoUpdate(ctx context.Context)
func (*K8sNetInfo) IsServer ¶
func (kinfo *K8sNetInfo) IsServer(srcIP string, srcPort uint32, protocol string) bool
func (*K8sNetInfo) QueryPodInfo ¶
func (kinfo *K8sNetInfo) QueryPodInfo(ip string, port uint32, protocol string) ( string, string, string, string, error, )
QueryPodInfo returns pod name, svc name, namespace, deployment,port, err).
func (*K8sNetInfo) QuerySvcInfo ¶
func (kinfo *K8sNetInfo) QuerySvcInfo(ip string, port uint32, protocol string) (string, string, string, error)
QuerySvcInfo returns (svc name, namespace, error).
func (*K8sNetInfo) Update ¶
func (kinfo *K8sNetInfo) Update() error
type K8sServicesNet ¶
Click to show internal directories.
Click to hide internal directories.