Documentation ¶
Index ¶
- Constants
- func ClusterServiceName(instanceName string) string
- func CreateDeploymentReconciler(contanerBuilder *ContainerBuilder, ctx context.Context, client *client.Client, ...) reconciler.ResourceReconciler[builder.DeploymentBuilder]
- func CreateDnsDomain(svcName, namespace, clusterDomain string, port int32) string
- func CreateDomainHost(svcName, namespace, clusterDomain string) string
- func CreateKvContentByReplicas(replicas int32, keyTemplate string, valueTemplate string) [][2]string
- func CreateNetworkUrl(podName string, svcName, namespace, clusterDomain string, port int32) string
- func CreatePodNamesByReplicas(replicas int32, statefulResourceName string) []string
- func CreateStatefulSetReconciler(containerBuilder *ContainerBuilder, ctx context.Context, client *client.Client, ...) reconciler.ResourceReconciler[builder.StatefulSetBuilder]
- func DeploymentName(roleGroupInfo *reconciler.RoleGroupInfo) string
- func ExtendConfigMapDataByVector(ctx context.Context, params VectorConfigParams, data map[string]string)
- func ExtendWorkloadByVector(image *util.Image, workloadObject ctrlclient.Object, ...)
- func FixExecPermission(role string) string
- func IsVectorEnable(loggingConfig *commonsv1alpha1.LoggingSpec) bool
- func NewConfigMapReconciler(ctx context.Context, client *client.Client, ...) reconciler.ResourceReconciler[*builder.ConfigMapBuilder]
- func NewDeploymentReconciler(ctx context.Context, client *client.Client, stopped bool, image *util.Image, ...) reconciler.ResourceReconciler[builder.DeploymentBuilder]
- func NewEnvConfigMapReconciler(ctx context.Context, client *client.Client, ...) reconciler.ResourceReconciler[*builder.ConfigMapBuilder]
- func NewServiceBuilder(client *client.Client, name string, headless bool, ...) builder.ServiceBuilder
- func NewServiceReconciler(cli *client.Client, name string, headless bool, ...) *reconciler.Service
- func NewStatefulSetReconciler(ctx context.Context, client *client.Client, stopped bool, image *util.Image, ...) reconciler.ResourceReconciler[builder.StatefulSetBuilder]
- func PodFQDN(podName, svcName, namespace string) string
- func RoleBinBaseDir(role util.Role) string
- func RoleBindName(instanceName string) string
- func RoleConfigPath(role util.Role, configFileName string) string
- func RoleExecArgs(role string) string
- func RoleGroupConfigMapName(roleGroupInfo *reconciler.RoleGroupInfo) string
- func RoleGroupEnvsConfigMapName(instanceName string) string
- func RoleGroupServiceName(roleGroupInfo *reconciler.RoleGroupInfo) string
- func RoleName(instanceName string) string
- func RoleServer(role util.Role) string
- func ServiceAccountName(instanceName string) string
- func StatefulsetName(roleGroupInfo *reconciler.RoleGroupInfo) string
- func ToContainerPortInt32(n interface{}) (int32Port int32, err error)
- type CommonPropertiesGenerator
- type ContainerBuilder
- func (c *ContainerBuilder) AddEnvFromSecret(secretName string, envToSecretKeymap map[string]string) *ContainerBuilder
- func (c *ContainerBuilder) Build() *corev1.Container
- func (c *ContainerBuilder) CommonCommandArgs() *ContainerBuilder
- func (c *ContainerBuilder) GetCommandArgs() []string
- func (c *ContainerBuilder) ResetCommandArgs(script string) *ContainerBuilder
- func (c *ContainerBuilder) ResetVolumeMounts() *ContainerBuilder
- func (c *ContainerBuilder) WithEnvs(envMap util.SortedMap) *ContainerBuilder
- func (c *ContainerBuilder) WithPorts(portMap util.SortedMap) *ContainerBuilder
- func (c *ContainerBuilder) WithReadinessAndLivenessProbe(port int) *ContainerBuilder
- func (c *ContainerBuilder) WithSecretEnvFrom(secretName string) *ContainerBuilder
- func (c *ContainerBuilder) WithVolumeMounts(vmMap util.SortedMap) *ContainerBuilder
- type DeploymentBuilder
- type DolphinSchedulerConfig
- func (c *DolphinSchedulerConfig) ComputeCli() (map[string]string, error)
- func (c *DolphinSchedulerConfig) ComputeEnv() (map[string]string, error)
- func (c *DolphinSchedulerConfig) ComputeFile() (map[string]interface{}, error)
- func (c *DolphinSchedulerConfig) MergeDefaultConfig(overrides *commonsv1alpha1.OverridesSpec, ...) error
- type EnvConfigmapDataGenerator
- type GeneralNodeConfig
- type LogbackConfig
- type LogbackXmlGenerator
- type RoleReconciler
- type RoleResourceReconcilersBuilder
- type StatefulSetBuilder
- type VectorConfigParams
- type WorkloadBuilder
- func (w *WorkloadBuilder) ExtractAffinity() (*corev1.Affinity, error)
- func (w *WorkloadBuilder) GetPvcTemplates() []corev1.PersistentVolumeClaim
- func (w *WorkloadBuilder) VectorDecorator(workloadObject ctrlclient.Object, image *util.Image)
- func (w *WorkloadBuilder) WithPvcTemplates(pvcName string, storageSize resource.Quantity) *WorkloadBuilder
- func (w *WorkloadBuilder) WithVolumes(volumes []corev1.Volume)
Constants ¶
const Alerter util.Role = "alert"
const Api util.Role = "api"
const ContainerVector = "vector"
const (
DefaultServerGrace = 120
)
const Master util.Role = "master"
const Worker util.Role = "worker"
Variables ¶
This section is empty.
Functions ¶
func ClusterServiceName ¶
func CreateDeploymentReconciler ¶
func CreateDeploymentReconciler( contanerBuilder *ContainerBuilder, ctx context.Context, client *client.Client, image *opgoutil.Image, replicas *int32, clusterOperation *commonsv1alpha1.ClusterOperationSpec, roleGroupInfo *reconciler.RoleGroupInfo, overrides *commonsv1alpha1.OverridesSpec, roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, zkConfigMapName string, volumes []corev1.Volume) reconciler.ResourceReconciler[builder.DeploymentBuilder]
func CreateDnsDomain ¶
func CreateDomainHost ¶
func CreateNetworkUrl ¶
func CreatePodNamesByReplicas ¶
CreatePodNamesByReplicas create pod names by replicas
func CreateStatefulSetReconciler ¶
func CreateStatefulSetReconciler( containerBuilder *ContainerBuilder, ctx context.Context, client *client.Client, image *opgoutil.Image, replicas *int32, clusterOperation *commonsv1alpha1.ClusterOperationSpec, roleGroupInfo *reconciler.RoleGroupInfo, overrides *commonsv1alpha1.OverridesSpec, roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, zkConfigMapName string, pvcName string) reconciler.ResourceReconciler[builder.StatefulSetBuilder]
func DeploymentName ¶
func DeploymentName(roleGroupInfo *reconciler.RoleGroupInfo) string
func ExtendConfigMapDataByVector ¶
func ExtendConfigMapDataByVector(ctx context.Context, params VectorConfigParams, data map[string]string)
func ExtendWorkloadByVector ¶
func ExtendWorkloadByVector( image *util.Image, workloadObject ctrlclient.Object, vectorConfigMapName string)
func FixExecPermission ¶
func IsVectorEnable ¶
func IsVectorEnable(loggingConfig *commonsv1alpha1.LoggingSpec) bool
func NewConfigMapReconciler ¶
func NewConfigMapReconciler( ctx context.Context, client *client.Client, roleGroupInf *reconciler.RoleGroupInfo, contaienr util.ContainerComponent, overrides *commonsv1alpha1.OverridesSpec, roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, ) reconciler.ResourceReconciler[*builder.ConfigMapBuilder]
func NewDeploymentReconciler ¶
func NewDeploymentReconciler( ctx context.Context, client *client.Client, stopped bool, image *util.Image, replicas *int32, roleGroupInfo *reconciler.RoleGroupInfo, overrides *commonsv1alpha1.OverridesSpec, roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, containers []corev1.Container, volumes []corev1.Volume) reconciler.ResourceReconciler[builder.DeploymentBuilder]
func NewEnvConfigMapReconciler ¶
func NewEnvConfigMapReconciler( ctx context.Context, client *client.Client, overrides *commonsv1alpha1.OverridesSpec, roleGroupInfo *reconciler.RoleGroupInfo, ) reconciler.ResourceReconciler[*builder.ConfigMapBuilder]
func NewServiceBuilder ¶
func NewServiceReconciler ¶
func NewStatefulSetReconciler ¶
func NewStatefulSetReconciler( ctx context.Context, client *client.Client, stopped bool, image *util.Image, replicas *int32, roleGroupInfo *reconciler.RoleGroupInfo, overrides *commonsv1alpha1.OverridesSpec, roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, containers []corev1.Container, pvcName string, storageSize *resource.Quantity) reconciler.ResourceReconciler[builder.StatefulSetBuilder]
func RoleBinBaseDir ¶
func RoleBindName ¶
func RoleExecArgs ¶
func RoleGroupConfigMapName ¶
func RoleGroupConfigMapName(roleGroupInfo *reconciler.RoleGroupInfo) string
func RoleGroupServiceName ¶
func RoleGroupServiceName(roleGroupInfo *reconciler.RoleGroupInfo) string
func RoleServer ¶
func ServiceAccountName ¶
func StatefulsetName ¶
func StatefulsetName(roleGroupInfo *reconciler.RoleGroupInfo) string
func ToContainerPortInt32 ¶
Types ¶
type CommonPropertiesGenerator ¶
type CommonPropertiesGenerator struct {
// contains filtered or unexported fields
}
func (*CommonPropertiesGenerator) FileName ¶
func (c *CommonPropertiesGenerator) FileName() string
FileName implements config.FileContentGenerator.
type ContainerBuilder ¶
type ContainerBuilder struct { *builder.Container ZookeeperConfigMapName string RoleGroupInfo *reconciler.RoleGroupInfo RoleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec // contains filtered or unexported fields }
func NewContainerBuilder ¶
func NewContainerBuilder( contaienr util.ContainerComponent, image *opgoutil.Image, zookeeperConfigMapName string, roleGroupInfo *reconciler.RoleGroupInfo, roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, ) *ContainerBuilder
func (*ContainerBuilder) AddEnvFromSecret ¶
func (c *ContainerBuilder) AddEnvFromSecret(secretName string, envToSecretKeymap map[string]string) *ContainerBuilder
env map from secret
func (*ContainerBuilder) Build ¶
func (c *ContainerBuilder) Build() *corev1.Container
build container
func (*ContainerBuilder) CommonCommandArgs ¶
func (c *ContainerBuilder) CommonCommandArgs() *ContainerBuilder
with command args
func (*ContainerBuilder) GetCommandArgs ¶
func (c *ContainerBuilder) GetCommandArgs() []string
get command args
func (*ContainerBuilder) ResetCommandArgs ¶
func (c *ContainerBuilder) ResetCommandArgs(script string) *ContainerBuilder
reset command args
func (*ContainerBuilder) ResetVolumeMounts ¶
func (c *ContainerBuilder) ResetVolumeMounts() *ContainerBuilder
reset volume mounts
func (*ContainerBuilder) WithEnvs ¶
func (c *ContainerBuilder) WithEnvs(envMap util.SortedMap) *ContainerBuilder
with envs key is env name, value is env value
func (*ContainerBuilder) WithPorts ¶
func (c *ContainerBuilder) WithPorts(portMap util.SortedMap) *ContainerBuilder
with ports key is port name, value is port
func (*ContainerBuilder) WithReadinessAndLivenessProbe ¶
func (c *ContainerBuilder) WithReadinessAndLivenessProbe(port int) *ContainerBuilder
with readiness probe and liveness probe port is service port
func (*ContainerBuilder) WithSecretEnvFrom ¶
func (c *ContainerBuilder) WithSecretEnvFrom(secretName string) *ContainerBuilder
with secret env from key is envfrom name, value is envfrom value
func (*ContainerBuilder) WithVolumeMounts ¶
func (c *ContainerBuilder) WithVolumeMounts(vmMap util.SortedMap) *ContainerBuilder
with volume mounts key is volume name, value is mount path
type DeploymentBuilder ¶
type DeploymentBuilder struct { *builder.Deployment *WorkloadBuilder }
func (*DeploymentBuilder) Build ¶
func (b *DeploymentBuilder) Build(ctx context.Context) (ctrlclient.Object, error)
type DolphinSchedulerConfig ¶
type DolphinSchedulerConfig struct {
// contains filtered or unexported fields
}
func DefaultConfig ¶
func DefaultConfig(role util.Role, crName string) *DolphinSchedulerConfig
func (*DolphinSchedulerConfig) ComputeCli ¶
func (c *DolphinSchedulerConfig) ComputeCli() (map[string]string, error)
ComputeClient implements config.Configuration.
func (*DolphinSchedulerConfig) ComputeEnv ¶
func (c *DolphinSchedulerConfig) ComputeEnv() (map[string]string, error)
ComputeEnv implements config.Configuration.
func (*DolphinSchedulerConfig) ComputeFile ¶
func (c *DolphinSchedulerConfig) ComputeFile() (map[string]interface{}, error)
ComputeFile implements config.Configuration.
func (*DolphinSchedulerConfig) MergeDefaultConfig ¶
func (c *DolphinSchedulerConfig) MergeDefaultConfig( overrides *commonsv1alpha1.OverridesSpec, mergedCfg *dolphinv1alpha1.ConfigSpec, ) error
merge defaultConfig
type EnvConfigmapDataGenerator ¶
type EnvConfigmapDataGenerator struct {
// contains filtered or unexported fields
}
type GeneralNodeConfig ¶
type GeneralNodeConfig struct { Affinity *corev1.Affinity // contains filtered or unexported fields }
func (*GeneralNodeConfig) GetgracefulShutdownTimeoutSeconds ¶
func (G *GeneralNodeConfig) GetgracefulShutdownTimeoutSeconds() *string
type LogbackConfig ¶
type LogbackConfig struct {
// contains filtered or unexported fields
}
LogbackConfig is a struct that contains logback logging configuration
func NewConfigGenerator ¶
func NewConfigGenerator( loggingConfigSpec *loggingv1alpha1.LoggingConfigSpec, containerName string, logFileName string, logType productlogging.LogType, opts ...productlogging.ConfigGeneratorOptionFunc, ) (*LogbackConfig, error)
func (*LogbackConfig) Content ¶
func (l *LogbackConfig) Content() (string, error)
Content implements the LoggingConfig interface
func (*LogbackConfig) LoggerFormatter ¶
func (l *LogbackConfig) LoggerFormatter(name string, level string) string
LoggerFormatter implements the LoggingConfig interface
func (*LogbackConfig) String ¶
func (l *LogbackConfig) String() string
String implements the LoggingConfig interface
func (*LogbackConfig) Template ¶
func (l *LogbackConfig) Template() string
Template implements the LoggingConfig interface
type LogbackXmlGenerator ¶
type LogbackXmlGenerator struct {
// contains filtered or unexported fields
}
func (*LogbackXmlGenerator) FileName ¶
func (l *LogbackXmlGenerator) FileName() string
FileName implements config.FileContentGenerator.
type RoleReconciler ¶
type RoleReconciler struct { reconciler.BaseRoleReconciler[dolphinv1alpha1.RoleSpec] ClusterConfig *dolphinv1alpha1.ClusterConfigSpec Image *opgoutil.Image // contains filtered or unexported fields }
func NewRoleReconciler ¶
func NewRoleReconciler( client *client.Client, roleInfo reconciler.RoleInfo, clusterOperation *commonsv1alpha1.ClusterOperationSpec, clusterConfig *dolphinv1alpha1.ClusterConfigSpec, image *opgoutil.Image, spec dolphinv1alpha1.RoleSpec, roleResourceReconcilersBuilder RoleResourceReconcilersBuilder, ) *RoleReconciler
func (*RoleReconciler) RegisterResourceWithRoleGroup ¶
func (r *RoleReconciler) RegisterResourceWithRoleGroup( ctx context.Context, replicas *int32, info *reconciler.RoleGroupInfo, overrides *commonsv1alpha1.OverridesSpec, roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, ) ([]reconciler.Reconciler, error)
func (*RoleReconciler) RegisterResources ¶
func (r *RoleReconciler) RegisterResources(ctx context.Context) error
type RoleResourceReconcilersBuilder ¶
type RoleResourceReconcilersBuilder interface { ResourceReconcilers( ctx context.Context, replicas *int32, info *reconciler.RoleGroupInfo, overrides *commonsv1alpha1.OverridesSpec, roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, ) []reconciler.Reconciler }
type StatefulSetBuilder ¶
type StatefulSetBuilder struct { *builder.StatefulSet *WorkloadBuilder }
statefulset builder
func (*StatefulSetBuilder) Build ¶
func (b *StatefulSetBuilder) Build(ctx context.Context) (ctrlclient.Object, error)
type VectorConfigParams ¶
type VectorConfigParams struct { Client ctrlclient.Client ClusterConfig *v1alpha1.ClusterConfigSpec Namespace string InstanceName string Role string GroupName string }
type WorkloadBuilder ¶
type WorkloadBuilder struct { RoleGroupInf *reconciler.RoleGroupInfo Containers []corev1.Container RoleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec // contains filtered or unexported fields }
workload builder
func NewWorkloadBuilder ¶
func NewWorkloadBuilder( roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec, rolegroupInfo *reconciler.RoleGroupInfo, containers []corev1.Container) *WorkloadBuilder
func (*WorkloadBuilder) ExtractAffinity ¶
func (w *WorkloadBuilder) ExtractAffinity() (*corev1.Affinity, error)
set Affinity
func (*WorkloadBuilder) GetPvcTemplates ¶
func (w *WorkloadBuilder) GetPvcTemplates() []corev1.PersistentVolumeClaim
get pvc templates
func (*WorkloadBuilder) VectorDecorator ¶
func (w *WorkloadBuilder) VectorDecorator(workloadObject ctrlclient.Object, image *util.Image)
decoraate vector
func (*WorkloadBuilder) WithPvcTemplates ¶
func (w *WorkloadBuilder) WithPvcTemplates(pvcName string, storageSize resource.Quantity) *WorkloadBuilder
with pvc templates
func (*WorkloadBuilder) WithVolumes ¶
func (w *WorkloadBuilder) WithVolumes(volumes []corev1.Volume)
with volumes