Documentation
¶
Index ¶
- Constants
- func GetConfigMapConfigName(mb *beatcrd.Metricbeat) (configMapName string)
- func GetConfigMapModuleName(mb *beatcrd.Metricbeat) (configMapName string)
- func GetContainerImage(mb *beatcrd.Metricbeat) string
- func GetGlobalServiceName(mb *beatcrd.Metricbeat) string
- func GetNetworkPolicyElasticsearchName(mb *beatcrd.Metricbeat) string
- func GetPDBName(mb *beatcrd.Metricbeat) (serviceName string)
- func GetSecretNameForCAElasticsearch(mb *beatcrd.Metricbeat) (secretName string)
- func GetSecretNameForCredentials(mb *beatcrd.Metricbeat) (secretName string)
- func GetServiceAccountName(mb *beatcrd.Metricbeat) string
- func GetStatefulsetName(mb *beatcrd.Metricbeat) (name string)
- func NewMetricbeatReconciler(c client.Client, logger *logrus.Entry, recorder record.EventRecorder, ...) (multiPhaseReconciler controller.Controller)
- func TestBuildCAElasticsearchSecret(t *testing.T)
- type MetricbeatReconciler
- func (h *MetricbeatReconciler) Client() client.Client
- func (h *MetricbeatReconciler) Configure(ctx context.Context, req reconcile.Request, o *beatcrd.Metricbeat, ...) (res reconcile.Result, err error)
- func (h *MetricbeatReconciler) Delete(ctx context.Context, o *beatcrd.Metricbeat, data map[string]any, ...) (err error)
- func (h *MetricbeatReconciler) OnError(ctx context.Context, o *beatcrd.Metricbeat, data map[string]any, ...) (res reconcile.Result, err error)
- func (h *MetricbeatReconciler) OnSuccess(ctx context.Context, o *beatcrd.Metricbeat, data map[string]any, ...) (res reconcile.Result, err error)
- func (r *MetricbeatReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)
- func (h *MetricbeatReconciler) Recorder() record.EventRecorder
- func (h *MetricbeatReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
const ( ConfigmapCondition shared.ConditionName = "ConfigmapReady" ConfigmapPhase shared.PhaseName = "Configmap" )
const ( PdbCondition shared.ConditionName = "PodDisruptionBudgetReady" PdbPhase shared.PhaseName = "PodDisruptionBudget" )
const ( RoleBindingCondition shared.ConditionName = "RoleBindingReady" RoleBindingPhase shared.PhaseName = "RoleBinding" )
const ( CAElasticsearchCondition shared.ConditionName = "CAElasticsearchReady" CAElasticsearchPhase shared.PhaseName = "CAElasticsearch" )
const ( CredentialCondition shared.ConditionName = "CredentialReady" CredentialPhase shared.PhaseName = "Credential" )
const ( ServiceCondition shared.ConditionName = "ServiceReady" ServicePhase shared.PhaseName = "Service" )
const ( ServiceAccountCondition shared.ConditionName = "ServiceAccountReady" ServiceAccountPhase shared.PhaseName = "ServiceAccount" )
const ( StatefulsetCondition shared.ConditionName = "StatefulsetReady" StatefulsetPhase shared.PhaseName = "Statefulset" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigMapConfigName ¶
func GetConfigMapConfigName(mb *beatcrd.Metricbeat) (configMapName string)
GetConfigMapConfigName permit to get the configMap name that store the config
func GetConfigMapModuleName ¶
func GetConfigMapModuleName(mb *beatcrd.Metricbeat) (configMapName string)
GetConfigMapModuleName permit to get the configMap name that store the modules settings
func GetContainerImage ¶
func GetContainerImage(mb *beatcrd.Metricbeat) string
GetContainerImage permit to get the image name
func GetGlobalServiceName ¶
func GetGlobalServiceName(mb *beatcrd.Metricbeat) string
GetGlobalServiceName permit to get the global service name
func GetNetworkPolicyElasticsearchName ¶
func GetNetworkPolicyElasticsearchName(mb *beatcrd.Metricbeat) string
GetNetworkPolicyElasticsearchName return the name for network policy to access on Elasticsearch
func GetPDBName ¶
func GetPDBName(mb *beatcrd.Metricbeat) (serviceName string)
GetPDBName permit to get the pdb name
func GetSecretNameForCAElasticsearch ¶
func GetSecretNameForCAElasticsearch(mb *beatcrd.Metricbeat) (secretName string)
GetSecretNameForCAElasticsearch permit to get the secret name that store all Elasticsearch CA It return the secret name as string
func GetSecretNameForCredentials ¶
func GetSecretNameForCredentials(mb *beatcrd.Metricbeat) (secretName string)
GetSecretNameForCredentials permit to get the secret name that store the credentials
func GetServiceAccountName ¶
func GetServiceAccountName(mb *beatcrd.Metricbeat) string
GetServiceAccountName return the service account name
func GetStatefulsetName ¶
func GetStatefulsetName(mb *beatcrd.Metricbeat) (name string)
GetStatefulsetName permit to get the statefulset name
func NewMetricbeatReconciler ¶
func NewMetricbeatReconciler(c client.Client, logger *logrus.Entry, recorder record.EventRecorder, kubeCapability common.KubernetesCapability) (multiPhaseReconciler controller.Controller)
Types ¶
type MetricbeatReconciler ¶
type MetricbeatReconciler struct {
controller.Controller
multiphase.MultiPhaseReconciler[*beatcrd.Metricbeat]
multiphase.MultiPhaseReconcilerAction[*beatcrd.Metricbeat]
// contains filtered or unexported fields
}
MetricbeatReconciler reconciles a Metricbeat object
func (*MetricbeatReconciler) Client ¶
func (h *MetricbeatReconciler) Client() client.Client
func (*MetricbeatReconciler) Delete ¶
func (h *MetricbeatReconciler) Delete(ctx context.Context, o *beatcrd.Metricbeat, data map[string]any, logger *logrus.Entry) (err error)
func (*MetricbeatReconciler) Reconcile ¶
func (r *MetricbeatReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.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 metricbeat 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.13.0/pkg/reconcile
func (*MetricbeatReconciler) Recorder ¶
func (h *MetricbeatReconciler) Recorder() record.EventRecorder
func (*MetricbeatReconciler) SetupWithManager ¶
func (h *MetricbeatReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
Source Files
¶
- configmap_builder.go
- configmap_reconciler.go
- helper.go
- metricbeat_controller.go
- metricbeat_watcher.go
- pdb_builder.go
- pdb_reconciler.go
- rolebinding_builder.go
- rolebinding_reconciler.go
- secret_ca_elasticsearch_builder.go
- secret_ca_elasticsearch_builder_test..go
- secret_ca_elasticsearch_reconciler.go
- secret_credential_builder.go
- secret_credential_reconciler.go
- service_builder.go
- service_reconciler.go
- serviceaccount_builder.go
- serviceaccount_reconciler.go
- statefulset_builder.go
- statefulset_reconciler.go