kubernetes

package
v0.0.0-...-9ee3051 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENDPOINT_WEIGHT_ANNOTATION = "demo.envoy.weight"
	ENVOY_PROXY_ANNOTATION     = "demo.envoy.proxy"
	ENVOY_ENABLE_ANNOTATION    = "demo.envoy.enabled"
	DEFAULT_WEIGHT             = 100

	APP_NAMESPACE         = "default"
	APP_PORT              = 9080
	CONTROL_PLANE_PORT    = 15010
	CONTROL_PLANE_SERVICE = "envoy-demo"
	MANAGE_PORT           = 15000
	ENVOY_LISTEN_PORT     = 10000
	PROXY_UID             = 1337
	ZIPKIN_SERVICE        = "zipkin"
	ZIPKIN_PORT           = 9411
)

Variables

View Source
var (
	DemoAppSet = map[string]uint32{
		"productpage": APP_PORT,
		"reviews":     APP_PORT,
		"ratings":     APP_PORT,
		"details":     APP_PORT,
	}
)

Functions

func GetLabelValueUInt32

func GetLabelValueUInt32(value string) uint32

Types

type K8sResourceManager

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

func NewK8sResourceManager

func NewK8sResourceManager() (*K8sResourceManager, error)

func (*K8sResourceManager) GetPodAnnotation

func (manager *K8sResourceManager) GetPodAnnotation(key string, podInfo *PodInfo) (string, error)

func (*K8sResourceManager) GetServiceClusterIP

func (manager *K8sResourceManager) GetServiceClusterIP(name string, namespace string) (string, error)

func (*K8sResourceManager) PodExists

func (manager *K8sResourceManager) PodExists(name string, ns string) (bool, error)

func (*K8sResourceManager) SetPodAnnotation

func (manager *K8sResourceManager) SetPodAnnotation(annotations map[string]string, podInfo *PodInfo) error

func (*K8sResourceManager) WatchPods

func (manager *K8sResourceManager) WatchPods(stopper chan struct{}, handlers ...PodEventHandler)

type PodEventHandler

type PodEventHandler interface {
	PodValid(pod *PodInfo) bool
	PodAdded(pod *PodInfo)
	PodDeleted(pod *PodInfo)
	PodUpdated(oldPod, newPod *PodInfo)
}

type PodInfo

type PodInfo struct {
	ResourceVersion string
	Name            string
	Namespace       string
	PodIP           string
	HostIP          string
	Annotations     map[string]string
	Labels          map[string]string
	HostNetwork     bool
	Containers      []string
	ContainerPorts  []uint32
}

func NewPodInfo

func NewPodInfo(pod *v1.Pod) *PodInfo

func (*PodInfo) App

func (pod *PodInfo) App() string

func (*PodInfo) EnvoyAnnotated

func (pod *PodInfo) EnvoyAnnotated() bool

func (*PodInfo) EnvoyDockerId

func (pod *PodInfo) EnvoyDockerId() string

func (*PodInfo) String

func (pod *PodInfo) String() string

func (*PodInfo) Weight

func (pod *PodInfo) Weight() uint32

type WebhookServer

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

func NewWebhookServer

func NewWebhookServer() *WebhookServer

func (*WebhookServer) Mutate

func (*WebhookServer) Process

func (server *WebhookServer) Process(resp http.ResponseWriter, req *http.Request)

func (*WebhookServer) Run

func (server *WebhookServer) Run()

Jump to

Keyboard shortcuts

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