common

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 AuditLogsPipelineName added in v0.6.1

func AuditLogsPipelineName(namespace, name string) string

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 GetBindAddress added in v0.6.0

func GetBindAddress(enableIPv6 bool, port int32) string

GetBindAddress returns the wildcard bind address for listening. If enableIPv6 is true, returns "[::]:port", otherwise returns "0.0.0.0:port".

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 GetServerAddress added in v0.6.0

func GetServerAddress(enableIPv6 bool, ip string, port int32) string

GetServerAddress formats an address for server communication. If enableIPv6 is true (IPv6 address), returns "[ip]:port", otherwise returns "ip:port".

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.

func VectorConfigName added in v0.6.2

func VectorConfigName(name string) string

VectorConfigName returns the per-cluster vector config configmap name.

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