kubernetes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

Repository represents a Kubernetes repository that knows how to speak with the Kubernetes API server to manage resources.

func NewRepository

func NewRepository(kcli *kubernetes.Clientset) Repository

NewRepository returns a new Kubernetes repository that will retrieve Kubernetes resources using kubernetes sdk.

func (Repository) EnsureSecret

func (r Repository) EnsureSecret(ctx context.Context, secret *corev1.Secret) error

EnsureSecret will create the secret if is missing and overwrite if already exists.

func (Repository) EnsureServiceAccount

func (r Repository) EnsureServiceAccount(ctx context.Context, sa *corev1.ServiceAccount) error

EnsureServiceAccount will create the service account if is missing and overwrite if already exists.

func (Repository) GetSecret

func (r Repository) GetSecret(ctx context.Context, ns string, name string) (*corev1.Secret, error)

GetSecret will return a secret from Kubernets API server.

func (Repository) GetServiceAccount

func (r Repository) GetServiceAccount(ctx context.Context, ns string, name string) (*corev1.ServiceAccount, error)

GetServiceAccount will return a service account from Kubernets API server.

func (Repository) ListNamespaces

func (r Repository) ListNamespaces(ctx context.Context, labelSelector map[string]string) (*corev1.NamespaceList, error)

ListNamespaces will list Kubernetes namespaces from the API server.

func (Repository) WatchNamespaces

func (r Repository) WatchNamespaces(ctx context.Context, labelSelector map[string]string) (watch.Interface, error)

WatchNamespaces will return a Kubernetes watcher to subscribe to namespaces changes.

Jump to

Keyboard shortcuts

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