kubernetes

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package kubernetes listens to Kubernetes for policy updates.

Package kubernetes implements kubernetes API specific helper functions.

Index

Constants

View Source
const (
	KubeEventAdded         = "ADDED"
	KubeEventDeleted       = "DELETED"
	KubeEventModified      = "MODIFIED"
	InternalEventDeleteAll = "_DELETE_ALL"
)

Variables

This section is empty.

Functions

func CreateDefaultPolicy added in v0.9.0

func CreateDefaultPolicy(o KubeObject, l *kubeListener)

func CreateSchema added in v0.9.0

func CreateSchema(rootServiceURL string, overwrite bool) error

CreateSchema is placeholder for now.

func CreateTenant

func CreateTenant(name string) error

CreateTenant creates kubernetes specific tenant corresponding to the name given.

func GetTenantName

func GetTenantName(uid string) (string, error)

GetTenantName returns kubernetes tenant name corresponding to the UUID being used in romana tenants.

func GetTenantUUID

func GetTenantUUID(name string) (string, error)

GetTenantUUID returns kubernetes tenant UUID corresponding to the name.

func Run added in v0.9.0

func Run(rootServiceURL string, cred *common.Credential) (*common.RestServiceInfo, error)

Run configures and runs listener service.

func TenantExists

func TenantExists(name string) bool

TenantExists returns true/false depending on kubernetes tenant name or uuid exists.

Types

type Done added in v0.9.0

type Done struct{}

Done is an alias for empty struct, used to make broadcast channels for terminating goroutines.

type Event added in v0.9.0

type Event struct {
	Type   string     `json:"Type"`
	Object KubeObject `json:"object"`
}

Event is a representation of a structure that we receive from kubernetes API.

type FromEntry added in v0.9.0

type FromEntry struct {
	Pods PodSelector `json:"podSelector"`
}

type Ingress added in v0.9.2

type Ingress struct {
	From    []FromEntry `json:"from"`
	ToPorts []ToPort    `json:"ports"`
}

type KubeObject added in v0.9.0

type KubeObject struct {
	Kind       string            `json:"kind"`
	Spec       Spec              `json:"spec"`
	ApiVersion string            `json:"apiVersion"`
	Metadata   Metadata          `json:"metadata"`
	Status     map[string]string `json:"status,omitempty"`
}

KubeObject is a representation of object in kubernetes.

type Metadata added in v0.9.0

type Metadata struct {
	Name              string            `json:"name"`
	Namespace         string            `json:"namespace"`
	SelfLink          string            `json:"selfLink"`
	Uid               string            `json:"uid"`
	ResourceVersion   string            `json:"resourceVersion"`
	CreationTimestamp string            `json:"creationTimestamp"`
	Labels            map[string]string `json:"labels"`
	Annotations       map[string]string `json:"annotations,omitempty"`
}

Metadata is a representation of metadata in kubernetes object

type PodSelector added in v0.9.0

type PodSelector struct {
	MatchLabels map[string]string `json:"matchLabels"`
}

type Spec added in v0.9.0

type Spec struct {
	Ingress     []Ingress   `json:"ingress"`
	PodSelector PodSelector `json:"podSelector"`
}

TODO need to find a way to use different specs for different resources.

type ToPort added in v0.9.0

type ToPort struct {
	Port     uint   `json:"port"`
	Protocol string `json:"protocol"`
}

Directories

Path Synopsis
Main entry point for Kubernetes listener
Main entry point for Kubernetes listener

Jump to

Keyboard shortcuts

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