Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertToResourceRequirements(resources *alluxiov1alpha1.ResourcesSpec) *corev1.ResourceRequirements
- func CreateAlluxioLoggerVolumeMounts() corev1.VolumeMount
- func CreateLoggerConfigMapKey(logger Logger) string
- func CreateMasterConfigMapName(instanceName string, groupName string) string
- func CreateRoleGroupLoggingConfigMapName(instanceName string, role string, groupName string) string
- func GetJobWorkerPorts(workerCfg *alluxiov1alpha1.WorkerRoleGroupSpec) *alluxiov1alpha1.JobWorkerPortsSpec
- func GetJournal(cluster *alluxiov1alpha1.ClusterConfigSpec) *alluxiov1alpha1.JournalSpec
- func GetStorageClass(origin string) *string
- func GetWorkerPorts(workerCfg *alluxiov1alpha1.WorkerRoleGroupSpec) *alluxiov1alpha1.WorkerPortsSpec
- func Log4jVolumeName() string
- func MergeObjects(left interface{}, right interface{}, exclude []string)
- func OverrideEnvVars(origin *[]corev1.EnvVar, override map[string]string)
- func PropertiesValue(logger Logger, loggingConfig *alluxiov1alpha1.LoggingConfigSpec) string
- func ReleaseCache()
- type BaseResourceReconciler
- type BaseRoleReconciler
- type ConditionsGetter
- type ConfigurationOverride
- type ConfigurationStyleReconciler
- type DeploymentStyleReconciler
- type GeneralResourceStyleReconciler
- type IReconciler
- type Logger
- type LoggingRecociler
- type MapCache
- type PDBReconciler
- type ResourceBuilder
- type ResourceHandler
- type ResourceNameGenerator
- type Role
- type RoleGroupRecociler
- type RoleLabels
- type RoleLoggingDataBuilder
- type RoleReconciler
- type WorkloadOverride
Constants ¶
const DefaultLog4jProperties = `` /* 10744-byte string literal not displayed */
const Log4jCfgName = "log4j.properties"
Variables ¶
var MergedCache = NewMapCache()
Functions ¶
func ConvertToResourceRequirements ¶
func ConvertToResourceRequirements(resources *alluxiov1alpha1.ResourcesSpec) *corev1.ResourceRequirements
func CreateAlluxioLoggerVolumeMounts ¶
func CreateAlluxioLoggerVolumeMounts() corev1.VolumeMount
func CreateMasterConfigMapName ¶
CreateMasterConfigMapName create configMap Name
func CreateRoleGroupLoggingConfigMapName ¶
CreateRoleGroupLoggingConfigMapName create role group logging config-map name
func GetJobWorkerPorts ¶
func GetJobWorkerPorts(workerCfg *alluxiov1alpha1.WorkerRoleGroupSpec) *alluxiov1alpha1.JobWorkerPortsSpec
GetJobWorkerPorts get job worker ports
func GetJournal ¶
func GetJournal(cluster *alluxiov1alpha1.ClusterConfigSpec) *alluxiov1alpha1.JournalSpec
func GetStorageClass ¶
func GetWorkerPorts ¶
func GetWorkerPorts(workerCfg *alluxiov1alpha1.WorkerRoleGroupSpec) *alluxiov1alpha1.WorkerPortsSpec
GetWorkerPorts get worker ports
func Log4jVolumeName ¶
func Log4jVolumeName() string
func MergeObjects ¶
func MergeObjects(left interface{}, right interface{}, exclude []string)
MergeObjects merge right to left, if field not in left, it will be added from right, else skip. Node: If variable is a pointer, it will be modified directly.
func PropertiesValue ¶
func PropertiesValue(logger Logger, loggingConfig *alluxiov1alpha1.LoggingConfigSpec) string
func ReleaseCache ¶
func ReleaseCache()
Types ¶
type BaseResourceReconciler ¶
type BaseResourceReconciler[T client.Object, G any] struct { Instance T Scheme *runtime.Scheme Client client.Client GroupName string MergedLabels map[string]string MergedCfg G }
func NewBaseResourceReconciler ¶
func NewBaseResourceReconciler[T client.Object, G any]( scheme *runtime.Scheme, instance T, client client.Client, groupName string, mergedLabels map[string]string, mergedCfg G) *BaseResourceReconciler[T, G]
NewBaseResourceReconciler new a BaseResourceReconciler
func (*BaseResourceReconciler[T, G]) ReconcileResource ¶
func (b *BaseResourceReconciler[T, G]) ReconcileResource( ctx context.Context, groupName string, resInstance ResourceBuilder) (ctrl.Result, error)
type BaseRoleReconciler ¶
type BaseRoleReconciler[R any] struct { Scheme *runtime.Scheme Instance *alluxiov1alpha1.AlluxioCluster Client client.Client Log logr.Logger Labels map[string]string Role R }
func (*BaseRoleReconciler[R]) EnabledClusterConfig ¶
func (r *BaseRoleReconciler[R]) EnabledClusterConfig() bool
type ConditionsGetter ¶
type ConfigurationOverride ¶
type ConfigurationStyleReconciler ¶
type ConfigurationStyleReconciler[T client.Object, G any] struct { GeneralResourceStyleReconciler[T, G] }
ConfigurationStyleReconciler configuration style reconciler this reconciler is used to reconcile the configuration style resources such as configMap, secret, etc. it will do the following things: 1. apply the resource Additional: 1. configuration override support
func (*ConfigurationStyleReconciler[T, G]) DoReconcile ¶
func (s *ConfigurationStyleReconciler[T, G]) DoReconcile( ctx context.Context, resource client.Object, instance ResourceHandler, ) (ctrl.Result, error)
type DeploymentStyleReconciler ¶
type DeploymentStyleReconciler[T client.Object, G any] struct { BaseResourceReconciler[T, G] // contains filtered or unexported fields }
DeploymentStyleReconciler deployment style reconciler this reconciler is used to reconcile the deployment style resources such as deployment, statefulSet, etc. it will do the following things: 1. apply the resource 2. check if the resource is satisfied 3. if not, return requeue 4. if satisfied, return nil Additional:
command and env override can support
func (*DeploymentStyleReconciler[T, G]) CheckPodsSatisfied ¶
func (s *DeploymentStyleReconciler[T, G]) CheckPodsSatisfied(ctx context.Context) (bool, error)
func (*DeploymentStyleReconciler[T, G]) DoReconcile ¶
func (s *DeploymentStyleReconciler[T, G]) DoReconcile( ctx context.Context, resource client.Object, instance ResourceHandler, ) (ctrl.Result, error)
type GeneralResourceStyleReconciler ¶
type GeneralResourceStyleReconciler[T client.Object, G any] struct { BaseResourceReconciler[T, G] }
GeneralResourceStyleReconciler general style resource reconcile this reconciler is used to reconcile the general style resources such as configMap, secret, svc, etc.
func (*GeneralResourceStyleReconciler[T, G]) DoReconcile ¶
func (s *GeneralResourceStyleReconciler[T, G]) DoReconcile( ctx context.Context, resource client.Object, _ ResourceHandler, ) (ctrl.Result, error)
type IReconciler ¶
type LoggingRecociler ¶
type LoggingRecociler struct { GeneralResourceStyleReconciler[*alluxiov1alpha1.AlluxioCluster, any] RoleLoggingDataBuilder RoleLoggingDataBuilder // contains filtered or unexported fields }
func NewLoggingReconciler ¶
func NewLoggingReconciler( scheme *runtime.Scheme, instance *alluxiov1alpha1.AlluxioCluster, client client.Client, groupName string, mergedLabels map[string]string, mergedCfg any, logDataBuilder RoleLoggingDataBuilder, role Role, ) *LoggingRecociler
NewLoggingReconciler new logging reconcile
type MapCache ¶
type MapCache struct {
// contains filtered or unexported fields
}
func NewMapCache ¶
func NewMapCache() *MapCache
type PDBReconciler ¶
type PDBReconciler struct { BaseResourceReconciler[*alluxiov1alpha1.AlluxioCluster, any] // contains filtered or unexported fields }
func NewReconcilePDB ¶
func NewReconcilePDB( client client.Client, schema *runtime.Scheme, cr *alluxiov1alpha1.AlluxioCluster, labels map[string]string, name string, pdb *alluxiov1alpha1.PodDisruptionBudgetSpec, ) *PDBReconciler
type ResourceBuilder ¶
type ResourceHandler ¶
type ResourceNameGenerator ¶
func NewResourceNameGenerator ¶
func NewResourceNameGenerator(instanceName, roleName, groupName string) *ResourceNameGenerator
NewResourceNameGenerator new a ResourceNameGenerator
func (*ResourceNameGenerator) GenerateResourceName ¶
func (r *ResourceNameGenerator) GenerateResourceName(extraSuffix string) string
GenerateResourceName generate resource Name
type RoleGroupRecociler ¶
type RoleGroupRecociler interface { ReconcileGroup(ctx context.Context) (ctrl.Result, error) MergeLabels(mergedGroupCfg any) map[string]string MergeGroupConfigSpec() any }
RoleGroupRecociler RoleReconcile role reconciler interface all role reconciler should implement this interface
type RoleLabels ¶
type RoleLabels struct { Cr *alluxiov1alpha1.AlluxioCluster Name string }
func (*RoleLabels) GetLabels ¶
func (r *RoleLabels) GetLabels() map[string]string