k8s

package
v1.7.0 Latest Latest
Warning

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

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

Documentation

Overview

Package k8s contains a client for accessing the kubernetes API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKubeConfig

func GetKubeConfig() string

GetKubeConfig returns the kubeconfig.

Types

type Client

type Client interface {
	Config() *rest.Config
	Namespace() string
	ClientSet() kubernetes.Interface
	APIExtensionClientSet() apiextension.Interface
	APIRegistrationClientSet() aggregator.Interface
	MetricsClientSet() metrics.Interface
	DynamicClientSet() dynamic.Interface
	MeshExists() (bool, error)
	HelmAction(namespace string) (*action.Configuration, error)
}

Client is a k8s client wrapper for interacting with mesh objects.

type ClientImpl

type ClientImpl struct {
	Clientset             kubernetes.Interface
	HelmInvoker           HelmWrapper
	APIExtensionClientset apiextension.Interface
	// contains filtered or unexported fields
}

ClientImpl contains the configuration and clients for a Kubernetes cluster.

func NewK8SClient

func NewK8SClient(kubeconfig, namespace string) (*ClientImpl, error)

NewK8SClient creates a mesh K8s client from a kubeconfig and control plane namespace.

func (*ClientImpl) APIExtensionClientSet

func (k *ClientImpl) APIExtensionClientSet() apiextension.Interface

APIExtensionClientSet returns the APIExtensionClientSet interface.

func (*ClientImpl) APIRegistrationClientSet

func (k *ClientImpl) APIRegistrationClientSet() aggregator.Interface

APIRegistrationClientSet returns the APIRegistrationClientSet interface.

func (*ClientImpl) ClientSet

func (k *ClientImpl) ClientSet() kubernetes.Interface

ClientSet returns the ClientSet interface.

func (*ClientImpl) Config

func (k *ClientImpl) Config() *rest.Config

Config returns a k8s rest.Config object.

func (*ClientImpl) DynamicClientSet

func (k *ClientImpl) DynamicClientSet() dynamic.Interface

DynamicClientSet returns the DynamicClientset interface.

func (*ClientImpl) HelmAction

func (k *ClientImpl) HelmAction(namespace string) (*action.Configuration, error)

HelmAction builds an action configuration for helm requests.

func (*ClientImpl) MeshExists

func (k *ClientImpl) MeshExists() (bool, error)

MeshExists returns if the mesh exists or not.

func (*ClientImpl) MetricsClientSet

func (k *ClientImpl) MetricsClientSet() metrics.Interface

MetricsClientSet returns the MetricsClientset interface.

func (*ClientImpl) Namespace

func (k *ClientImpl) Namespace() string

Namespace returns the control plane namespace.

type HelmInvoker

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

HelmInvoker is a struct that satisfies HelmWrapper.

func (*HelmInvoker) HelmAction

func (hi *HelmInvoker) HelmAction(namespace string) (*action.Configuration, error)

HelmAction builds an action configuration for helm requests.

type HelmWrapper

type HelmWrapper interface {
	HelmAction(namespace string) (*action.Configuration, error)
}

HelmWrapper wraps the HelmAction function as an interface.

func NewHelmInvoker

func NewHelmInvoker(kubeconfig, namespace string, deferredClientConfig clientcmd.ClientConfig) HelmWrapper

NewHelmInvoker returns a HelmInvoker satisfying the HelmWrapper Interface.

Directories

Path Synopsis
Package fake provides a fake k8s client implementation.
Package fake provides a fake k8s client implementation.

Jump to

Keyboard shortcuts

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