Documentation ¶
Index ¶
- Constants
- func ExtendConfigMapByVector(ctx context.Context, params VectorConfigParams, data map[string]string)
- func ExtendWorkloadByVector(image *util.Image, logProvider []string, dep *appsv1.StatefulSet, ...)
- func IsVectorEnable(roleLoggingConfig *kafkav1alpha1.BrokersContainerLoggingSpec) bool
- func MergeConfig(masterRole *kafkav1alpha1.BrokersSpec, ...) *kafkav1alpha1.BrokersRoleGroupSpec
- func NewRole(scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, ...) *common.GenericRoleReconciler[*kafkav1alpha1.KafkaCluster, any]
- func NewRoleBinding(scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, ...) *common.GenericRoleBindingReconciler[*kafkav1alpha1.KafkaCluster, any]
- func NewServiceAccount(scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, ...) *common.GenericServiceAccountReconciler[*kafkav1alpha1.KafkaCluster, any]
- type ClusterReconciler
- type ConfigMapReconciler
- type Discovery
- type KafkaClusterInstance
- type KafkaClusterReconciler
- type Role
- type RoleGroup
- type StatefulSetReconciler
- func (s *StatefulSetReconciler) Build(ctx context.Context) (client.Object, error)
- func (s *StatefulSetReconciler) CommandOverride(resource client.Object)
- func (s *StatefulSetReconciler) EnvOverride(resource client.Object)
- func (s *StatefulSetReconciler) GetConditions() *[]metav1.Condition
- func (s *StatefulSetReconciler) LogOverride(_ client.Object)
- func (s *StatefulSetReconciler) SetAffinity(resource client.Object)
- type VectorConfigParams
Constants ¶
const ContainerVector = "vector"
Variables ¶
This section is empty.
Functions ¶
func ExtendConfigMapByVector ¶
func ExtendConfigMapByVector(ctx context.Context, params VectorConfigParams, data map[string]string)
func ExtendWorkloadByVector ¶
func IsVectorEnable ¶
func IsVectorEnable(roleLoggingConfig *kafkav1alpha1.BrokersContainerLoggingSpec) bool
func MergeConfig ¶
func MergeConfig(masterRole *kafkav1alpha1.BrokersSpec, group *kafkav1alpha1.BrokersRoleGroupSpec) *kafkav1alpha1.BrokersRoleGroupSpec
MergeConfig merge the role's config into the role group's config
func NewRole ¶
func NewRole( scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, client client.Client, mergedLabels map[string]string, mergedCfg *kafkav1alpha1.BrokersRoleGroupSpec, ) *common.GenericRoleReconciler[*kafkav1alpha1.KafkaCluster, any]
NewRole new a ClusterRoleReconciler
func NewRoleBinding ¶
func NewRoleBinding( scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, client client.Client, mergedLabels map[string]string, mergedCfg *kafkav1alpha1.BrokersRoleGroupSpec, ) *common.GenericRoleBindingReconciler[*kafkav1alpha1.KafkaCluster, any]
NewRoleBinding new a ClusterRoleBindingReconciler
func NewServiceAccount ¶
func NewServiceAccount( scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, client client.Client, mergedLabels map[string]string, mergedCfg any, ) *common.GenericServiceAccountReconciler[*kafkav1alpha1.KafkaCluster, any]
NewServiceAccount new a ServiceAccountReconciler
Types ¶
type ClusterReconciler ¶
type ClusterReconciler struct { Log logr.Logger *security.KafkaTlsSecurity // contains filtered or unexported fields }
func NewClusterReconciler ¶
func NewClusterReconciler(client client.Client, scheme *runtime.Scheme, cr *kafkav1alpha1.KafkaCluster) *ClusterReconciler
func (*ClusterReconciler) ReconcileCluster ¶
func (*ClusterReconciler) ReconcileDiscovery ¶
func (*ClusterReconciler) RegisterResource ¶
func (c *ClusterReconciler) RegisterResource()
func (*ClusterReconciler) RegisterRole ¶
func (c *ClusterReconciler) RegisterRole()
RegisterRole register role reconciler
type ConfigMapReconciler ¶
type ConfigMapReconciler struct { common.ConfigurationStyleReconciler[*kafkav1alpha1.KafkaCluster, *kafkav1alpha1.BrokersRoleGroupSpec] *security.KafkaTlsSecurity }
func NewConfigMap ¶
func NewConfigMap( scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, client client.Client, groupName string, labels map[string]string, mergedCfg *kafkav1alpha1.BrokersRoleGroupSpec, tlsSecurity *security.KafkaTlsSecurity, ) *ConfigMapReconciler
NewConfigMap new a ConfigMapReconciler
func (*ConfigMapReconciler) ConfigurationOverride ¶
func (c *ConfigMapReconciler) ConfigurationOverride(resource client.Object)
type Discovery ¶
type Discovery struct { common.GeneralResourceStyleReconciler[*kafkav1alpha1.KafkaCluster, any] *security.KafkaTlsSecurity }
func NewDiscovery ¶
func NewDiscovery( scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, client client.Client, tlsSecurity *security.KafkaTlsSecurity, ) *Discovery
type KafkaClusterInstance ¶
type KafkaClusterInstance struct {
Instance *kafkav1alpha1.KafkaCluster
}
func (*KafkaClusterInstance) GetClusterConfig ¶
func (h *KafkaClusterInstance) GetClusterConfig() any
func (*KafkaClusterInstance) GetInstanceName ¶
func (h *KafkaClusterInstance) GetInstanceName() string
func (*KafkaClusterInstance) GetNamespace ¶
func (h *KafkaClusterInstance) GetNamespace() string
func (*KafkaClusterInstance) GetRoleConfigSpec ¶
func (h *KafkaClusterInstance) GetRoleConfigSpec(_ common.Role) (any, error)
type KafkaClusterReconciler ¶
KafkaClusterReconciler reconciles a KafkaCluster object
func (*KafkaClusterReconciler) Reconcile ¶
func (r *KafkaClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the KafkaCluster object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (*KafkaClusterReconciler) SetupWithManager ¶
func (r *KafkaClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*KafkaClusterReconciler) UpdateStatus ¶
func (r *KafkaClusterReconciler) UpdateStatus(ctx context.Context, instance *kafkav1alpha1.KafkaCluster) error
UpdateStatus updates the status of the KafkaCluster resource https://stackoverflow.com/questions/76388004/k8s-controller-update-status-and-condition
type Role ¶
type Role struct { common.BaseRoleReconciler[*kafkav1alpha1.KafkaCluster] }
func NewRoleBroker ¶
func NewRoleBroker( scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, client client.Client, log logr.Logger) *Role
func (*Role) CacheRoleGroupConfig ¶
func (r *Role) CacheRoleGroupConfig()
type RoleGroup ¶
type RoleGroup struct { common.BaseRoleGroupReconciler[*kafkav1alpha1.KafkaCluster] }
RoleGroup master role group reconcile
func NewRoleGroupReconciler ¶
func (*RoleGroup) MergeGroupConfigSpec ¶
func (*RoleGroup) RegisterResource ¶
func (m *RoleGroup) RegisterResource()
type StatefulSetReconciler ¶
type StatefulSetReconciler struct { common.WorkloadStyleUncheckedReconciler[*kafkav1alpha1.KafkaCluster, *kafkav1alpha1.BrokersRoleGroupSpec] *security.KafkaTlsSecurity }
func NewStatefulSet ¶
func NewStatefulSet( scheme *runtime.Scheme, instance *kafkav1alpha1.KafkaCluster, client client.Client, groupName string, labels map[string]string, mergedCfg *kafkav1alpha1.BrokersRoleGroupSpec, replicate int32, tlsSecurity *security.KafkaTlsSecurity, ) *StatefulSetReconciler
func (*StatefulSetReconciler) CommandOverride ¶
func (s *StatefulSetReconciler) CommandOverride(resource client.Object)
func (*StatefulSetReconciler) EnvOverride ¶
func (s *StatefulSetReconciler) EnvOverride(resource client.Object)
func (*StatefulSetReconciler) GetConditions ¶
func (s *StatefulSetReconciler) GetConditions() *[]metav1.Condition
func (*StatefulSetReconciler) LogOverride ¶
func (s *StatefulSetReconciler) LogOverride(_ client.Object)
func (*StatefulSetReconciler) SetAffinity ¶
func (s *StatefulSetReconciler) SetAffinity(resource client.Object)
type VectorConfigParams ¶
type VectorConfigParams struct { Client client.Client ClusterConfig *kafkav1alpha1.ClusterConfigSpec Namespace string InstanceName string Role string GroupName string }