common

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FileStorageTypeLabelKey is the key for PVC labels that indicate the type of file storage.
	FileStorageTypeLabelKey = "app.greptime.io/fileStorageType"
)

Variables

This section is empty.

Functions

func FileStorageToPVC

func FileStorageToPVC(clusterName string, datanodeGroupName string, fs v1alpha1.FileStorageAccessor, fsType FileStorageType, kind v1alpha1.RoleKind) *corev1.PersistentVolumeClaim

func GenerateConfigMap

func GenerateConfigMap(namespace, resourceName string, configData []byte) (*corev1.ConfigMap, error)

func GeneratePodMonitor

func GeneratePodMonitor(namespace, resourceName string, promSpec *v1alpha1.PrometheusMonitorSpec) (*monitoringv1.PodMonitor, error)

func GeneratePodTemplateSpec

func GeneratePodTemplateSpec(kind v1alpha1.RoleKind, template *v1alpha1.PodTemplateSpec) *corev1.PodTemplateSpec

func GetMetaHTTPServiceURL added in v0.4.0

func GetMetaHTTPServiceURL(cluster *v1alpha1.GreptimeDBCluster) string

func GetPVCs

func GetPVCs(ctx context.Context, k8sClient client.Client, namespace, resourceName string, fsType FileStorageType) ([]corev1.PersistentVolumeClaim, error)

func LogsPipelineName added in v0.1.1

func LogsPipelineName(namespace, name string) string

func MonitoringServiceName added in v0.1.1

func MonitoringServiceName(name string) string

func MountConfigDir

func MountConfigDir(template *corev1.PodTemplateSpec, configMapName string)

func ResourceName

func ResourceName(name string, roleKind v1alpha1.RoleKind, extraNames ...string) string

ResourceName returns the resource name for the given name and role kind. The format will be `${name}-${roleKind}-${extraNames[0]}-${extraNames[1]}...`. If extraNames are provided, they will be appended to the resource name. For example, - If the name is `my-cluster` and the role kind is `datanode`, the resource name will be `my-cluster-datanode`. - If the name is `my-cluster` and the role kind is `datanode` and the extra names `read`, the resource name will be `my-cluster-datanode-read`.

func SetMaintenanceMode added in v0.4.0

func SetMaintenanceMode(metaHTTPServiceURL string, enabled bool) error

SetMaintenanceMode requests the metasrv to set the maintenance mode.

Types

type FileStorageType

type FileStorageType string
const (
	FileStorageTypeDatanode FileStorageType = "datanode"
	FileStorageTypeWAL      FileStorageType = "wal"
	FileStorageTypeCache    FileStorageType = "cache"
)

Jump to

Keyboard shortcuts

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