kube

package
v0.0.0-...-026fc6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	kubernetes.Interface
}

Client implements methods to get K8s resources

func NewClient

func NewClient() (*Client, error)

NewClient returns new Client object

func (*Client) BuildGraph

func (c *Client) BuildGraph(ctx context.Context, namespace string) ([]Relation, error)

BuildGraph returns relation schema between workloads as per the network policies

func (*Client) GetNamespaces

func (c *Client) GetNamespaces(ctx context.Context) ([]string, error)

GetNamespaces returns list of K8s namespaces

func (*Client) GetWorkloads

func (c *Client) GetWorkloads(ctx context.Context, namespace string) ([]Workload, error)

GetWorkloads returns list of K8s workloads - deployments and statefulsets in a namespace

type Relation

type Relation struct {
	Node      Workload
	Connected []Workload
}

Relation represents relation between workloads

type Workload

type Workload struct {
	Name          string
	Namespace     string
	Kind          string
	Labels        map[string]string
	Ports         []string
	NetworkPolicy string
}

Workload contains Kubernets workload details

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL