k8s

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps Kubernetes client-go for type-safe operations

func NewClient

func NewClient(kubeconfigPath string) (*Client, error)

NewClient creates a new Kubernetes client If kubeconfigPath is empty, it tries standard locations: 1. ~/.kube/config 2. /etc/rancher/k3s/k3s.yaml (k3s default)

func NewClientFromConfig

func NewClientFromConfig(config *rest.Config) (*Client, error)

NewClientFromConfig creates a client from rest.Config

func (*Client) ApplyManifest

func (c *Client) ApplyManifest(ctx context.Context, url string) error

ApplyManifest applies a manifest from URL using server-side apply

func (*Client) ApplyManifestBytes

func (c *Client) ApplyManifestBytes(ctx context.Context, data []byte) error

ApplyManifestBytes applies a YAML/JSON manifest already in memory.

func (*Client) ApplyManifestFromFile

func (c *Client) ApplyManifestFromFile(ctx context.Context, filePath string) error

ApplyManifestFromFile applies a manifest from a local file

func (*Client) ApplyManifestsFromDirectory

func (c *Client) ApplyManifestsFromDirectory(ctx context.Context, dirPath string) error

ApplyManifestsFromDirectory applies all YAML files from a directory

func (*Client) GetClientset

func (c *Client) GetClientset() kubernetes.Interface

GetClientset returns the underlying Kubernetes clientset

func (*Client) GetConfig

func (c *Client) GetConfig() *rest.Config

GetConfig returns the underlying REST config

func (*Client) WaitForAPI

func (c *Client) WaitForAPI(ctx context.Context) error

WaitForAPI waits for Kubernetes API to be ready

func (*Client) WaitForNodes

func (c *Client) WaitForNodes(ctx context.Context, count int, timeout time.Duration) error

WaitForNodes waits for nodes to be ready

func (*Client) WaitForPod

func (c *Client) WaitForPod(ctx context.Context, namespace, podName string, timeout time.Duration) error

WaitForPod waits for a pod to be ready

func (*Client) WaitForRollout

func (c *Client) WaitForRollout(ctx context.Context, namespace, deployment string, timeout time.Duration) error

WaitForRollout waits for a deployment rollout to complete

Jump to

Keyboard shortcuts

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