k8sutil

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeInterface

type KubeInterface interface {
	Secrets(namespace string) coreType.SecretInterface
	Namespaces() coreType.NamespaceInterface
	ServiceAccounts(namespace string) coreType.ServiceAccountInterface
	Core() coreType.CoreV1Interface
}

KubeInterface abstracts the k8s api

type UtilInterface

type UtilInterface struct {
	Kclient    KubeInterface
	MasterHost string
	Log        logrus.FieldLogger
}

UtilInterface is the struct behind

func New

func New(kubeCfgFile, masterHost string) (*UtilInterface, error)

New creates a new instance of k8sutil

func (*UtilInterface) CreateSecret

func (k *UtilInterface) CreateSecret(namespace string, secret *v1.Secret) error

CreateSecret creates a secret

func (*UtilInterface) GetNamespaces

func (k *UtilInterface) GetNamespaces() (*v1.NamespaceList, error)

GetNamespaces returns all namespaces

func (*UtilInterface) GetSecret

func (k *UtilInterface) GetSecret(namespace, secretname string) (*v1.Secret, error)

GetSecret get a secret

func (*UtilInterface) GetServiceAccount

func (k *UtilInterface) GetServiceAccount(namespace, name string) (*v1.ServiceAccount, error)

GetServiceAccount updates a secret

func (*UtilInterface) UpdateSecret

func (k *UtilInterface) UpdateSecret(namespace string, secret *v1.Secret) error

UpdateSecret updates a secret

func (*UtilInterface) UpdateServiceAccount

func (k *UtilInterface) UpdateServiceAccount(namespace string, sa *v1.ServiceAccount) error

UpdateServiceAccount updates a secret

func (*UtilInterface) WatchNamespaces

func (k *UtilInterface) WatchNamespaces(resyncPeriod time.Duration, handler func(*v1.Namespace) error)

Jump to

Keyboard shortcuts

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