gk8s

package module
v0.0.0-...-fe85fc4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create[T Resource](apiClient kubernetes.Interface, namespace string, spec T, opt metav1.CreateOptions) (T, error)

func DecodeInto

func DecodeInto[T Resource](data []byte, into T) error

func DecodeIntoString

func DecodeIntoString[T Resource](input string, into T) error

func Delete

func Delete[T Resource](apiClient kubernetes.Interface, namespace, name string, opt metav1.DeleteOptions) error

func Get

func Get[T Resource](apiClient kubernetes.Interface, namespace, name string, opt metav1.GetOptions) (T, error)

func List

func List[T Resource](apiClient kubernetes.Interface, namespace string, opt metav1.ListOptions) ([]T, error)

func PrintJSON

func PrintJSON[T Resource](obj T, w io.Writer) error

func PrintYAML

func PrintYAML[T Resource](obj T, w io.Writer) error

Types

type Config

type Config struct {
	RestConfig *rest.Config
	APIClient  kubernetes.Interface
}

func FromEKS

func FromEKS(clusterName string) (*Config, error)

FromEKS - Init K8s Client with AWS shared-credentials-file and cluster name

func FromKubeConfig

func FromKubeConfig() (*Config, error)

FromKubeConfig - Init K8s Client with kubeconfig file $USER/.kube/config

func FromKubeConfigPath

func FromKubeConfigPath(path string) (*Config, error)

FromKubeConfigPath - Init K8s Client with specific kubeconfig file

func FromRestConfig

func FromRestConfig(config *rest.Config) (*Config, error)

FromRestConfig - Init K8s Client with rest configuration

func InCluster

func InCluster() (*Config, error)

InCluster - Init K8s Client with in cluster credentials

type Resource

type Resource interface {
	runtime.Object
	metav1.Object
}

Jump to

Keyboard shortcuts

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