Documentation ¶
Index ¶
- Constants
- func EnvPlaceHolder(env string) string
- func GenerateAccountSecretName(clusterName, compName, name string) string
- func GenerateClusterComponentEnvPattern(clusterName, compName string) string
- func GenerateClusterComponentName(clusterName, compName string) string
- func GenerateClusterServiceName(clusterName, svcName string) string
- func GenerateComponentHeadlessServiceName(clusterName, compName, svcName string) string
- func GenerateComponentServiceName(clusterName, compName, svcName string) string
- func GenerateDefaultComponentHeadlessServiceName(clusterName, compName string) string
- func GenerateDefaultComponentServiceName(clusterName, compName string) string
- func GenerateDefaultConnCredential(clusterName string) string
- func GenerateDefaultServiceAccountName(name string) string
- func GeneratePodFQDN(namespace, clusterName, compName string, ordinal int) string
- func GeneratePodName(clusterName, compName string, ordinal int) string
- func GeneratePodSubDomain(clusterName, compName string) string
- func GenerateResourceNameWithScalingSuffix(name string) string
- func GenerateServiceNamePattern(itsName string) string
- func GenerateShardingNamePrefix(shardingName string) string
- func GenerateShardingNameSvcPrefix(shardingSvcName string) string
- func GenerateShardingSharedAccountSecretName(clusterName, shardingName, accountName string) string
- func GenerateVirtualComponentDefinition(compDefSuffix string) string
- func GenerateWorkloadNamePattern(clusterName, compName string) string
- func GetAppVersionLabel(appVersion string) map[string]string
- func GetClickHouseAlias() []string
- func GetClusterCompDefLabel(clusterCompDefName string) map[string]string
- func GetClusterDefTypeLabel(clusterDefType string) map[string]string
- func GetClusterWellKnownLabels(clusterName string) map[string]string
- func GetComponentDefLabel(compDefName string) map[string]string
- func GetComponentWellKnownLabels(clusterName, componentName string) map[string]string
- func GetElasticSearchAlias() []string
- func GetKBConfigMapWellKnownLabels(cmTplName, clusterDefName, clusterName, componentName string) map[string]string
- func GetKBGenerationAnnotation(generation string) map[string]string
- func GetKBKnownLabels() map[string]string
- func GetKBReservedAnnotationKeys() []string
- func GetKBReservedLabelKeys() []string
- func GetKBWellKnownLabels(clusterDefName, clusterName, componentName string) map[string]string
- func GetKBWellKnownLabelsWithCompDef(compDefName, clusterName, componentName string) map[string]string
- func GetMongoDBAlias() []string
- func GetPostgreSQLAlias() []string
- func GetServiceVersionAnnotation(serviceVersion string) map[string]string
- func GetShardingNameLabel(shardingName string) map[string]string
- func GetShardingWellKnownLabels(clusterName, shardingName string) map[string]string
- func GetZookeeperAlias() []string
Constants ¶
const ( // CRDAPIVersionAnnotationKey indicates the CRD API version of the object. CRDAPIVersionAnnotationKey = "kubeblocks.io/crd-api-version" // SkipImmutableCheckAnnotationKey specifies to skip the mutation check for the object. // The mutation check is only applied to the fields that are declared as immutable. SkipImmutableCheckAnnotationKey = "apps.kubeblocks.io/skip-immutable-check" // NodeSelectorOnceAnnotationKey adds nodeSelector in podSpec for one pod exactly once NodeSelectorOnceAnnotationKey = "workloads.kubeblocks.io/node-selector-once" )
annotations for kubeblocks
const ( KBAppMultiClusterPlacementKey = "apps.kubeblocks.io/multi-cluster-placement" MultiClusterServicePlacementKey = "apps.kubeblocks.io/multi-cluster-service-placement" OpsDependentOnSuccessfulOpsAnnoKey = "ops.kubeblocks.io/dependent-on-successful-ops" // OpsDependentOnSuccessfulOpsAnnoKey wait for the dependent ops to succeed before executing the current ops. If it fails, this ops will also fail. RelatedOpsAnnotationKey = "ops.kubeblocks.io/related-ops" QueueEndTimeAnnotationKey = "operations.kubeblocks.io/queue-end-time" )
annotations for multi-cluster
const ( TPLRenderToolPath = "/bin/config_render" ConfigManagerToolPath = "/bin/reloader" )
const ( // config keys used in viper, DON'T refactor the value without careful inspections CfgKeyServerInfo = "_KUBE_SERVER_INFO" CfgKeyCtrlrMgrNS = "CM_NAMESPACE" CfgKeyCtrlrMgrAffinity = "CM_AFFINITY" CfgKeyCtrlrMgrNodeSelector = "CM_NODE_SELECTOR" CfgKeyCtrlrMgrTolerations = "CM_TOLERATIONS" CfgKeyCtrlrReconcileRetryDurationMS = "CM_RECON_RETRY_DURATION_MS" // accept time CfgRecoverVolumeExpansionFailure = "RECOVER_VOLUME_EXPANSION_FAILURE" // refer to feature gates RecoverVolumeExpansionFailure of k8s. CfgKeyProvider = "KUBE_PROVIDER" CfgHostPortConfigMapName = "HOST_PORT_CM_NAME" CfgHostPortIncludeRanges = "HOST_PORT_INCLUDE_RANGES" CfgHostPortExcludeRanges = "HOST_PORT_EXCLUDE_RANGES" // addon config keys CfgKeyAddonJobTTL = "ADDON_JOB_TTL" CfgAddonJobImgPullPolicy = "ADDON_JOB_IMAGE_PULL_POLICY" // data plane config key CfgKeyDataPlaneTolerations = "DATA_PLANE_TOLERATIONS" CfgKeyDataPlaneAffinity = "DATA_PLANE_AFFINITY" // storage config keys CfgKeyDefaultStorageClass = "DEFAULT_STORAGE_CLASS" // customized encryption key for encrypting the password of connection credential. CfgKeyDPEncryptionKey = "DP_ENCRYPTION_KEY" CfgKeyDPBackupEncryptionSecretKeyRef = "DP_BACKUP_ENCRYPTION_SECRET_KEY_REF" CfgKeyDPBackupEncryptionAlgorithm = "DP_BACKUP_ENCRYPTION_ALGORITHM" CfgKBReconcileWorkers = "KUBEBLOCKS_RECONCILE_WORKERS" CfgClientQPS = "CLIENT_QPS" CfgClientBurst = "CLIENT_BURST" )
const ( // TODO: deprecated, will be removed later. KBConnCredentialPlaceHolder = "$(CONN_CREDENTIAL_SECRET_NAME)" KBComponentEnvCMPlaceHolder = "$(COMP_ENV_CM_NAME)" KBToolsImagePlaceHolder = "$(KUBEBLOCKS_TOOLS_IMAGE)" )
const ( KBPrefix = "KB" KBLowerPrefix = "kb" SlashScalingLowerSuffix = "scaling" )
const ( KBServiceAccountName = "KUBEBLOCKS_SERVICEACCOUNT_NAME" KBToolsImage = "KUBEBLOCKS_TOOLS_IMAGE" KBImagePullPolicy = "KUBEBLOCKS_IMAGE_PULL_POLICY" KBImagePullSecrets = "KUBEBLOCKS_IMAGE_PULL_SECRETS" KBDataScriptClientsImage = "KUBEBLOCKS_DATASCRIPT_CLIENTS_IMAGE" )
const ( APIGroup = "kubeblocks.io" AppName = "kubeblocks" // AppInstanceLabelKey refer cluster.Name AppInstanceLabelKey = "app.kubernetes.io/instance" // AppNameLabelKey refer clusterDefinition.Name before KubeBlocks Version 0.8.0 or refer ComponentDefinition.Name after KubeBlocks Version 0.8.0 (TODO:Pending) AppNameLabelKey = "app.kubernetes.io/name" // AppComponentLabelKey refer clusterDefinition.Spec.ComponentDefs[*].Name before KubeBlocks Version 0.8.0 or refer ComponentDefinition.Name after KubeBlocks Version 0.8.0 AppComponentLabelKey = "app.kubernetes.io/component" // AppVersionLabelKey refer clusterVersion.Name before KubeBlocks Version 0.8.0 or refer ComponentDefinition.Name after KubeBlocks Version 0.8.0 AppVersionLabelKey = "app.kubernetes.io/version" AppManagedByLabelKey = "app.kubernetes.io/managed-by" RegionLabelKey = "topology.kubernetes.io/region" ZoneLabelKey = "topology.kubernetes.io/zone" // kubeblocks.io labels RoleLabelKey = "kubeblocks.io/role" // RoleLabelKey consensusSet and replicationSet role label key AccessModeLabelKey = "workloads.kubeblocks.io/access-mode" ReadyWithoutPrimaryKey = "kubeblocks.io/ready-without-primary" VolumeTypeLabelKey = "kubeblocks.io/volume-type" ClusterAccountLabelKey = "account.kubeblocks.io/name" KBAppClusterUIDLabelKey = "apps.kubeblocks.io/cluster-uid" KBAppComponentLabelKey = "apps.kubeblocks.io/component-name" KBAppShardingNameLabelKey = "apps.kubeblocks.io/sharding-name" KBAppComponentDefRefLabelKey = "apps.kubeblocks.io/component-def-ref" // refer clusterDefinition.Spec.ComponentDefs[*].Name before KubeBlocks Version 0.8.0 or refer ComponentDefinition.Name after KubeBlocks Version 0.8.0 KBAppClusterDefTypeLabelKey = "apps.kubeblocks.io/cluster-type" // refer clusterDefinition.Spec.Type (deprecated) KBManagedByKey = "apps.kubeblocks.io/managed-by" // KBManagedByKey marks resources that auto created PVCNameLabelKey = "apps.kubeblocks.io/pvc-name" VolumeClaimTemplateNameLabelKey = "apps.kubeblocks.io/vct-name" KBAppComponentInstanceTemplatelabelKey = "apps.kubeblocks.io/instance-template" KBAppServiceVersionKey = "apps.kubeblocks.io/service-version" WorkloadTypeLabelKey = "apps.kubeblocks.io/workload-type" KBAppPodNameLabelKey = "apps.kubeblocks.io/pod-name" ClassProviderLabelKey = "class.kubeblocks.io/provider" ClusterDefLabelKey = "clusterdefinition.kubeblocks.io/name" ClusterVerLabelKey = "clusterversion.kubeblocks.io/name" ComponentDefinitionLabelKey = "componentdefinition.kubeblocks.io/name" ComponentVersionLabelKey = "componentversion.kubeblocks.io/name" CMConfigurationSpecProviderLabelKey = "config.kubeblocks.io/config-spec" // CMConfigurationSpecProviderLabelKey is ComponentConfigSpec name CMConfigurationCMKeysLabelKey = "config.kubeblocks.io/configmap-keys" // CMConfigurationCMKeysLabelKey Specify configmap keys CMConfigurationTemplateNameLabelKey = "config.kubeblocks.io/config-template-name" CMTemplateNameLabelKey = "config.kubeblocks.io/template-name" CMConfigurationTypeLabelKey = "config.kubeblocks.io/config-type" CMInsConfigurationHashLabelKey = "config.kubeblocks.io/config-hash" CMInsCurrentConfigurationHashLabelKey = "config.kubeblocks.io/update-config-hash" CMConfigurationConstraintsNameLabelKey = "config.kubeblocks.io/config-constraints-name" CMConfigurationTemplateVersion = "config.kubeblocks.io/config-template-version" ConsensusSetAccessModeLabelKey = "cs.apps.kubeblocks.io/access-mode" AddonNameLabelKey = "extensions.kubeblocks.io/addon-name" OpsRequestTypeLabelKey = "ops.kubeblocks.io/ops-type" OpsRequestNameLabelKey = "ops.kubeblocks.io/ops-name" OpsRequestNamespaceLabelKey = "ops.kubeblocks.io/ops-namespace" ServiceDescriptorNameLabelKey = "servicedescriptor.kubeblocks.io/name" RestoreForHScaleLabelKey = "apps.kubeblocks.io/restore-for-hscale" ResourceConstraintProviderLabelKey = "resourceconstraint.kubeblocks.io/provider" VolumeClaimTemplateNameLabelKeyForLegacy = "vct.kubeblocks.io/name" // Deprecated: only compatible with version 0.5, will be removed in 0.7 // kubeblocks.io annotations ClusterSnapshotAnnotationKey = "kubeblocks.io/cluster-snapshot" // ClusterSnapshotAnnotationKey saves the snapshot of cluster. OpsRequestAnnotationKey = "kubeblocks.io/ops-request" // OpsRequestAnnotationKey OpsRequest annotation key in Cluster EncryptedSystemAccountsAnnotationKey = "kubeblocks.io/encrypted-system-accounts" // EncryptedSystemAccountsAnnotationKey saves the encrypted system accounts. ReconcileAnnotationKey = "kubeblocks.io/reconcile" // ReconcileAnnotationKey Notify k8s object to reconcile RestartAnnotationKey = "kubeblocks.io/restart" // RestartAnnotationKey the annotation which notices the StatefulSet/DeploySet to restart RestoreFromBackupAnnotationKey = "kubeblocks.io/restore-from-backup" RestoreDoneAnnotationKey = "kubeblocks.io/restore-done" BackupSourceTargetAnnotationKey = "kubeblocks.io/backup-source-target" // RestoreFromBackupAnnotationKey specifies the component to recover from the backup. ComponentReplicasAnnotationKey = "apps.kubeblocks.io/component-replicas" // ComponentReplicasAnnotationKey specifies the number of pods in replicas BackupPolicyTemplateAnnotationKey = "apps.kubeblocks.io/backup-policy-template" LastAppliedClusterAnnotationKey = "apps.kubeblocks.io/last-applied-cluster" PVLastClaimPolicyAnnotationKey = "apps.kubeblocks.io/pv-last-claim-policy" HaltRecoveryAllowInconsistentCVAnnotKey = "clusters.apps.kubeblocks.io/allow-inconsistent-cv" HaltRecoveryAllowInconsistentResAnnotKey = "clusters.apps.kubeblocks.io/allow-inconsistent-resource" PrimaryAnnotationKey = "rs.apps.kubeblocks.io/primary" DisableUpgradeInsConfigurationAnnotationKey = "config.kubeblocks.io/disable-reconfigure" LastAppliedConfigAnnotationKey = "config.kubeblocks.io/last-applied-configuration" LastAppliedOpsCRAnnotationKey = "config.kubeblocks.io/last-applied-ops-name" UpgradePolicyAnnotationKey = "config.kubeblocks.io/reconfigure-policy" KBParameterUpdateSourceAnnotationKey = "config.kubeblocks.io/reconfigure-source" UpgradeRestartAnnotationKey = "config.kubeblocks.io/restart" ConfigAppliedVersionAnnotationKey = "config.kubeblocks.io/config-applied-version" KubeBlocksGenerationKey = "kubeblocks.io/generation" ExtraEnvAnnotationKey = "kubeblocks.io/extra-env" LastRoleSnapshotVersionAnnotationKey = "apps.kubeblocks.io/last-role-snapshot-version" ComponentScaleInAnnotationKey = "apps.kubeblocks.io/component-scale-in" // ComponentScaleInAnnotationKey specifies whether the component is scaled in DisableHAAnnotationKey = "kubeblocks.io/disable-ha" // kubeblocks.io well-known finalizers DBClusterFinalizerName = "cluster.kubeblocks.io/finalizer" DBComponentFinalizerName = "component.kubeblocks.io/finalizer" ConfigFinalizerName = "config.kubeblocks.io/finalizer" ServiceDescriptorFinalizerName = "servicedescriptor.kubeblocks.io/finalizer" OpsRequestFinalizerName = "opsrequest.kubeblocks.io/finalizer" // ConfigurationTplLabelPrefixKey clusterVersion or clusterdefinition using tpl ConfigurationTplLabelPrefixKey = "config.kubeblocks.io/tpl" ConfigurationConstraintsLabelPrefixKey = "config.kubeblocks.io/constraints" // CMInsLastReconfigurePhaseKey defines the current phase CMInsLastReconfigurePhaseKey = "config.kubeblocks.io/last-applied-reconfigure-phase" // ConfigurationRevision defines the current revision // TODO support multi version ConfigurationRevision = "config.kubeblocks.io/configuration-revision" LastConfigurationRevisionPhase = "config.kubeblocks.io/revision-reconcile-phase" // Deprecated: only compatible with version 0.6, will be removed in 0.8 // CMInsEnableRerenderTemplateKey is used to enable rerender template CMInsEnableRerenderTemplateKey = "config.kubeblocks.io/enable-rerender" // IgnoreResourceConstraint is used to specify whether to ignore the resource constraint IgnoreResourceConstraint = "resource.kubeblocks.io/ignore-constraint" RBACRoleName = "kubeblocks-cluster-pod-role" RBACClusterRoleName = "kubeblocks-volume-protection-pod-role" // FeatureReconciliationInCompactModeAnnotationKey indicates that the controller should run in compact mode, // means to try the best to cutoff useless objects. FeatureReconciliationInCompactModeAnnotationKey = "kubeblocks.io/compact-mode" )
const ( // ReasonNotFoundCR referenced custom resource not found ReasonNotFoundCR = "NotFound" ReasonRefCRUnavailable = "Unavailable" // ReasonDeletedCR deleted custom resource ReasonDeletedCR = "DeletedCR" // ReasonDeletingCR deleting custom resource ReasonDeletingCR = "DeletingCR" // ReasonCreatedCR created custom resource ReasonCreatedCR = "CreatedCR" // ReasonRunTaskFailed run task failed ReasonRunTaskFailed = "RunTaskFailed" // ReasonDeleteFailed delete failed ReasonDeleteFailed = "DeleteFailed" )
const ( DeploymentKind = "Deployment" StatefulSetKind = "StatefulSet" PodKind = "Pod" PersistentVolumeClaimKind = "PersistentVolumeClaim" CronJobKind = "CronJob" JobKind = "Job" ReplicaSetKind = "ReplicaSet" VolumeSnapshotKind = "VolumeSnapshot" ServiceKind = "Service" ConfigMapKind = "ConfigMap" DaemonSetKind = "DaemonSet" )
const ( // Container port name LorryHTTPPortName = "lorry-http-port" LorryGRPCPortName = "lorry-grpc-port" LorryContainerName = "lorry" LorryInitContainerName = "init-lorry" ProbeInitContainerName = "kb-initprobe" RoleProbeContainerName = "kb-checkrole" StatusProbeContainerName = "kb-checkstatus" RunningProbeContainerName = "kb-checkrunning" VolumeProtectionProbeContainerName = "kb-volume-protection" LorryRoleProbePath = "/v1.0/checkrole" LorryVolumeProtectPath = "/v1.0/volumeprotection" // the filedpath name used in event.InvolvedObject.FieldPath ProbeCheckStatusPath = "spec.containers{" + StatusProbeContainerName + "}" ProbeCheckRunningPath = "spec.containers{" + RunningProbeContainerName + "}" )
const ( ConfigSidecarName = "config-manager" ConfigManagerGPRCPortEnv = "CONFIG_MANAGER_GRPC_PORT" ConfigManagerLogLevel = "CONFIG_MANAGER_LOG_LEVEL" PodMinReadySecondsEnv = "POD_MIN_READY_SECONDS" ConfigTemplateType = "tpl" ConfigInstanceType = "instance" ReconfigureManagerSource = "manager" ReconfigureUserSource = "ops" ReconfigureTemplateSource = "external-template" ConfigManagerPortName = "config-manager" )
const ( Primary = "primary" Secondary = "secondary" Leader = "leader" Follower = "follower" Learner = "learner" Candidate = "candidate" )
const ( AccountNameForSecret = "username" AccountPasswdForSecret = "password" )
username and password are keys in created secrets for others to refer to.
const ( KubernetesClusterDomainEnv = "KUBERNETES_CLUSTER_DOMAIN" DefaultDNSDomain = "cluster.local" )
const ( ServiceDescriptorUsernameKey = "username" ServiceDescriptorPasswordKey = "password" ServiceDescriptorEndpointKey = "endpoint" ServiceDescriptorHostKey = "host" ServiceDescriptorPortKey = "port" )
const ( BackupNameKeyForRestore = "name" BackupNamespaceKeyForRestore = "namespace" VolumeRestorePolicyKeyForRestore = "volumeRestorePolicy" DoReadyRestoreAfterClusterRunning = "doReadyRestoreAfterClusterRunning" RestoreTimeKeyForRestore = "restoreTime" EnvForRestore = "restoreEnv" ConnectionPassword = "connectionPassword" EncryptedSystemAccounts = "encryptedSystemAccounts" )
const ( KubeblocksAPIConversionTypeAnnotationName = "api.kubeblocks.io/converted" SourceAPIVersionAnnotationName = "api.kubeblocks.io/source" SourceAPIVersion = "source" MigratedAPIVersion = "migrated" ReviewAPIVersion = "reviewer" )
const ( KBEnvClusterName = "KB_CLUSTER_NAME" KBEnvClusterUID = "KB_CLUSTER_UID" KBEnvClusterCompName = "KB_CLUSTER_COMP_NAME" KBEnvClusterUIDPostfix8Deprecated = "KB_CLUSTER_UID_POSTFIX_8" )
Cluster
const ( KBEnvCompName = "KB_COMP_NAME" KBEnvCompReplicas = "KB_COMP_REPLICAS" KBEnvCompServiceVersion = "KB_COMP_SERVICE_VERSION" )
Component
const ( KBEnvPodName = "KB_POD_NAME" KBEnvPodUID = "KB_POD_UID" KBEnvPodIP = "KB_POD_IP" KBEnvPodIPs = "KB_POD_IPS" KBEnvPodFQDN = "KB_POD_FQDN" KBEnvPodOrdinal = "KB_POD_ORDINAL" KBEnvPodIPDeprecated = "KB_PODIP" KBEnvPodIPsDeprecated = "KB_PODIPS" )
Pod
const ( KBEnvHostIP = "KB_HOST_IP" KBEnvNodeName = "KB_NODENAME" KBEnvHostIPDeprecated = "KB_HOSTIP" )
Host
const ( KBEnvTLSCertPath = "KB_TLS_CERT_PATH" KBEnvTLSCertFile = "KB_TLS_CERT_FILE" KBEnvTLSCAFile = "KB_TLS_CA_FILE" KBEnvTLSKeyFile = "KB_TLS_KEY_FILE" )
TLS
const ( KBEnvWorkloadType = "KB_WORKLOAD_TYPE" KBEnvBuiltinHandler = "KB_BUILTIN_HANDLER" KBEnvActionCommands = "KB_ACTION_COMMANDS" KBEnvCronJobs = "KB_CRON_JOBS" KBEnvCharacterType = "KB_SERVICE_CHARACTER_TYPE" KBEnvServiceUser = "KB_SERVICE_USER" KBEnvServicePassword = "KB_SERVICE_PASSWORD" KBEnvLorryHTTPPort = "LORRY_HTTP_PORT" KBEnvLorryGRPCPort = "LORRY_GRPC_PORT" KBEnvLorryLogLevel = "LORRY_LOG_LEVEL" // KBEnvServiceRoles defines the Roles configured in the cluster definition that are visible to users. KBEnvServiceRoles = "KB_SERVICE_ROLES" // KBEnvServicePort defines the port of the DB service KBEnvServicePort = "KB_SERVICE_PORT" // KBEnvDataPath defines the data volume path of the DB service. KBEnvDataPath = "KB_DATA_PATH" // KBEnvTTL controls the lease expiration time in DCS. If the leader fails to renew its lease within the TTL duration, it will lose the leader role, allowing other replicas to take over. KBEnvTTL = "KB_TTL" // KBEnvMaxLag defines maximum replication lag permitted when performing a switchover. KBEnvMaxLag = "KB_MAX_LAG" // KBEnvEnableHA Whether to enable high availability, true by default. KBEnvEnableHA = "KB_ENABLE_HA" // KBEnvRsmRoleUpdateMechanism defines the method to send events: DirectAPIServerEventUpdate(through lorry service), ReadinessProbeEventUpdate(through kubelet service) KBEnvRsmRoleUpdateMechanism = "KB_RSM_ROLE_UPDATE_MECHANISM" KBEnvRoleProbeTimeout = "KB_RSM_ROLE_PROBE_TIMEOUT" KBEnvRoleProbePeriod = "KB_RSM_ROLE_PROBE_PERIOD" KBEnvVolumeProtectionSpec = "KB_VOLUME_PROTECTION_SPEC" )
Lorry
const ( EnableRBACManager = "EnableRBACManager" ManagedNamespacesFlag = "managed-namespaces" )
const ( // ShardSvcAnnotationKey defines the feature gate of creating service for each shard. // Sharding name defined in the annotation value, a set of Service defined in Cluster.Spec.Services with the ShardingSelector will be automatically generated for each shard when Cluster.Spec.ShardingSpecs[x].shards is not nil. // Multiple sharding names are separated by ','. for example: "kubeblocks.io/enabled-shard-svc: proxy-shard,db-shard" ShardSvcAnnotationKey = "kubeblocks.io/enabled-shard-svc" // HostNetworkAnnotationKey defines the feature gate to enable the host-network for specified components or shardings. HostNetworkAnnotationKey = "kubeblocks.io/host-network" // FeatureGateComponentReplicasAnnotation tells whether to add and update the annotation "component-replicas" to all pods of a Component FeatureGateComponentReplicasAnnotation = "COMPONENT_REPLICAS_ANNOTATION" // FeatureGateInPlacePodVerticalScaling specifies to enable in-place pod vertical scaling // NOTE: This feature depends on the InPlacePodVerticalScaling feature of the K8s cluster in which the KubeBlocks runs. FeatureGateInPlacePodVerticalScaling = "IN_PLACE_POD_VERTICAL_SCALING" // FeatureGateNoRSMEnv specifies not to create the '$(instanceset.name)-rsm-env' ConfigMap object. FeatureGateNoRSMEnv = "NO_RSM_ENV" )
const ( PostgreSQLCharacterType = "postgresql" MySQLCharacterType = "mysql" RedisCharacterType = "redis" MongoDBCharacterType = "mongodb" ETCDCharacterType = "etcd" PolarDBXCharacterType = "polardbx" )
const ( RoleProbeAction = "roleProbe" RebuildAction = "rebuild" HealthyCheckAction = "healthyCheck" MemberJoinAction = "memberJoin" MemberLeaveAction = "memberLeave" ReadonlyAction = "readonly" ReadWriteAction = "readwrite" AccountProvisionAction = "accountProvision" PostProvisionAction = "postProvision" PreTerminateAction = "preTerminate" DataDumpAction = "dataDump" DataLoadAction = "dataLoad" )
action keys
const ( TLSPayload = "tls" ComponentResourcePayload = "component-resource" ReplicasPayload = "replicas" BinaryVersionPayload = "binary-version" )
const ( ServiceKindPostgreSQL = "postgresql" ServiceKindMongoDB = "mongodb" ServiceKindClickHouse = "clickhouse" ServiceKindZookeeper = "zookeeper" ServiceKindElasticSearch = "elasticsearch" )
const ( VolumeName = "tls" CAName = "ca.crt" CertName = "tls.crt" KeyName = "tls.key" MountPath = "/etc/pki/tls" )
const EmptyInsTemplateName = ""
const (
FeatureGateIgnoreConfigTemplateDefaultMode = "IGNORE_CONFIG_TEMPLATE_DEFAULT_MODE"
)
const (
HorizontalScaleBackupPolicyTemplateKey = "apps.kubeblocks.io/horizontal-scale-backup-policy-template"
)
const InvalidContainerPort int32 = 0
const (
KBEnvNamespace = "KB_NAMESPACE"
)
Global
const (
KBEnvServiceAccountName = "KB_SA_NAME"
)
ServiceAccount
const (
KBGeneratedVirtualCompDefPrefix = "KB_GENERATED_VIRTUAL_COMP_DEF"
)
Variables ¶
This section is empty.
Functions ¶
func EnvPlaceHolder ¶ added in v0.8.0
func GenerateAccountSecretName ¶ added in v0.8.0
GenerateAccountSecretName generates the secret name of system accounts.
func GenerateClusterComponentEnvPattern ¶ added in v0.8.0
GenerateClusterComponentEnvPattern generates cluster and component pattern
func GenerateClusterComponentName ¶ added in v0.8.0
GenerateClusterComponentName generates the cluster component name.
func GenerateClusterServiceName ¶ added in v0.8.0
GenerateClusterServiceName generates the service name for cluster.
func GenerateComponentHeadlessServiceName ¶ added in v0.8.0
GenerateComponentHeadlessServiceName generates the headless service name for component.
func GenerateComponentServiceName ¶ added in v0.8.0
GenerateComponentServiceName generates the service name for component.
func GenerateDefaultComponentHeadlessServiceName ¶ added in v0.8.0
GenerateDefaultComponentHeadlessServiceName generates the default headless service name for component.
func GenerateDefaultComponentServiceName ¶ added in v0.8.0
GenerateDefaultComponentServiceName generates the default service name for component.
func GenerateDefaultConnCredential ¶ added in v0.8.0
GenerateDefaultConnCredential generates the default connection credential name for cluster. TODO: deprecated, will be removed later.
func GenerateDefaultServiceAccountName ¶ added in v0.8.0
GenerateDefaultServiceAccountName generates default service account name for a cluster.
func GeneratePodFQDN ¶ added in v0.8.0
GeneratePodFQDN generates the connection credential name for component.
func GeneratePodName ¶ added in v0.8.0
GeneratePodName generates the connection credential name for component.
func GeneratePodSubDomain ¶ added in v0.8.0
GeneratePodSubDomain generates the connection credential name for component.
func GenerateResourceNameWithScalingSuffix ¶ added in v0.9.0
GenerateResourceNameWithScalingSuffix generates name with '-scaling' suffix.
func GenerateServiceNamePattern ¶ added in v0.9.0
GenerateServiceNamePattern generates the service name pattern
func GenerateShardingNamePrefix ¶ added in v0.8.2
GenerateShardingNamePrefix generates sharding name prefix.
func GenerateShardingNameSvcPrefix ¶ added in v0.8.2
GenerateShardingNameSvcPrefix generates sharding service name prefix.
func GenerateShardingSharedAccountSecretName ¶ added in v0.9.2
GenerateShardingSharedAccountSecretName generates the sharding shared account secret name
func GenerateVirtualComponentDefinition ¶ added in v0.8.0
GenerateVirtualComponentDefinition generates the virtual component definition name.
func GenerateWorkloadNamePattern ¶ added in v0.9.0
GenerateWorkloadNamePattern generates the workload name pattern
func GetAppVersionLabel ¶ added in v0.8.0
GetAppVersionLabel returns the label for AppVersion
func GetClickHouseAlias ¶
func GetClickHouseAlias() []string
GetClickHouseAlias get clickhouse alias
func GetClusterCompDefLabel ¶ added in v0.8.0
GetClusterCompDefLabel returns the label for ClusterComponentDefinition (refer clusterDefinition.Spec.ComponentDefs[*].Name) TODO:ClusterCompDef will be deprecated in the future
func GetClusterDefTypeLabel ¶ added in v0.8.0
GetClusterDefTypeLabel returns the label for ClusterDefinition type (refer clusterDefinition.Spec.Type) TODO:clusterDefType will be deprecated in the future
func GetClusterWellKnownLabels ¶ added in v0.8.0
GetClusterWellKnownLabels returns the well-known labels for a cluster
func GetComponentDefLabel ¶ added in v0.8.0
GetComponentDefLabel returns the label for ComponentDefinition (refer ComponentDefinition.Name)
func GetComponentWellKnownLabels ¶ added in v0.8.0
GetComponentWellKnownLabels returns the well-known labels for Component API
func GetElasticSearchAlias ¶
func GetElasticSearchAlias() []string
GetElasticSearchAlias get elasticsearch alias
func GetKBConfigMapWellKnownLabels ¶ added in v0.8.0
func GetKBConfigMapWellKnownLabels(cmTplName, clusterDefName, clusterName, componentName string) map[string]string
GetKBConfigMapWellKnownLabels returns the well-known labels for KB ConfigMap
func GetKBGenerationAnnotation ¶ added in v0.9.0
GetKBGenerationAnnotation returns the annotation for kubeblocks generation.
func GetKBKnownLabels ¶ added in v0.9.2
GetKBKnownLabels returns the kb-known labels for the headless svc
func GetKBReservedAnnotationKeys ¶ added in v0.9.0
func GetKBReservedAnnotationKeys() []string
GetKBReservedAnnotationKeys returns the reserved annotation keys for KubeBlocks
func GetKBReservedLabelKeys ¶ added in v0.8.2
func GetKBReservedLabelKeys() []string
GetKBReservedLabelKeys returns the reserved label keys for KubeBlocks
func GetKBWellKnownLabels ¶ added in v0.8.0
GetKBWellKnownLabels returns the well-known labels for KB resources with ClusterDefinition API
func GetKBWellKnownLabelsWithCompDef ¶ added in v0.8.0
func GetKBWellKnownLabelsWithCompDef(compDefName, clusterName, componentName string) map[string]string
GetKBWellKnownLabelsWithCompDef returns the well-known labels for KB resources with ComponentDefinition API
func GetPostgreSQLAlias ¶
func GetPostgreSQLAlias() []string
GetPostgreSQLAlias get postgresql alias
func GetServiceVersionAnnotation ¶ added in v0.9.0
func GetShardingNameLabel ¶ added in v0.8.2
GetShardingNameLabel returns the shard template name label for component generated from shardSpec
func GetShardingWellKnownLabels ¶ added in v0.9.2
GetShardingWellKnownLabels returns the well-known labels for Sharding API
Types ¶
This section is empty.