Skip to content

Commit

Permalink
add metrics-operator architecture
Browse files Browse the repository at this point in the history
Signed-off-by: Rakshit Gondwal <[email protected]>
  • Loading branch information
rakshitgondwal committed Mar 29, 2023
1 parent b33b4f4 commit 66dd3bf
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 33 deletions.
33 changes: 0 additions & 33 deletions docs/content/en/docs/concepts/architecture/components/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,3 @@ style Scheduler fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
style Lifecycle-Operator fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
style Metrics-Operator fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
```

**Keptn's Lifecycle Operator** is
a Kubernetes [operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
that automates the deployment and management
of the Keptn Lifecycle Controller components in a Kubernetes cluster.
The Keptn Lifecycle Operator contains several controllers for **Keptn CRDs**
and a **Mutating Webhook**.

Here's a brief overview:

**Keptn CRDs:** Keptn Lifecycle Operator contains
several controllers that manage and reconcile different types of Keptn CRDs
such as the Project Controller, Service Controller, and Stage Controller.

**Mutating Webhook:** automatically injects Keptn labels
and annotations into Kubernetes resources,
such as deployments and services.
These labels and annotations are used to enable Keptn's automation
and monitoring capabilities.

**Keptn's Lifecycle Metrics Operator**
collects, processes, and analyzes metrics data from a variety of sources.
Once collected, this data, can be used to generate a variety of reports
and dashboards that provide insights into the health and performance of the application and infrastructure.

**Keptn's Lifecycle Scheduler** replaces the
[Kubernetes scheduler](https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/)
to allow users to schedule events and tasks to occur
at specific times during the application lifecycle.
The Lifecycle Scheduler can trigger events such as
deployment, testing, and remediation at specific times or intervals.
The Keptn Scheduler guarantees that Pods are initiated only after
the Pre-Deployment checks are completed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Keptn's Lifecycle Operator
linktitle: Lifecycle Operator
description: Basic understanding of Lifecycle Operator
weight: 80
cascade:
---

### Lifecycle Operator

**Keptn's Lifecycle Operator** is
a Kubernetes [operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
that automates the deployment and management
of the Keptn Lifecycle Controller components in a Kubernetes cluster.
The Keptn Lifecycle Operator contains several controllers for **Keptn CRDs**
and a **Mutating Webhook**.

Here's a brief overview:

**Keptn CRDs:** Keptn Lifecycle Operator contains
several controllers that manage and reconcile different types of Keptn CRDs
such as the Project Controller, Service Controller, and Stage Controller.

**Mutating Webhook:** automatically injects Keptn labels
and annotations into Kubernetes resources,
such as deployments and services.
These labels and annotations are used to enable Keptn's automation
and monitoring capabilities.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Keptn's Metrics Operator
linktitle: Metrics Operator
description: Basic understanding of KLT Metrics Operator
weight: 80
cascade:
---

### Metrics Operator

**Metrics Operator** collects, processes, and analyzes metrics data from a variety of sources. Once collected, this data, can be used to generate a variety of reports and dashboards that provide insights into the health and performance of the application and infrastructure.

The Metrics Operator consists of two main components:

* Metrics Controller
* Metrics Adapter

```mermaid
graph TD;
Metrics-Operator-->Metrics-Adapter;
Metrics-Operator-->Metrics-Controller
style Metrics-Operator fill:#006bb8,stroke:#fff,stroke-width:px,color:#fff
style Metrics-Adapter fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
style Metrics-Controller fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
```

**Metrics adapter** is used to expose custom metrics from an application to external monitoring and alerting tools. The adapter exposes custom metrics on a specific endpoint where external monitoring and alerting tools can scrape them. It is an important component of the metrics operator as it allows for the collection and exposure of custom metrics, which can be used to gain insight into the behavior and performance of applications running on a Kubenetes cluster.

**Metrics controller** is used to fetch metrics from a SLI provider. The controller reconciles a `KeptnMetric` CR and updates it's status with the metric value provided by the selected SLI provider. The steps in which the Controller fetches metrics are given below:
- It first fetches the `KeptnMetric` object to reconcile.
- If the object is not found, it returns and lets Kubernetes handle deleting all associated resources.
- If the object is found, the code checks that if the metric has been updated within the configured interval which is defined in the `Spec.FetchIntervalSeconds`. If not, then it skips reconciling and requeues the request for later.
- If the metric should be reconciled, it fetches the provider defined in the `Spec.Provider.Name` field.
- If the provider is not found, it returns and requeues the request for later.
- If the provider is found, it loads the provider and evaluates the query defined in the `Spec.Query` field.
- If the evaluation is succesful, it stores the fetched value in the status of the `KeptnMetric` object.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: KLT Scheduler
linktitle: Scheduler
description: Basic understanding of KLT Scheduler
weight: 80
cascade:
---

**Keptn's Lifecycle Scheduler** replaces the
[Kubernetes scheduler](https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/)
to allow users to schedule events and tasks to occur
at specific times during the application lifecycle.
The Lifecycle Scheduler can trigger events such as
deployment, testing, and remediation at specific times or intervals.
The Keptn Scheduler guarantees that Pods are initiated only after
the Pre-Deployment checks are completed.

0 comments on commit 66dd3bf

Please sign in to comment.