k8s

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ManagedByLabelKey is Kubernetes recommended label key, it represents the tool being used to manage the operation of an application
	// For resources managed by SeaweedFS Operator, its value is always seaweedfs-operator
	ManagedByLabelKey string = "app.kubernetes.io/managed-by"
	// ComponentLabelKey is Kubernetes recommended label key, it represents the component within the architecture
	ComponentLabelKey string = "app.kubernetes.io/component"
	// NameLabelKey is Kubernetes recommended label key, it represents the name of the application
	NameLabelKey string = "app.kubernetes.io/name"
	// InstanceLabelKey is Kubernetes recommended label key, it represents a unique name identifying the instance of an application
	// It's set by helm when installing a release
	InstanceLabelKey string = "app.kubernetes.io/instance"
	// VersionLabelKey is Kubernetes recommended label key, it represents the version of the app
	VersionLabelKey    string = "app.kubernetes.io/version"
	VectorExcludeLabel string = "vector.dev/exclude"

	// PodName is to select pod by name
	// https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-selector
	PodName string = "statefulset.kubernetes.io/pod-name"
)

Variables

View Source
var (
	ErrNotSupported = errors.New("Not Supported type for create or update kubernetes resource")
)

Functions

func CreateOrUpdateResource added in v0.0.2

func CreateOrUpdateResource(ctx context.Context, obj client.Object, c client.Client) error

func CreatePod

func CreatePod(ctx context.Context, pod *corev1.Pod, c client.Client) error

func DeletePod

func DeletePod(ctx context.Context, pod *corev1.Pod, c client.Client) error

func DeleteSecret

func DeleteSecret(ctx context.Context, secret *corev1.Secret, c client.Client) error

func FetchPod added in v0.0.8

func FetchPod(ctx context.Context, pod *corev1.Pod, c client.Client) (*corev1.Pod, error)

func GetPod

func GetPod(ctx context.Context, namespacedName types.NamespacedName, c client.Client) (*corev1.Pod, error)

func GetPodLogs

func GetPodLogs(ctx context.Context, pod *corev1.Pod, cs kubernetes.Interface) (string, error)

func GetSecret

func GetSecret(ctx context.Context, namespacedName types.NamespacedName, c client.Client) (*corev1.Secret, error)

func NamespaceNameToLabel

func NamespaceNameToLabel(namespace string) string

func NewNotSupportedError added in v0.0.2

func NewNotSupportedError(obj client.Object) error

func UpdateStatus

func UpdateStatus(ctx context.Context, obj client.Object, c client.Client) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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