k8sutil

package
v0.0.0-...-398e186 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: BSD-3-Clause, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomResourceDefinitionTypeMeta metav1.TypeMeta = metav1.TypeMeta{
	Kind:       "CustomResourceDefinition",
	APIVersion: "apiextensions.k8s.io/v1beta1",
}

CustomResourceDefinitionTypeMeta set the default kind/apiversion of CRD

Functions

func CreateOrUpdateEndpoints

func CreateOrUpdateEndpoints(eclient clientv1.EndpointsInterface, eps *v1.Endpoints) error

func CreateOrUpdateService

func CreateOrUpdateService(sclient clientv1.ServiceInterface, svc *v1.Service) error

func GetMinorVersion

func GetMinorVersion(dclient discovery.DiscoveryInterface) (int, error)

GetMinorVersion returns the minor version as an integer

func IsResourceNotFoundError

func IsResourceNotFoundError(err error) bool

func NewClusterConfig

func NewClusterConfig(host string, tlsInsecure bool, tlsConfig *rest.TLSClientConfig) (*rest.Config, error)

func NewCustomResourceDefinition

func NewCustomResourceDefinition(crdKind monitoringv1.CrdKind, group string, labels map[string]string, validation bool) *extensionsobj.CustomResourceDefinition

func PodRunningAndReady

func PodRunningAndReady(pod v1.Pod) (bool, error)

PodRunningAndReady returns whether a pod is running and each container has passed it's ready state.

func SanitizeVolumeName

func SanitizeVolumeName(name string) string

SanitizeVolumeName ensures that the given volume name is a valid DNS-1123 label accepted by Kubernetes.

func WaitForCRDReady

func WaitForCRDReady(listFunc func(opts metav1.ListOptions) (runtime.Object, error)) error

WaitForCRDReady waits for a custom resource definition to be available for use.

Types

This section is empty.

Jump to

Keyboard shortcuts

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