Help us shape the future of Go! Take the 2026 Go Developer Survey

k8s

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeapiSubsystemName           = "kubernetes-api"
	KubeapiClientCheckDescription  = "can initialize the client"
	KubeapiAccessCheckDescription  = "can query the Kubernetes API"
	KubeapiVersionCheckDescription = "is running the minimum Kubernetes API version"
)
View Source
const (
	KubernetesDeployments = "deployments"
	KubernetesPods        = "pods"
)
View Source
const (

	// ControllerComponentLabel identifies this object as a component of Conduit's
	// control plane (e.g. web, controller).
	ControllerComponentLabel = "conduit.io/control-plane-component"

	// ControllerNSLabel is injected into mesh-enabled apps, identifying the
	// namespace of the Conduit control plane.
	ControllerNSLabel = "conduit.io/control-plane-ns"

	// CreatedByAnnotation indicates the source of the injected data plane
	// (e.g. conduit/cli v0.1.3).
	CreatedByAnnotation = "conduit.io/created-by"

	// ProxyVersionAnnotation indicates the version of the injected data plane
	// (e.g. v0.1.3).
	ProxyVersionAnnotation = "conduit.io/proxy-version"
)

Variables

This section is empty.

Functions

func CanonicalKubernetesNameFromFriendlyName

func CanonicalKubernetesNameFromFriendlyName(friendlyName string) (string, error)

CanonicalKubernetesNameFromFriendlyName returns a canonical name from common shorthands used in command line tools. This works based on https://github.com/kubernetes/kubernetes/blob/63ffb1995b292be0a1e9ebde6216b83fc79dd988/pkg/kubectl/kubectl.go#L39

func CreatedByAnnotationValue added in v0.3.0

func CreatedByAnnotationValue() string

CreatedByAnnotationValue returns the value associated with CreatedByAnnotation.

Types

type KubernetesApi

type KubernetesApi interface {
	UrlFor(namespace string, extraPathStartingWithSlash string) (*url.URL, error)
	NewClient() (*http.Client, error)
	healthcheck.StatusChecker
}

func NewK8sAPI

func NewK8sAPI(homedir string, k8sConfigFilesystemPathOverride string) (KubernetesApi, error)

NewK8sAPI returns a new KubernetesApi interface

type KubernetesProxy added in v0.3.0

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

func InitK8sProxy added in v0.3.0

func InitK8sProxy(homedir string, k8sConfigFilesystemPathOverride string, proxyPort int) (*KubernetesProxy, error)

InitK8sProxy initalizes a KubernetesProxy object and starts listening on a network address.

func (*KubernetesProxy) Run added in v0.3.0

func (kp *KubernetesProxy) Run() error

Run starts proxying a connection to Kubernetes, and blocks until the process exits.

func (*KubernetesProxy) URLFor added in v0.3.0

func (kp *KubernetesProxy) URLFor(namespace string, extraPathStartingWithSlash string) (*url.URL, error)

URLFor generates a URL based on the configured KubernetesProxy.

type MockKubeApi

type MockKubeApi struct {
	SelfCheckResultsToReturn              []*healthcheckPb.CheckResult
	UrlForNamespaceReceived               string
	UrlExtraPathStartingWithSlashReceived string
	UrlForUrlToReturn                     *url.URL
	NewClientClientToReturn               *http.Client
	ErrorToReturn                         error
}

func (*MockKubeApi) NewClient

func (m *MockKubeApi) NewClient() (*http.Client, error)

func (*MockKubeApi) SelfCheck

func (m *MockKubeApi) SelfCheck() []*healthcheckPb.CheckResult

func (*MockKubeApi) UrlFor

func (m *MockKubeApi) UrlFor(namespace string, extraPathStartingWithSlash string) (*url.URL, error)

Jump to

Keyboard shortcuts

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