k8s

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SidecarContainerName = "envoy-sidecar"
)

Annotation keys

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetPod returns current pod data.
	GetPod(ctx context.Context) (*corev1.Pod, error)
}

Client contains methods to access k8s API

type PodInfo

type PodInfo struct {
	*corev1.Pod
}

PodInfo describes a k8s Pod

func GetPodInfo

func GetPodInfo() (*PodInfo, error)

GetPodInfo fetches k8s PodInfo for the current Pod

func (PodInfo) FindAnnotation

func (pi PodInfo) FindAnnotation(lookupKey string) bool

FindAnnotation looks up an Annotation by key

func (PodInfo) GetAnnotation added in v0.1.17

func (pi PodInfo) GetAnnotation(lookupKey string) string

GetAnnotation looks up an Annotation by key

func (PodInfo) GetDataCenter

func (pi PodInfo) GetDataCenter() (string, error)

GetDataCenter returns a Pod's datacenter

func (PodInfo) GetDefaultPort

func (pi PodInfo) GetDefaultPort() int

GetDefaultPort returns the first available port

func (PodInfo) GetDirector

func (pi PodInfo) GetDirector() string

GetDirector looks up VaaS director name in Pod annotations

func (PodInfo) GetEnvironment

func (pi PodInfo) GetEnvironment() (string, error)

GetEnvironment returns a Pod's dev/test/prod environment

func (PodInfo) GetName added in v0.1.15

func (pi PodInfo) GetName() string

GetName retrieves Pod name form it's metadata

func (PodInfo) GetPodIP

func (pi PodInfo) GetPodIP() string

GetPodIP returns a Pod IP address

func (PodInfo) GetPorts

func (pi PodInfo) GetPorts() []*int32

GetPorts returns a Pod's ports

func (PodInfo) GetUID added in v0.1.15

func (pi PodInfo) GetUID() *string

GetUID retrieves Pod UID form it's metadata

func (PodInfo) GetVaaSURL

func (pi PodInfo) GetVaaSURL() string

GetVaaSURL returns VaaS URL

func (PodInfo) GetVaaSUser

func (pi PodInfo) GetVaaSUser() string

GetVaaSUser returns VaaS API Username

func (PodInfo) GetWeight

func (pi PodInfo) GetWeight() (int, error)

GetWeight returns a Pods Weight

Jump to

Keyboard shortcuts

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