feat: implement a Keptn metrics provider

Add a Keptn metrics provider for two resources:
* KeptnMetric: Verify the value of a single metric.
* Analysis (via AnalysisDefinition): Run a Keptn analysis over an
  interval validating SLOs.

Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
This commit is contained in:
Florian Bacher
2024-06-10 20:13:46 +05:30
committed by Sanskar Jaiswal
parent adc60596f5
commit 29c8bf5a22
12 changed files with 741 additions and 9 deletions
+5
View File
@@ -21,6 +21,8 @@ import (
"sync"
"time"
"k8s.io/client-go/rest"
"github.com/google/go-cmp/cmp"
"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
@@ -49,6 +51,7 @@ const controllerAgentName = "flagger"
// Controller is managing the canary objects and schedules canary deployments
type Controller struct {
kubeConfig *rest.Config
kubeClient kubernetes.Interface
flaggerClient clientset.Interface
flaggerInformers Informers
@@ -91,6 +94,7 @@ func NewController(
eventWebhook string,
clusterName string,
noCrossNamespaceRefs bool,
kubeConfig *rest.Config,
) *Controller {
logger.Debug("Creating event broadcaster")
flaggerscheme.AddToScheme(scheme.Scheme)
@@ -105,6 +109,7 @@ func NewController(
recorder.SetInfo(version, meshProvider)
ctrl := &Controller{
kubeConfig: kubeConfig,
kubeClient: kubeClient,
flaggerClient: flaggerClient,
flaggerInformers: flaggerInformers,