Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶ added in v0.25.2
type Env string
dev/production env detection, copied from Tilt
const ( EnvUnknown Env = "unknown" EnvGKE Env = "gke" EnvMinikube Env = "minikube" EnvDockerDesktop Env = "docker-for-desktop" EnvMicroK8s Env = "microk8s" EnvCRC Env = "crc" EnvKrucible Env = "krucible" // Kind v0.6 substantially changed the protocol for detecting and pulling, // so we represent them as two separate envs. EnvKIND5 Env = "kind-0.5-" EnvKIND6 Env = "kind-0.6+" EnvK3D Env = "k3d" EnvRancherDesktop Env = "rancher-desktop" EnvNone Env = "none" // k8s not running (not neces. a problem, e.g. if using Tilt x Docker Compose) )
type K8s ¶
type K8s struct { Clientset coreClient.Interface MetricsClientSet *metricsClient.Clientset RestConfig *restClient.Config // contains filtered or unexported fields }
K8s struct holds the instance of clientset and metrics clisentset
func NewK8s ¶
NewK8s will provide a new k8s client interface resolves where it is running whether inside the kubernetes cluster or outside While running outside of the cluster, tries to make use of the kubeconfig file While running inside the cluster resolved via pod environment uses the in-cluster config
func (*K8s) CurrentContext ¶ added in v0.25.1
func (*K8s) GetNamespace ¶
GetNamespace will return the current namespace for the running program Checks for the user passed ENV variable POD_NAMESPACE if not available pulls the namespace from pod, if not returns ""
func (*K8s) GetVersion ¶
GetVersion returns the version of the kubernetes cluster that is running