helper

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const LabelNodeRole = "kubernetes.io/role"
View Source
const NodeRoleKey = "kubernetes.io/role"
View Source
const (
	NodeRoleMaster = "master"
)

Variables

This section is empty.

Functions

func ArePodsAllReady

func ArePodsAllReady(pods []corev1.Pod) bool

func ArePodsAllScheduled

func ArePodsAllScheduled(pods []corev1.Pod) bool

func BuildPodMap

func BuildPodMap(pods []corev1.Pod, keyFunc func(pod *corev1.Pod) string) map[string]*corev1.Pod

func CheckControllerReference

func CheckControllerReference(obj, owner metav1.Object) error

func ContainsOnlyFinalizer

func ContainsOnlyFinalizer(obj client.Object, finalizer string) bool

func DeepCopyStrMap

func DeepCopyStrMap(m map[string]string) map[string]string

func FilterPodsBy

func FilterPodsBy(pods []corev1.Pod, filter func(pod *corev1.Pod) bool) []corev1.Pod

func GetClusterAddrFromService

func GetClusterAddrFromService(svc *corev1.Service, port string) (string, error)

func GetContainerFromPod

func GetContainerFromPod(pod *corev1.Pod, name string) *corev1.Container

func GetContainerFromPodSpec

func GetContainerFromPodSpec(podSpec *corev1.PodSpec, name string) *corev1.Container

func GetPortFromContainer

func GetPortFromContainer(container *corev1.Container, name string) *corev1.ContainerPort

func GetPortFromPorts

func GetPortFromPorts(ports []corev1.ContainerPort, name string) *corev1.ContainerPort

func GetPortFromService

func GetPortFromService(svc *corev1.Service, port string) *corev1.ServicePort

func GetServiceDNSRecord

func GetServiceDNSRecord(svcName, namespace string, withinNamespace bool) string

func GetServiceDNSRecordWithSvc

func GetServiceDNSRecordWithSvc(svc *corev1.Service, withinNamespace bool) string

func HostPathTypePtr

func HostPathTypePtr(t corev1.HostPathType) *corev1.HostPathType

func IsContainerQoSGuaranteed

func IsContainerQoSGuaranteed(c *corev1.Container) bool

func IsDeploymentRolledOut

func IsDeploymentRolledOut(deploy *appsv1.Deployment) bool

func IsExitError

func IsExitError(err error) bool

func IsPodDeleted

func IsPodDeleted(po *corev1.Pod) bool

func IsPodDeletedOrFailed

func IsPodDeletedOrFailed(po *corev1.Pod) bool

func IsPodFailed

func IsPodFailed(po *corev1.Pod) bool

func IsPodReady

func IsPodReady(pod *corev1.Pod) bool

func IsPodRunning

func IsPodRunning(pod *corev1.Pod) bool

func IsPodScheduled

func IsPodScheduled(po *corev1.Pod) bool

func IsResourceQoSGuaranteed

func IsResourceQoSGuaranteed(resourceRequirements corev1.ResourceRequirements) bool

func MustGetContainerFromPod

func MustGetContainerFromPod(pod *corev1.Pod, name string) *corev1.Container

func MustGetPortFromContainer

func MustGetPortFromContainer(container *corev1.Container, name string) *corev1.ContainerPort

func MustGetPortFromService

func MustGetPortFromService(svc *corev1.Service, port string) *corev1.ServicePort

func NewNamespacedNameFrom

func NewNamespacedNameFrom(key types.NamespacedName, f func(name string) string) types.NamespacedName

func NewSecurityContext

func NewSecurityContext(privileged bool) *corev1.SecurityContext

func PatchAffinity

func PatchAffinity(affinity *corev1.Affinity, patches ...*corev1.Affinity) *corev1.Affinity

PatchAffinity is only valid for pod (anti) affinity. Node affinity uses OR among different terms.

func PatchAnnotations

func PatchAnnotations(annotations map[string]string, patches ...map[string]string) map[string]string

func PatchEnvs

func PatchEnvs(origin []corev1.EnvVar, patches ...[]corev1.EnvVar) []corev1.EnvVar

func PatchLabels

func PatchLabels(labels map[string]string, patches ...map[string]string) map[string]string

func PatchVolumeMounts

func PatchVolumeMounts(origin []corev1.VolumeMount, patches ...[]corev1.VolumeMount) []corev1.VolumeMount

func PatchVolumes

func PatchVolumes(origin []corev1.Volume, patches ...[]corev1.Volume) []corev1.Volume

func TimePtr

func TimePtr(time metav1.Time) *metav1.Time

func ToObjectInterfaces

func ToObjectInterfaces(slice interface{}) []client.Object

func ToObjectNameSet

func ToObjectNameSet(slice interface{}) map[string]struct{}

func ToObjectNames

func ToObjectNames(slice interface{}) []string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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