client

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2024 Defense Unicorns SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial Package k8s contains k8s client logic

Index

Constants

This section is empty.

Variables

View Source
var ServerCheck = func(k8sClient *Clients) error {
	_, err := k8sClient.Clientset.ServerVersion()
	return err
}

Functions

func Contexts added in v0.9.0

func Contexts() (map[string]*clientCmdAPI.Context, error)

func CurrentContext added in v0.9.0

func CurrentContext() (string, string, error)

CurrentContext returns the current context defined in the kubeconfig

func IsRunningInCluster

func IsRunningInCluster() (bool, error)

IsRunningInCluster checks if the application is running in cluster

func ServeClusters added in v0.9.0

func ServeClusters(inCluster bool, currentContext string) http.HandlerFunc

Types

type Clients

type Clients struct {
	Clientset     *kubernetes.Clientset
	MetricsClient *metricsv.Clientset
	Config        *rest.Config
}

Clients holds the various Kubernetes clients

func New added in v0.9.0

func New(overrides *clientcmd.ConfigOverrides) (*Clients, error)

New creates a Kubernetes cluster client with the option of overriding the default config

type ClusterInfo added in v0.9.0

type ClusterInfo struct {
	Name     string `json:"name"`
	Context  string `json:"context"`
	Selected bool   `json:"selected"`
}

Jump to

Keyboard shortcuts

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