k8s

package
v0.0.0-...-da8f381 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFoundationDBCluster

func ApplyFoundationDBCluster(ctx context.Context, k8sclient client.Client, fdb *v1beta2.FoundationDBCluster) error

ApplyFoundationDBCluster apply FoundationDBCluster to apiserver.

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 CreateSecret

func CreateSecret(ctx context.Context, k8sclient client.Client, secret *corev1.Secret) 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 DeleteFoundationDBCluster

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

func DeletePVC

func DeletePVC(ctx context.Context, k8sclient client.Client, namespace, pvcName string, labels map[string]string) error

DeletePVC clean up existing pvc by pvc name, namespace and labels

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 GetConfig

func GetConfig(ctx context.Context, k8sclient client.Client, configMapInfo *dorisv1.ConfigMapInfo, namespace string, componentType dorisv1.ComponentType) (map[string]interface{}, error)

GetConfig get conf from configmap by componentType , if not use configmap get an empty map.

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 GetDisaggregatedMetaServiceConfigMaps

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

func GetFoundationDBCluster

func GetFoundationDBCluster(ctx context.Context, k8sclient client.Client, namespace, name string) (*v1beta2.FoundationDBCluster, error)

func GetPods

func GetPods(ctx context.Context, k8sclient client.Client, namespace string, labels map[string]string) (corev1.PodList, error)

func GetSecret

func GetSecret(ctx context.Context, k8sclient client.Client, namespace, name string) (*corev1.Secret, error)

get the secret by namespace and name.

func GetService

func GetService(ctx context.Context, k8sclient client.Client, namespace, name string) (*corev1.Service, error)

get the Service by namespace and name.

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

func UpdateSecret

func UpdateSecret(ctx context.Context, k8sclient client.Client, secret *corev1.Secret) 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