k8s

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const WatchNamespaceEnvVar = "WATCH_NAMESPACE"

Variables

This section is empty.

Functions

func AddLabel

func AddLabel(obj client.Object, key, value string)

func ConfigMap

func ConfigMap(name, namespace, filename, data string) *corev1.ConfigMap

func DefaultAPINamespace

func DefaultAPINamespace() (string, error)

DefaultAPINamespace returns namespace for direct api access from a pod https://v1-21.docs.kubernetes.io/docs/tasks/run-application/access-api-from-pod/#directly-accessing-the-rest-api

func ExecProbe added in v0.2.0

func ExecProbe(probe corev1.Probe, cmd []string) *corev1.Probe

func GetWatchNamespace

func GetWatchNamespace() (string, error)

GetWatchNamespace returns the namespace the operator should be watching for changes

func InitImage

func InitImage(ctx context.Context, cl client.Reader) (string, error)

func IsPodReady

func IsPodReady(pod corev1.Pod) bool

func LabelsEqual

func LabelsEqual(old, new metav1.Object) bool

func ObjectExists

func ObjectExists(ctx context.Context, cl client.Reader, nn types.NamespacedName, o client.Object) (bool, error)

func ObjectHash

func ObjectHash(obj runtime.Object) (string, error)

func OperatorImage added in v0.2.0

func OperatorImage(ctx context.Context, cl client.Reader) (string, error)

func PodsByLabels

func PodsByLabels(ctx context.Context, cl client.Reader, l map[string]string) ([]corev1.Pod, error)

func RemoveLabel

func RemoveLabel(obj client.Object, key string)

func RolloutRestart

func RolloutRestart(ctx context.Context, cl client.Client, obj runtime.Object, key apiv1alpha1.AnnotationKey, value string) error

RolloutRestart restarts pods owned by object by updating the pod template with passed annotation key-value.

func SecretKeySelector

func SecretKeySelector(name, key string) *corev1.SecretKeySelector

SecretKeySelector is a k8s helper to create SecretKeySelector object

func ServicesByLabels

func ServicesByLabels(ctx context.Context, cl client.Reader, l map[string]string) ([]corev1.Service, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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