k8s

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package k8s provides an interface to interact with Kubernetes resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

Controller is a Kubernetes controller.

func NewController

func NewController(opts ...Option) (*Controller, error)

NewController creates a new Kubernetes controller.

func (*Controller) CreateResource

func (c *Controller) CreateResource(ctx context.Context, namespace string, resource *unstructured.Unstructured, opts metav1.CreateOptions) (*unstructured.Unstructured, error)

CreateResource creates a resource in the Kubernetes cluster.

func (*Controller) CreateSecret

func (c *Controller) CreateSecret(ctx context.Context, namespace string, secret *coreV1.Secret, opts metav1.CreateOptions) (*unstructured.Unstructured, error)

CreateSecret creates a secret in the Kubernetes cluster.

func (*Controller) GetResource

func (c *Controller) GetResource(ctx context.Context, namespace, name string, resource schema.GroupVersionKind, opts metav1.GetOptions) (*unstructured.Unstructured, error)

GetResource gets a resource from the Kubernetes cluster.

func (*Controller) UpdateResource

func (c *Controller) UpdateResource(ctx context.Context, namespace string, resource *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error)

UpdateResource updates a resource in the Kubernetes cluster.

type Option

type Option = func(*Controller)

Option is a functional option for the Controller.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the timeout for the controller.

Jump to

Keyboard shortcuts

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