Documentation ¶
Index ¶
- Constants
- func ConvertToResourceRequirements(resources *sparkv1alpha1.ResourcesSpec) *corev1.ResourceRequirements
- func MergeObjects(left interface{}, right interface{}, exclude []string)
- func OverrideEnvVars(origin *[]corev1.EnvVar, override map[string]string)
- type BaseResourceReconciler
- type BaseRoleReconciler
- type ClusterOperation
- type ConditionsGetter
- type ConfigurationOverride
- type ConfigurationStyleReconciler
- type DeploymentStyleReconciler
- type GeneralResourceStyleReconciler
- type IReconciler
- type InstanceAttributes
- type ListenerInfo
- type PDBReconciler
- type ResourceBuilder
- type ResourceClient
- type ResourceHandler
- type ResourceNameGenerator
- type Role
- type RoleGroupRecociler
- type RoleLabels
- type RoleReconciler
- type S3Configuration
- func (s *S3Configuration[T]) Enabled() bool
- func (s *S3Configuration[T]) ExistingS3Bucket() bool
- func (s *S3Configuration[T]) GetCredential(name string) (*S3Credential, error)
- func (s *S3Configuration[T]) GetRefBucket() (*commonsv1alpha1.S3Bucket, error)
- func (s *S3Configuration[T]) GetRefBucketName() string
- func (s *S3Configuration[T]) GetRefConnection(name string) (*commonsv1alpha1.S3Connection, error)
- func (s *S3Configuration[T]) GetS3ParamsFromInline() (*S3Params, error)
- func (s *S3Configuration[T]) GetS3ParamsFromResource() (*S3Params, error)
- type S3Credential
- type S3Params
- type WorkloadOverride
Constants ¶
const ( S3AccessKeyName = "ACCESS_KEY" S3SecretKeyName = "SECRET_KEY" )
Variables ¶
This section is empty.
Functions ¶
func ConvertToResourceRequirements ¶
func ConvertToResourceRequirements(resources *sparkv1alpha1.ResourcesSpec) *corev1.ResourceRequirements
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.
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, resInstance ResourceBuilder) (ctrl.Result, error)
type BaseRoleReconciler ¶
type ClusterOperation ¶
type ClusterOperation[T InstanceAttributes] struct { InstanceAttributes T ResourceClient ResourceClient }
func NewClusterOperation ¶
func NewClusterOperation(ia InstanceAttributes, resourceClient ResourceClient) *ClusterOperation[InstanceAttributes]
func (*ClusterOperation[T]) ClusterStop ¶
func (c *ClusterOperation[T]) ClusterStop() bool
func (*ClusterOperation[T]) ReconciliationPaused ¶
func (c *ClusterOperation[T]) ReconciliationPaused() 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 InstanceAttributes ¶
type InstanceAttributes interface { GetClusterConfig() *sparkv1alpha1.ClusterConfigSpec GetClusterOperation() *sparkv1alpha1.ClusterOperationSpec }
type ListenerInfo ¶
type ListenerInfo[T InstanceAttributes] struct { InstanceAttributes T ResourceClient ResourceClient }
func NewListenerInfo ¶
func NewListenerInfo(ia InstanceAttributes, resourceClient ResourceClient) *ListenerInfo[InstanceAttributes]
func (*ListenerInfo[T]) GetListenerClassName ¶
func (l *ListenerInfo[T]) GetListenerClassName() sparkv1alpha1.ListenerClass
func (*ListenerInfo[T]) GetServiceType ¶
func (l *ListenerInfo[T]) GetServiceType() corev1.ServiceType
TODO: move ListenerClass mapping to ServiceType logic to listener project Finnaly, we should use it from operator-go project
type PDBReconciler ¶
type PDBReconciler[T client.Object] struct { BaseResourceReconciler[T, any] // contains filtered or unexported fields }
func NewReconcilePDB ¶
func NewReconcilePDB[T client.Object]( client client.Client, schema *runtime.Scheme, cr T, labels map[string]string, name string, pdb *sparkv1alpha1.PodDisruptionBudgetSpec, ) *PDBReconciler[T]
type ResourceBuilder ¶
type ResourceClient ¶
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 ¶
func (*RoleLabels[T]) GetLabels ¶
func (r *RoleLabels[T]) GetLabels() map[string]string
type RoleReconciler ¶
type S3Configuration ¶
type S3Configuration[T InstanceAttributes] struct { InstanceAttributes T ResourceClient ResourceClient }
func NewS3Configuration ¶
func NewS3Configuration(ia InstanceAttributes, resourceClient ResourceClient) *S3Configuration[InstanceAttributes]
func (*S3Configuration[T]) Enabled ¶
func (s *S3Configuration[T]) Enabled() bool
func (*S3Configuration[T]) ExistingS3Bucket ¶
func (s *S3Configuration[T]) ExistingS3Bucket() bool
func (*S3Configuration[T]) GetCredential ¶
func (s *S3Configuration[T]) GetCredential(name string) (*S3Credential, error)
func (*S3Configuration[T]) GetRefBucket ¶
func (s *S3Configuration[T]) GetRefBucket() (*commonsv1alpha1.S3Bucket, error)
func (*S3Configuration[T]) GetRefBucketName ¶
func (s *S3Configuration[T]) GetRefBucketName() string
func (*S3Configuration[T]) GetRefConnection ¶
func (s *S3Configuration[T]) GetRefConnection(name string) (*commonsv1alpha1.S3Connection, error)
func (*S3Configuration[T]) GetS3ParamsFromInline ¶
func (s *S3Configuration[T]) GetS3ParamsFromInline() (*S3Params, error)
func (*S3Configuration[T]) GetS3ParamsFromResource ¶
func (s *S3Configuration[T]) GetS3ParamsFromResource() (*S3Params, error)