kubemap

package module
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: MIT Imports: 18 Imported by: 0

README

kubemap Build Status codecov GitHub release

Map relevant k8s resources to single common label

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildSet added in v0.2.5

type ChildSet struct {
	Name            string            `json:"name,omitempty"`
	OwnerReferences []string          `json:"ownerReferences,omitempty"`
	MatchLabels     map[string]string `json:"matchLabels,omitempty"`
}

ChildSet ...

type IngressSet added in v0.2.5

type IngressSet struct {
	Names                  []string `json:"names,omitempty"`
	IngressBackendServices []string `json:"ingressBackendServices,omitempty"`
}

IngressSet ...

type Kube added in v0.1.0

type Kube struct {
	Ingresses   []ext_v1beta1.Ingress     `json:"ingresses,omitempty"`
	Services    []core_v1.Service         `json:"services,omitempty"`
	Deployments []apps_v1beta2.Deployment `json:"deployments,omitempty"`
	ReplicaSets []ext_v1beta1.ReplicaSet  `json:"replicaSets,omitempty"`
	Pods        []core_v1.Pod             `json:"pods,omitempty"`
	Events      []core_v1.Event           `json:"events,omitempty"`
}

Kube ...

type KubeResources

type KubeResources struct {
	Ingresses   []ext_v1beta1.Ingress
	Services    []core_v1.Service
	Deployments []apps_v1beta2.Deployment
	ReplicaSets []ext_v1beta1.ReplicaSet
	Pods        []core_v1.Pod
}

KubeResources is collection of different types of k8s resource for mapping. ToDo : Add support for other k8s resources.

type Logger added in v0.2.5

type Logger struct {
	// contains filtered or unexported fields
}

Logger ...

type LoggingOptions added in v0.2.5

type LoggingOptions struct {
	Enabled bool
	//LogLevel sets type of logs viz 'info' or 'debug'.
	LogLevel string
}

LoggingOptions ...

type MapOptions added in v0.2.5

type MapOptions struct {
	Logging LoggingOptions
}

MapOptions allows to instantiate new Mapper with custom options

type MapResult added in v0.1.0

type MapResult struct {
	Key            string
	Action         string
	Message        string
	CommonLabel    string
	DeleteKeys     []string
	IsMapped       bool
	IsStoreUpdated bool
	MappedResource MappedResource
}

MapResult ...

type MappedResource

type MappedResource struct {
	CommonLabel string `json:"commonLabel,omitempty"`
	Namespace   string `json:"namespace,omitempty"`
	CurrentType string `json:"currentType,omitempty"`
	EventType   string `json:"eventType,omitempty"`
	Kube        Kube   `json:"kube,omitempty"`
}

MappedResource is final mapped output of interlinked K8s resources

type MappedResources

type MappedResources struct {
	MappedResource []MappedResource `json:"mappedResource,omitempty"`
}

MappedResources returns set of common labels consisting mapped k8s resources.

type Mapper

type Mapper struct {
	// contains filtered or unexported fields
}

Mapper hold internal store and workqueue for mapping

func NewMapper

func NewMapper() *Mapper

NewMapper creates a Mapper to map interlinked K8s resources

func NewMapperWithOptions added in v0.2.5

func NewMapperWithOptions(options MapOptions) (*Mapper, error)

NewMapperWithOptions creates a Mapper to map interlinked K8s resources with custom options

func NewStoreMapper added in v0.1.0

func NewStoreMapper(store cache.Store) *Mapper

NewStoreMapper created a mapper that works with existing store.

func NewStoreMapperWithOptions added in v0.2.5

func NewStoreMapperWithOptions(store cache.Store, options MapOptions) (*Mapper, error)

NewStoreMapperWithOptions created a mapper that works with existing store.

func (*Mapper) Map

func (m *Mapper) Map(resources KubeResources) (MappedResources, error)

Map accepts collection different k8s resources. They will be mapped to respective common label and returned

func (*Mapper) StoreMap added in v0.1.0

func (m *Mapper) StoreMap(obj interface{}) ([]MapResult, error)

StoreMap gets a resources and maps it with exiting resources in store

func (*Mapper) StoreMapObj added in v0.2.5

func (m *Mapper) StoreMapObj(obj interface{}) ([]MapResult, error)

StoreMapObj gets a resources and maps it with exiting resources in store

type MetaIdentifier added in v0.2.5

type MetaIdentifier struct {
	IngressIdentifier     IngressSet `json:"ingressIdentifier,omitempty"`
	ServicesIdentifier    MetaSet    `json:"servicesIdentifier,omitempty"`
	DeploymentsIdentifier MetaSet    `json:"deploymentsIdentifier,omitempty"`
	ReplicaSetsIdentifier []ChildSet `json:"replicaSetsIdentifier,omitempty"`
	PodsIdentifier        []ChildSet `json:"podsIdentifier,omitempty"`
}

MetaIdentifier ...

type MetaSet added in v0.2.5

type MetaSet struct {
	Names       []string            `json:"names,omitempty"`
	MatchLabels []map[string]string `json:"matchLabels,omitempty"`
}

MetaSet ...

type ResourceEvent added in v0.1.0

type ResourceEvent struct {
	UID          string
	Key          string
	EventType    string
	Namespace    string
	ResourceType string
	Name         string
	Event        interface{}
}

ResourceEvent ...

Jump to

Keyboard shortcuts

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