README

kubemap Build Status codecov GitHub release

Map relevant k8s resources to single common label

Expand ▾ Collapse ▴

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildSet

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

ChildSet ...

type IngressSet

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

IngressSet ...

type Kube

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

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

Logger ...

type LoggingOptions

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

LoggingOptions ...

type MapOptions

type MapOptions struct {
	Logging LoggingOptions
}

MapOptions allows to instantiate new Mapper with custom options

type MapResult

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

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

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

func NewStoreMapper

func NewStoreMapper(store cache.Store) *Mapper

NewStoreMapper created a mapper that works with existing store.

func NewStoreMapperWithOptions

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

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

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

func (*Mapper) StoreMapObj

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

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

type MetaIdentifier

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

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

MetaSet ...

type ResourceEvent

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

ResourceEvent ...