k8sutil

package
v0.0.0-...-b2e8fec Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sutilInterface

type K8sutilInterface struct {
	Kclient    KubeInterface
	MasterHost string
}

func New

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

New creates a new instance of k8sutil

func (*K8sutilInterface) CreateSecret

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

CreateSecret creates a secret

func (*K8sutilInterface) GetNamespaces

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

GetNamespaces returns all namespaces

func (*K8sutilInterface) GetSecret

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

GetSecret get a secret

func (*K8sutilInterface) GetServiceAccount

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

GetServiceAccount updates a secret

func (*K8sutilInterface) UpdateSecret

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

UpdateSecret updates a secret

func (*K8sutilInterface) UpdateServiceAccount

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

UpdateServiceAccount updates a secret

func (*K8sutilInterface) WatchNamespaces

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

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

Jump to

Keyboard shortcuts

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