component

package
v0.6.0-alpha.20 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRestoreInfoFromBackup

func BuildRestoreInfoFromBackup(reqCtx intctrlutil.RequestCtx, cli client.Client, cluster appsv1alpha1.Cluster,
	component *SynthesizedComponent) error

BuildRestoreInfoFromBackup restore from snapshot or datafile Deprecated: using DoRestore function instead.

func BuildRestoredInfo

func BuildRestoredInfo(reqCtx intctrlutil.RequestCtx,
	cli client.Client,
	namespace string,
	component *SynthesizedComponent,
	backupName string) error

BuildRestoredInfo builds restore infos when restore from backup, such as init-container, pvc dataSource. Deprecated: using DoRestore function instead.

func BuildTolerations added in v0.6.0

func BuildTolerations(cluster *appsv1alpha1.Cluster, clusterCompSpec *appsv1alpha1.ClusterComponentSpec) ([]corev1.Toleration, error)

BuildTolerations builds tolerations from config

func GenerateComponentEnvName added in v0.6.0

func GenerateComponentEnvName(clusterName, componentName string) string

func GenerateConnCredential

func GenerateConnCredential(clusterName string) string

func GetEnvReplacementMapForConnCredential

func GetEnvReplacementMapForConnCredential(clusterName string) map[string]string

GetEnvReplacementMapForConnCredential gets the replacement map for connect credential

func GetReplacementMapForBuiltInEnv

func GetReplacementMapForBuiltInEnv(clusterName, clusterUID, componentName string) map[string]string

GetReplacementMapForBuiltInEnv gets the replacement map for KubeBlocks built-in environment variables.

func GetRestoredInitContainerName

func GetRestoredInitContainerName(backupName string) string

GetRestoredInitContainerName gets the restore init container name. Deprecated: using DoRestore function instead.

func ReplaceNamedVars

func ReplaceNamedVars(namedValuesMap map[string]string, targetVar string, limits int, matchAll bool) string

ReplaceNamedVars replaces the placeholder in targetVar if it is match and returns the replaced result

func ReplaceSecretEnvVars

func ReplaceSecretEnvVars(namedValuesMap map[string]string, envs []corev1.EnvVar) []corev1.EnvVar

ReplaceSecretEnvVars replaces the env secret value with namedValues and returns new envs

Types

type MonitorConfig

type MonitorConfig struct {
	Enable     bool   `json:"enable"`
	BuiltIn    bool   `json:"builtIn"`
	ScrapePort int32  `json:"scrapePort,omitempty"`
	ScrapePath string `json:"scrapePath,omitempty"`
}

type SynthesizedComponent

type SynthesizedComponent struct {
	ClusterDefName        string                                 `json:"clusterDefName,omitempty"`
	ClusterName           string                                 `json:"clusterName,omitempty"`
	ClusterUID            string                                 `json:"clusterUID,omitempty"`
	Name                  string                                 `json:"name,omitempty"`
	CompDefName           string                                 `json:"compDefName,omitempty"`
	CharacterType         string                                 `json:"characterType,omitempty"`
	MinAvailable          *intstr.IntOrString                    `json:"minAvailable,omitempty"`
	Replicas              int32                                  `json:"replicas"`
	WorkloadType          v1alpha1.WorkloadType                  `json:"workloadType,omitempty"`
	StatelessSpec         *v1alpha1.StatelessSetSpec             `json:"statelessSpec,omitempty"`
	StatefulSpec          *v1alpha1.StatefulSetSpec              `json:"statefulSpec,omitempty"`
	ConsensusSpec         *v1alpha1.ConsensusSetSpec             `json:"consensusSpec,omitempty"`
	ReplicationSpec       *v1alpha1.ReplicationSetSpec           `json:"replicationSpec,omitempty"`
	PrimaryIndex          *int32                                 `json:"primaryIndex,omitempty"`
	PodSpec               *corev1.PodSpec                        `json:"podSpec,omitempty"`
	Services              []corev1.Service                       `json:"services,omitempty"`
	Probes                *v1alpha1.ClusterDefinitionProbes      `json:"probes,omitempty"`
	VolumeClaimTemplates  []corev1.PersistentVolumeClaimTemplate `json:"volumeClaimTemplates,omitempty"`
	Monitor               *MonitorConfig                         `json:"monitor,omitempty"`
	EnabledLogs           []string                               `json:"enabledLogs,omitempty"`
	LogConfigs            []v1alpha1.LogConfig                   `json:"logConfigs,omitempty"`
	ConfigTemplates       []v1alpha1.ComponentConfigSpec         `json:"configTemplates,omitempty"`
	ScriptTemplates       []v1alpha1.ComponentTemplateSpec       `json:"scriptTemplates,omitempty"`
	HorizontalScalePolicy *v1alpha1.HorizontalScalePolicy        `json:"horizontalScalePolicy,omitempty"`
	TLS                   bool                                   `json:"tls"`
	Issuer                *v1alpha1.Issuer                       `json:"issuer,omitempty"`
	VolumeTypes           []v1alpha1.VolumeTypeSpec              `json:"volumeTypes,omitempty"`
	CustomLabelSpecs      []v1alpha1.CustomLabelSpec             `json:"customLabelSpecs,omitempty"`
	ComponentDef          string                                 `json:"componentDef,omitempty"`
	ServiceAccountName    string                                 `json:"serviceAccountName,omitempty"`
	StatefulSetWorkload   v1alpha1.StatefulSetWorkload
}

func (*SynthesizedComponent) GetPrimaryIndex

func (r *SynthesizedComponent) GetPrimaryIndex() int32

GetPrimaryIndex provides PrimaryIndex value getter, if PrimaryIndex is a nil pointer it's treated as 0, return -1 if function receiver is nil.

Jump to

Keyboard shortcuts

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