Documentation ¶
Index ¶
- Constants
- Variables
- func ApplySecurityContext(containers []corev1.Container, securityContext *corev1.SecurityContext) []corev1.Container
- func BuildExternalService(dcr *v1.DorisCluster, componentType v1.ComponentType, ...) corev1.Service
- func BuildHorizontalPodAutoscaler(pap *PodAutoscalerParams) client.Object
- func BuildInternalService(dcr *v1.DorisCluster, componentType v1.ComponentType, ...) corev1.Service
- func BuildPVC(volume dorisv1.PersistentVolume, labels map[string]string, ...) corev1.PersistentVolumeClaim
- func GetContainerPorts(config map[string]interface{}, componentType v1.ComponentType) []corev1.ContainerPort
- func GetDefaultPort(key string) int32
- func GetInt32Pointer(v int32) *int32
- func GetInt64ptr(n int64) *int64
- func GetMountConfigMapInfo(c dorisv1.ConfigMapInfo) (finalConfigMaps []dorisv1.MountConfigMapInfo)
- func GetPort(config map[string]interface{}, key string) int32
- func GetPortKey(configKey string) string
- func GetStringPointer(s string) *string
- func GetTerminationGracePeriodSeconds(config map[string]interface{}) int64
- func MergeMetadata(new *metav1.ObjectMeta, old metav1.ObjectMeta)
- func MergeSlices(new []string, old []string) []string
- func MergeStatefulSets(new *appv1.StatefulSet, old appv1.StatefulSet)
- func NewBaseMainContainer(dcr *v1.DorisCluster, config map[string]interface{}, ...) corev1.Container
- func NewPodTemplateSpec(dcr *v1.DorisCluster, componentType v1.ComponentType) corev1.PodTemplateSpec
- func NewStatefulSet(dcr *v1.DorisCluster, componentType v1.ComponentType) appv1.StatefulSet
- func ResolveConfigMaps(configMaps []*corev1.ConfigMap, componentType dorisv1.ComponentType) (map[string]interface{}, error)
- func ServiceDeepEqual(newSvc, oldSvc *corev1.Service) bool
- func StatefulSetDeepEqual(new *appv1.StatefulSet, old *appv1.StatefulSet, excludeReplicas bool) bool
- type Annotations
- type Labels
- type PodAutoscalerParams
Constants ¶
const ( HTTP_PORT = "http_port" RPC_PORT = "rpc_port" QUERY_PORT = "query_port" EDIT_LOG_PORT = "edit_log_port" )
the fe ports key
const ( THRIFT_PORT = "thrift_port" BE_PORT = "be_port" WEBSERVER_PORT = "webserver_port" HEARTBEAT_SERVICE_PORT = "heartbeat_service_port" BRPC_PORT = "brpc_port" )
the cn or be ports key
const ( FE_RESOLVEKEY = "fe.conf" BE_RESOLVEKEY = "be.conf" CN_RESOLVEKEY = "be.conf" BROKER_RESOLVEKEY = "apache_hdfs_broker.conf" )
the default ResolveKey
const ( ENV_FE_ADDR = "ENV_FE_ADDR" ENV_FE_PORT = "FE_QUERY_PORT" ENV_FE_ELECT_NUMBER = "ELECT_NUMBER" COMPONENT_TYPE = "COMPONENT_TYPE" )
const ( HEALTH_API_PATH = "/api/health" HEALTH_BROKER_LIVE_COMMAND = "/opt/apache-doris/broker_is_alive.sh" FE_PRESTOP = "/opt/apache-doris/fe_prestop.sh" BE_PRESTOP = "/opt/apache-doris/be_prestop.sh" BROKER_PRESTOP = "/opt/apache-doris/broker_prestop.sh" //keys for pod env variables POD_NAME = "POD_NAME" POD_IP = "POD_IP" HOST_IP = "HOST_IP" POD_NAMESPACE = "POD_NAMESPACE" ADMIN_USER = "USER" ADMIN_PASSWD = "PASSWD" DORIS_ROOT = "DORIS_ROOT" DEFAULT_ADMIN_USER = "root" DEFAULT_ROOT_PATH = "/opt/apache-doris" POD_INFO_PATH = "/etc/podinfo" POD_INFO_VOLUME_NAME = "podinfo" NODE_TOPOLOGYKEY = "kubernetes.io/hostname" DEFAULT_INIT_IMAGE = "selectdb/alpine:latest" )
const BROKER_IPC_PORT = "broker_ipc_port"
const GRACE_SHUTDOWN_WAIT_SECONDS = "grace_shutdown_wait_seconds"
Variables ¶
var ( AutoscalerKind = "HorizontalPodAutoscaler" StatefulSetKind = "StatefulSet" ServiceKind = "Service" )
Functions ¶
func ApplySecurityContext ¶
func ApplySecurityContext(containers []corev1.Container, securityContext *corev1.SecurityContext) []corev1.Container
ApplySecurityContext applies the container security context to all containers in the pod (if not already set).
func BuildExternalService ¶
func BuildExternalService(dcr *v1.DorisCluster, componentType v1.ComponentType, config map[string]interface{}) corev1.Service
BuildExternalService build the external service. not have selector
func BuildHorizontalPodAutoscaler ¶
func BuildHorizontalPodAutoscaler(pap *PodAutoscalerParams) client.Object
func BuildInternalService ¶
func BuildInternalService(dcr *v1.DorisCluster, componentType v1.ComponentType, config map[string]interface{}) corev1.Service
func BuildPVC ¶
func BuildPVC(volume dorisv1.PersistentVolume, labels map[string]string, namespace, stsName, ordinal string) corev1.PersistentVolumeClaim
func GetContainerPorts ¶
func GetContainerPorts(config map[string]interface{}, componentType v1.ComponentType) []corev1.ContainerPort
func GetDefaultPort ¶
func GetInt32Pointer ¶
func GetInt64ptr ¶
func GetMountConfigMapInfo ¶
func GetMountConfigMapInfo(c dorisv1.ConfigMapInfo) (finalConfigMaps []dorisv1.MountConfigMapInfo)
func GetPortKey ¶
func GetStringPointer ¶
func GetTerminationGracePeriodSeconds ¶
GetTerminationGracePeriodSeconds get grace_shutdown_wait_seconds from config file.
func MergeMetadata ¶
func MergeMetadata(new *metav1.ObjectMeta, old metav1.ObjectMeta)
mergeMetadata takes labels and annotations from the old resource and merges them into the new resource. If a key is present in both resources, the new resource wins. It also copies the ResourceVersion from the old resource to the new resource to prevent update conflicts.
func MergeSlices ¶
func MergeStatefulSets ¶
func MergeStatefulSets(new *appv1.StatefulSet, old appv1.StatefulSet)
MergeStatefulSets merge exist statefulset and new statefulset.
func NewBaseMainContainer ¶
func NewBaseMainContainer(dcr *v1.DorisCluster, config map[string]interface{}, componentType v1.ComponentType) corev1.Container
func NewPodTemplateSpec ¶
func NewPodTemplateSpec(dcr *v1.DorisCluster, componentType v1.ComponentType) corev1.PodTemplateSpec
func NewStatefulSet ¶
func NewStatefulSet(dcr *v1.DorisCluster, componentType v1.ComponentType) appv1.StatefulSet
NewStatefulSet construct statefulset.
func ResolveConfigMaps ¶
func ServiceDeepEqual ¶
func StatefulSetDeepEqual ¶
func StatefulSetDeepEqual(new *appv1.StatefulSet, old *appv1.StatefulSet, excludeReplicas bool) bool
StatefulSetDeepEqual judge two statefulset equal or not.
Types ¶
type Annotations ¶
func NewAnnotations ¶
func NewAnnotations(annotations ...Annotations) Annotations
func (Annotations) Add ¶
func (a Annotations) Add(key, value string)
func (Annotations) AddAnnotation ¶
func (a Annotations) AddAnnotation(annotation Annotations)
type PodAutoscalerParams ¶
type PodAutoscalerParams struct { AutoscalerType dorisv1.AutoScalerVersion Namespace string Name string Labels Labels TargetName string OwnerReferences []metav1.OwnerReference ScalerPolicy *dorisv1.AutoScalingPolicy }