Documentation
¶
Index ¶
- Constants
- Variables
- func BuildCollector(params manifests.Params) ([]client.Object, error)
- func GetOwnedResourceTypes() []client.Object
- func RunReconcileOperations(ctx context.Context, operations []ReconcileOperation) (ctrl.Result, error)
- func SetMdaiIngressIndexers(ctx context.Context, mgr manager.Manager) error
- type Adapter
- type CMOption
- type CollectorDeploymentParams
- type Controller
- type HubAdapter
- type MdaiCollectorAdapter
- type MdaiCollectorReconciler
- type MdaiDalAdapter
- type MdaiDalReconciler
- type MdaiHubReconciler
- type MdaiIngressReconciler
- type MdaiObserverReconciler
- type MdaiReplayAdapter
- type MdaiReplayReconciler
- type ObjectState
- type ObserverAdapter
- type OperationResult
- func ContinueOperationResult() OperationResult
- func ContinueProcessing() (OperationResult, error)
- func ContinueWithError(errIn error) (OperationResult, error)
- func Requeue() (OperationResult, error)
- func RequeueAfter(delay time.Duration, errIn error) (OperationResult, error)
- func RequeueOnErrorOrContinue(errIn error) (OperationResult, error)
- func RequeueOnErrorOrStop(errIn error) (OperationResult, error)
- func RequeueWithError(errIn error) (OperationResult, error)
- func StopOperationResult() OperationResult
- func StopProcessing() (OperationResult, error)
- type ReconcileOperation
- type TelemetryValidationAdapter
- type TelemetryValidationReconciler
- func (r *TelemetryValidationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (*TelemetryValidationReconciler) ReconcileHandler(ctx context.Context, adapter Adapter) (ctrl.Result, error)
- func (r *TelemetryValidationReconciler) SetupWithManager(mgr ctrl.Manager) error
- type XDSManager
- type XDSReconciler
Constants ¶
const ( ObjectModified ObjectState = true ObjectUnchanged ObjectState = false LabelManagedByMdaiKey = "app.kubernetes.io/managed-by" LabelManagedByMdaiValue = "mdai-operator" LabelAppNameKey = "app.kubernetes.io/name" LabelAppInstanceKey = "app.kubernetes.io/instance" )
const ( MdaiCollectorHubComponent = "mdai-collector" S3PartitionFormat = "%Y/%m/%d/%H" )
const ( MdaiDalHubComponent = "mdai-dal" MdaiDalConfigMapName = "mdai-dal-config" )
const ( LabelMdaiHubName = "mydecisive.ai/hub-name" // Replace with your actual label key VariableKeyPrefix = "variable/" DefaultValkeyAuditStreamExpiry = 30 * 24 * time.Hour )
const (
HubComponentLabel = "mydecisive.ai/hub-component"
)
const (
MdaiIngressOtelColLookupKey = "spec.otelCol.lookupKey"
)
const (
PodNamespaceEnv = "POD_NAMESPACE"
)
Variables ¶
var DefaultSecurityContext = &corev1.SecurityContext{ SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, }, AllowPrivilegeEscalation: ptr.To(false), Capabilities: &corev1.Capabilities{ Drop: []corev1.Capability{"ALL"}, }, RunAsNonRoot: ptr.To(true), }
var ErrIncorrectOtelcolRef = errors.New("incorrect Otelcol reference")
var IndexerOtelCol = func(obj client.Object) []string { a, ok := obj.(*hubv1.MdaiIngress) if !ok { return nil } otelCol := a.Spec.OtelCollector if otelCol.Name != "" { return []string{otelCol.Name} } return nil }
Functions ¶
func BuildCollector ¶
BuildCollector returns the generation and collected errors of all manifests for a given instance.
func GetOwnedResourceTypes ¶
GetOwnedResourceTypes returns all the resource types the controller can own. Even though this method returns an array of client.Object, these are (empty) example structs rather than actual resources.
func RunReconcileOperations ¶ added in v0.2.13
Types ¶
type Controller ¶
type HubAdapter ¶
type HubAdapter struct {
// contains filtered or unexported fields
}
type MdaiCollectorAdapter ¶
type MdaiCollectorAdapter struct {
// contains filtered or unexported fields
}
func NewMdaiCollectorAdapter ¶
func NewMdaiCollectorAdapter( cr *mdaiv1.MdaiCollector, log logr.Logger, k8sClient client.Client, recorder record.EventRecorder, scheme *runtime.Scheme, ) *MdaiCollectorAdapter
type MdaiCollectorReconciler ¶
type MdaiCollectorReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
MdaiCollectorReconciler reconciles a MdaiCollector object
func (*MdaiCollectorReconciler) Reconcile ¶
func (r *MdaiCollectorReconciler) 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.
func (*MdaiCollectorReconciler) ReconcileHandler ¶
func (*MdaiCollectorReconciler) SetupWithManager ¶
func (r *MdaiCollectorReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MdaiDalAdapter ¶
type MdaiDalAdapter struct {
// contains filtered or unexported fields
}
type MdaiDalReconciler ¶
MdaiDalReconciler reconciles a MdaiDal object
func (*MdaiDalReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.22.4/pkg/reconcile
func (*MdaiDalReconciler) ReconcileHandler ¶
func (*MdaiDalReconciler) SetupWithManager ¶
func (r *MdaiDalReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MdaiHubReconciler ¶
type MdaiHubReconciler struct {
client.Client
ZapLogger *zap.Logger
Scheme *runtime.Scheme
Recorder record.EventRecorder
ValKeyClient valkey.Client
ValkeyEvents chan event.GenericEvent
ValkeyExpiry time.Duration
}
MdaiHubReconciler reconciles a MdaiHub object
func (*MdaiHubReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/reconcile
func (*MdaiHubReconciler) ReconcileHandler ¶
func (*MdaiHubReconciler) SetupWithManager ¶
func (r *MdaiHubReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MdaiIngressReconciler ¶
MdaiIngressReconciler reconciles a MdaiIngress object
func (*MdaiIngressReconciler) GetParams ¶
func (r *MdaiIngressReconciler) GetParams(otelMdaiComb hubv1.OtelMdaiIngressComb) manifests.Params
func (*MdaiIngressReconciler) SetupWithManager ¶
func (r *MdaiIngressReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MdaiObserverReconciler ¶
type MdaiObserverReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
MdaiObserverReconciler reconciles a MdaiObserver object
func (*MdaiObserverReconciler) Reconcile ¶
func (r *MdaiObserverReconciler) 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.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.20.2/pkg/reconcile
func (*MdaiObserverReconciler) ReconcileHandler ¶
func (*MdaiObserverReconciler) ReconcileHandler(ctx context.Context, adapter Adapter) (ctrl.Result, error)
ReconcileHandler processes the MdaiObserver CR and performs the necessary operations.
func (*MdaiObserverReconciler) SetupWithManager ¶
func (r *MdaiObserverReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MdaiReplayAdapter ¶
type MdaiReplayAdapter struct {
// contains filtered or unexported fields
}
func NewMdaiReplayAdapter ¶
func NewMdaiReplayAdapter( cr *mdaiv1.MdaiReplay, log logr.Logger, k8sClient client.Client, recorder record.EventRecorder, scheme *runtime.Scheme, httpClient *http.Client, metricsURLBuilder func(serviceName, namespace string) string, ) *MdaiReplayAdapter
type MdaiReplayReconciler ¶
type MdaiReplayReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
MdaiReplayReconciler reconciles a MdaiReplay object
func (*MdaiReplayReconciler) Reconcile ¶
func (r *MdaiReplayReconciler) 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 MdaiReplay 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.20.4/pkg/reconcile
func (*MdaiReplayReconciler) ReconcileHandler ¶
func (*MdaiReplayReconciler) ReconcileHandler(ctx context.Context, adapter Adapter) (ctrl.Result, error)
ReconcileHandler processes the MdaiReplay CR and performs the necessary operations.
func (*MdaiReplayReconciler) SetupWithManager ¶
func (r *MdaiReplayReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ObjectState ¶
type ObjectState bool
type ObserverAdapter ¶
type ObserverAdapter struct {
// contains filtered or unexported fields
}
func NewObserverAdapter ¶
func NewObserverAdapter( cr *mdaiv1.MdaiObserver, log logr.Logger, k8sClient client.Client, recorder record.EventRecorder, scheme *runtime.Scheme, ) *ObserverAdapter
type OperationResult ¶
func ContinueOperationResult ¶
func ContinueOperationResult() OperationResult
func ContinueProcessing ¶
func ContinueProcessing() (OperationResult, error)
func ContinueWithError ¶
func ContinueWithError(errIn error) (OperationResult, error)
func Requeue ¶
func Requeue() (OperationResult, error)
func RequeueAfter ¶
func RequeueAfter(delay time.Duration, errIn error) (OperationResult, error)
func RequeueOnErrorOrContinue ¶
func RequeueOnErrorOrContinue(errIn error) (OperationResult, error)
func RequeueOnErrorOrStop ¶
func RequeueOnErrorOrStop(errIn error) (OperationResult, error)
func RequeueWithError ¶
func RequeueWithError(errIn error) (OperationResult, error)
func StopOperationResult ¶
func StopOperationResult() OperationResult
func StopProcessing ¶
func StopProcessing() (OperationResult, error)
func (OperationResult) RequeueOrCancel ¶
func (r OperationResult) RequeueOrCancel() bool
type ReconcileOperation ¶
type ReconcileOperation func(context.Context) (OperationResult, error)
type TelemetryValidationAdapter ¶ added in v0.2.13
type TelemetryValidationAdapter struct {
// contains filtered or unexported fields
}
func NewTelemetryValidationAdapter ¶ added in v0.2.13
func NewTelemetryValidationAdapter( validation *hubv1.TelemetryValidation, log logr.Logger, k8sClient ctrlclient.Client, scheme *runtime.Scheme, reconciler *TelemetryValidationReconciler, ) *TelemetryValidationAdapter
type TelemetryValidationReconciler ¶ added in v0.2.13
func (*TelemetryValidationReconciler) ReconcileHandler ¶ added in v0.2.13
func (*TelemetryValidationReconciler) SetupWithManager ¶ added in v0.2.13
func (r *TelemetryValidationReconciler) SetupWithManager(mgr ctrl.Manager) error
type XDSManager ¶ added in v0.2.13
type XDSManager interface {
UpdateSnapshot(ctx context.Context, nodeID string, collectors []otelv1beta1.OpenTelemetryCollector, validations []hubv1.TelemetryValidation) error
}
XDSManager defines the interface for updating the xDS snapshot
type XDSReconciler ¶ added in v0.2.13
type XDSReconciler struct {
client.Client
APIReader client.Reader
Scheme *runtime.Scheme
XDSManager XDSManager
Namespace string // operator namespace; scopes marked-service/deployment discovery
}
XDSReconciler reconciles xDS snapshots based on OpenTelemetryCollector objects
func (*XDSReconciler) SetupWithManager ¶ added in v0.2.13
func (r *XDSReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
Source Files
¶
- adapter.go
- common.go
- controller.go
- event_config_transformer.go
- hub_adapter.go
- mdaicollector_adapter.go
- mdaicollector_controller.go
- mdaidal_adapter.go
- mdaidal_controller.go
- mdaihub_controller.go
- mdaiingress_controller.go
- mdaiobserver_adapter.go
- mdaiobserver_controller.go
- mdaireplay_adapter.go
- mdaireplay_controller.go
- observer.go
- reconcile_operation.go
- telemetryvalidation_adapter.go
- telemetryvalidation_controller.go
- telemetryvalidation_shadow.go
- telemetryvalidation_shadow_config.go
- telemetryvalidation_validator.go
- xds_controller.go