controllers

package
v0.0.0-...-9421b25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ServiceMonitorNSName is the name of the namespace in which the serviceMonitor resides
	// it must be the same that the prometheus operator is listening to
	ServiceMonitorNSName = "monitoring"
)

Functions

func GetOAMServiceLabel

func GetOAMServiceLabel() map[string]string

GetOAMServiceLabel will return oamServiceLabel as the pre-defined labels for any serviceMonitor created by the MetricsTrait, prometheus operator listens on this

func Setup

func Setup(mgr ctrl.Manager) error

Setup adds a controller that reconciles MetricsTrait.

Types

type Reconciler

type Reconciler struct {
	client.Client

	Log    logr.Logger
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

Reconciler reconciles a MetricsTrait object

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

Reconcile is the main logic for metric trait controller +kubebuilder:rbac:groups=standard.oam.dev,resources=metricstraits,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=standard.oam.dev,resources=metricstraits/status,verbs=get;update;patch +kubebuilder:rbac:groups=monitoring.coreos.com,resources=*,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=monitoring.coreos.com,resources=*/status,verbs=get;update;patch +kubebuilder:rbac:groups=core.oam.dev,resources=*,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core.oam.dev,resources=*/status,verbs=get; +kubebuilder:rbac:groups="",resources=events,verbs=get;list;create;update;patch

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager setup Reconciler with ctrl.Manager

func (*Reconciler) UpdateStatus

func (r *Reconciler) UpdateStatus(ctx context.Context, mt *v1alpha1.MetricsTrait, opts ...client.UpdateOption) error

UpdateStatus updates v1alpha1.MetricsTrait's Status with retry.RetryOnConflict

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL