kubernetes

package
v0.0.0-...-ce22054 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKubernetesClient

func CreateKubernetesClient() (*kubernetes.Clientset, error)

CreateKubernetesClient returns Kubernetes client for in cluster use

func CreateLocalKubernetesClient

func CreateLocalKubernetesClient() (*kubernetes.Clientset, error)

CreateLocalKubernetesClient returns Kubernetes client for local use

Types

type Chart

type Chart struct {
	Release   string
	Chart     string
	Namespace string
	Version   string
}

Chart contains Helm chart info

type Helm

type Helm interface {
	GetHelmChartInfoFromNamespaces(ctx context.Context, namespaces []string) ([]Chart, error)
}

Helm is an interface that wraps calls to Kubernetes cluster for fetching Helm information

func NewHelmClient

func NewHelmClient(local bool) (Helm, error)

NewHelmClient is used to construct access to Kubernetes cluster for Helm It returns an implementation of the Helm client represented as the Helm interface

type Image

type Image struct {
	FullPath string
	URL      string
	Name     string
	Version  string
}

Image holds the Docker image information of the container running in the cluster

func ImagePathToImage

func ImagePathToImage(imagePath string) (Image, error)

ImagePathToImage converts image string to container information In case of an error it returns an empty Image

func (Image) WithoutLibrary

func (c Image) WithoutLibrary() string

WithoutLibrary returns the Image name without Docker prefix 'library' when using single name Docker repo like ubuntu, etc..

type Kube

type Kube interface {
	GetImagesFromNamespaces(ctx context.Context, namespaces []string) ([]Image, error)
	GetAllNamespaces(ctx context.Context) ([]string, error)
	GetImagePathsFromPods(ctx context.Context, namespace string) ([]string, error)
}

Kube is an interface that wraps calls to Kubernetes cluster

func NewKubeClient

func NewKubeClient(local bool) (Kube, error)

NewKubeClient is used to construct access to Kubernetes cluster It returns an implementation of the Kubernetes client represented as the Kube interface

Jump to

Keyboard shortcuts

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