k8s

package
v0.0.0-...-5e4cb18 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyService

func ApplyService(ctx context.Context, k8sclient client.Client, svc *corev1.Service, equal ServiceEqual) error

func ApplyStatefulSet

func ApplyStatefulSet(ctx context.Context, k8sclient client.Client, st *appv1.StatefulSet, equal StatefulSetEqual) error

ApplyStatefulSet when the object is not exist, create object. if exist and statefulset have been updated, patch the statefulset.

func CreateClientObject

func CreateClientObject(ctx context.Context, k8sclient client.Client, object client.Object) error

func CreateOrUpdateClientObject

func CreateOrUpdateClientObject(ctx context.Context, k8sclient client.Client, object client.Object) error

func DeleteAutoscaler

func DeleteAutoscaler(ctx context.Context, k8sclient client.Client, namespace, name string, autoscalerVersion dorisv1.AutoScalerVersion) error

DeleteAutoscaler as version type delete response autoscaler.

func DeleteClientObject

func DeleteClientObject(ctx context.Context, k8sclient client.Client, object client.Object) error

func DeleteService

func DeleteService(ctx context.Context, k8sclient client.Client, namespace, name string) error

DeleteService delete service.

func DeleteStatefulset

func DeleteStatefulset(ctx context.Context, k8sclient client.Client, namespace, name string) error

DeleteStatefulset delete statefulset.

func GetConfigMap

func GetConfigMap(ctx context.Context, k8scient client.Client, namespace, name string) (*corev1.ConfigMap, error)

GetConfigMap get the configmap name=name, namespace=namespace.

func GetConfigMaps

func GetConfigMaps(ctx context.Context, k8scient client.Client, namespace string, cms []dorisv1.MountConfigMapInfo) ([]*corev1.ConfigMap, error)

GetConfigMaps get the configmap by the array of MountConfigMapInfo and namespace.

func PatchClientObject

func PatchClientObject(ctx context.Context, k8sclient client.Client, object client.Object) error

PatchClientObject patch object when the object exist. if not return error.

func PatchOrCreate

func PatchOrCreate(ctx context.Context, k8sclient client.Client, object client.Object) error

PatchOrCreate patch object if not exist create object.

func PodIsReady

func PodIsReady(status *corev1.PodStatus) bool

func UpdateClientObject

func UpdateClientObject(ctx context.Context, k8sclient client.Client, object client.Object) error

Types

type ServiceEqual

type ServiceEqual func(svc1 *corev1.Service, svc2 *corev1.Service) bool

judge two services equal or not in some fields. develoer can custom the function.

type StatefulSetEqual

type StatefulSetEqual func(st1 *appv1.StatefulSet, st2 *appv1.StatefulSet) bool

judge two statefulset equal or not in some fields. develoer can custom the function.

Jump to

Keyboard shortcuts

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