From e089a5dd58dd39dee5f38583f4ccb2de891dd269 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 2 Mar 2023 01:03:02 -0800 Subject: [PATCH 01/51] k8s doc references on landing page Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/_index.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/content/en/docs/crd-ref/_index.md b/docs/content/en/docs/crd-ref/_index.md index 23e517ce9c..b1838abd9c 100644 --- a/docs/content/en/docs/crd-ref/_index.md +++ b/docs/content/en/docs/crd-ref/_index.md @@ -13,3 +13,21 @@ that are defined for the Keptn Lifecycle Toolkit. Information that is published here has been reviewed for technical accuracy but the format and content is still evolving. We welcome your input!** + +Each CRD is an object of an API library. +Keptn APIs follow the Kubernetes API versioning scheme. +and is itself composed of objects and sub-objects. + +For more information, see the Kubernetes documentation: + +* [API Overview](https://kubernetes.io/docs/reference/using-api/) + +* [Custom Resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#:~:text=A%20resource%20is%20an%20endpoint,in%20a%20default%20Kubernetes%20installation.) + +* [API versioning](https://kubernetes.io/docs/reference/using-api/#api-versioning) + +* [Understanding Kubernetes Objects](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) + + + + From 3246ac609d6b424125873304c508f351e4e3e32a Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 2 Mar 2023 01:24:22 -0800 Subject: [PATCH 02/51] process go.mod file --- docs/go.mod | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/go.mod b/docs/go.mod index 7ae5fbaa06..bb69a32b84 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -4,7 +4,4 @@ go 1.19 require github.com/keptn-sandbox/lifecycle-toolkit-docs v0.0.0-20230209144724-01b35a6cfc44 // indirect= -require ( - github.com/google/docsy/dependencies v0.6.0 // indirect - github.com/keptn-sandbox/lifecycle-toolkit-docs v0.0.0-20230209144724-01b35a6cfc44 // indirect -) +require github.com/google/docsy/dependencies v0.6.0 // indirect From d65f78986acb6eb7c7dd6b4a32f60c7b26059d0f Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 12 Apr 2023 23:40:49 -0700 Subject: [PATCH 03/51] ref pages for KeptnEvaluationDefinition and KeptnEvaluationProvider Signed-off-by: Meg McRoberts --- .../en/docs/concepts/evaluations/_index.md | 49 ------------ .../docs/yaml-crd-ref/evaluationdefinition.md | 80 +++++++++++++++++++ .../docs/yaml-crd-ref/evaluationdefnition.md | 5 -- .../docs/yaml-crd-ref/evaluationprovider.md | 59 +++++++++++++- 4 files changed, 137 insertions(+), 56 deletions(-) delete mode 100644 docs/content/en/docs/concepts/evaluations/_index.md create mode 100644 docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md delete mode 100644 docs/content/en/docs/yaml-crd-ref/evaluationdefnition.md diff --git a/docs/content/en/docs/concepts/evaluations/_index.md b/docs/content/en/docs/concepts/evaluations/_index.md deleted file mode 100644 index fd4887dfa9..0000000000 --- a/docs/content/en/docs/concepts/evaluations/_index.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Evaluations -description: Learn what Keptn Evaluations are and how to use them -icon: concepts -layout: quickstart -weight: 10 -hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html ---- - - -### Keptn Evaluation Definition - -A `KeptnEvaluationDefinition` is a CRD used to define evaluation tasks that can be run by the Keptn Lifecycle Toolkit -as part of pre- and post-analysis phases of a workload or application. - -A Keptn evaluation definition looks like the following: - -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnEvaluationDefinition -metadata: - name: my-prometheus-evaluation -spec: - source: prometheus - objectives: - - name: query-1 - query: "xxxx" - evaluationTarget: <20 - - name: query-2 - query: "yyyy" - evaluationTarget: >4 -``` - -### Keptn Evaluation Provider - -A `KeptnEvaluationProvider` is a CRD used to define evaluation provider, which will provide data for the -pre- and post-analysis phases of a workload or application. - -A Keptn evaluation provider looks like the following: - -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnEvaluationProvider -metadata: - name: prometheus -spec: - targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" - secretName: prometheusLoginCredentials -``` diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md new file mode 100644 index 0000000000..473f85608a --- /dev/null +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -0,0 +1,80 @@ +--- +title: KeptnEvaluationDefinition +description: Define all evaluations associated with an application +weight: 30 +--- + +A `KeptnEvaluationDefinition` defines evaluation tasks +that can be run by the Keptn Lifecycle Toolkit +as part of pre- and post-analysis phases of a workload or application. + +## Yaml Synopsis + +```yaml +apiVersion: lifecycle.keptn.sh/v?alpha? +kind: KeptnEvaluationDefinition +metadata: + name: +spec: + source: prometheus | dynatrace | datadog + objectives: + - name: query-1 + query: "xxxx" + evaluationTarget: <20 + - name: query-2 + query: "yyyy" + evaluationTarget: >4 +``` + +## Fields + +* **apiVersion** -- API version being used. +` +* **kind** -- Resource type. Must be set to `KeptnEvaluationDefinition` + +* **metadata** + * **name** -- Unique name of this evaluation + such as `pre-deploy-eval` or `post-deploy-resource-eval`. + * Must be an alphanumeric string and, by convention, is all lowercase. + * Can include the special characters `_`, `-`, (others?) + * Should not include spaces. + +* **spec** + * **source** -- Name of the data provider being used for this evaluation. + The value of the `source` field must match + the string used for the `name` field + in the corresponding [KeptnEvaluationProvider](evaluationprovider.md) CRD. + + Each `KeptnEvaluationDefinition` CRD can use only one data provider; + if you are using multiple data provider, you must create + `KeptnEvaluationProvider` and `KeptnEvaluationDefinition` CRDs for each. + + Currently, you can only access one occurrance of each type of data provider + in your KLT cluster. + + * **objectives** -- define the evaluations to be performed. + Each objective is expressed as a `query` and an `evaluationTarget` value. + + * **query** -- Any query that is supported by the data provider. + * **value** -- Desired value of the query, + expressed as an arithmatic formula, + usually less than (`<`) or greater than (`>`) + +## Usage + +## Examples + +## Files + +API Reference: + +* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition) + +## Differences between versions + +The `KeptnTaskDefinition` is the same for +all `v1alpha?` library versions. + +## See also + +* [KeptnEvaluationProvider](evaluationprovider.md) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefnition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefnition.md deleted file mode 100644 index e054a6e08a..0000000000 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefnition.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: KeptnEvaluationDefinition -description: Define all workloads and checks associated with an application -weight: 20 ---- diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index 1f2ad4bc43..120e98359a 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -1,5 +1,60 @@ --- title: KeptnEvaluationProvider -description: Define the evaluation provider -weight: 13 +description: Define the data provider for evaluations +weight: 33 --- + +A `KeptnEvaluationProvider` identifies an evaluation provider +that provides data for evaluations done +during the pre- and post-analysis phases of a workload or application. + +## Yaml Synopsis + +```yaml +apiVersion: lifecycle.keptn.sh/v?alpha? +kind: KeptnEvaluationProvider +metadata: +source: + name: prometheus | dynatrace | datadog +spec: + targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" + secretName: prometheusLoginCredentials +``` + +## Fields + +* **apiVersion** -- API version being used. +` +* **kind** -- Resource type. Must be set to `KeptnTaskDefinition` + +* **metadata** + * **name** -- Unique name of this data provider. + * Must be an alphanumeric string and, by convention, is all lowercase. + * Can include the special characters `_`, `-`, (others?) + * Should not include spaces. + +* **spec** + * **source** -- Type of data provider being used + Note that you can configure one each of the different providers + for your KLT cluster + but you cannot currently configure more than one instance + of any of the providers. + * **targetServer** -- Location of the data provider + * **secretName** -- Secret used to access the data provider + +## Usage + +## Files + +API Reference: + +* [KeptnEvaluationProvider](../../crd-ref/lifecycle/v1alpha3/#keptnevaluationprovider) + +## Differences between versions + +The `KeptnEvaluationProvider` CRD is the same for +all `v1alpha?` library versions. + +## See also + +* [KeptnEvaluationDefinition](evaluationdefinition.md) From 1f3b8cb02da3aeb544af6cebc6cd07e0c9c17fa8 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 12 Apr 2023 23:41:59 -0700 Subject: [PATCH 04/51] markdownlint-fix Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/_index.md | 2 -- docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/content/en/docs/crd-ref/_index.md b/docs/content/en/docs/crd-ref/_index.md index 13ab97bf81..b96035fe53 100644 --- a/docs/content/en/docs/crd-ref/_index.md +++ b/docs/content/en/docs/crd-ref/_index.md @@ -30,5 +30,3 @@ For more information, see the Kubernetes documentation: * [API versioning](https://kubernetes.io/docs/reference/using-api/#api-versioning) * [Understanding Kubernetes Objects](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) - - diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index 473f85608a..c1657e5a5f 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -52,11 +52,11 @@ spec: Currently, you can only access one occurrance of each type of data provider in your KLT cluster. - * **objectives** -- define the evaluations to be performed. + * **objectives** -- define the evaluations to be performed. Each objective is expressed as a `query` and an `evaluationTarget` value. - * **query** -- Any query that is supported by the data provider. - * **value** -- Desired value of the query, + * **query** -- Any query that is supported by the data provider. + * **value** -- Desired value of the query, expressed as an arithmatic formula, usually less than (`<`) or greater than (`>`) From 1df95c289c20e0b033ea38e808e2515ffb2f563a Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 13 Apr 2023 00:54:24 -0700 Subject: [PATCH 05/51] remove xrefs to autogenerated API ref for now Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md | 2 -- docs/content/en/docs/yaml-crd-ref/evaluationprovider.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index c1657e5a5f..eb19e99f7e 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -68,8 +68,6 @@ spec: API Reference: -* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition) - ## Differences between versions The `KeptnTaskDefinition` is the same for diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index 120e98359a..efadd5953a 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -48,8 +48,6 @@ spec: API Reference: -* [KeptnEvaluationProvider](../../crd-ref/lifecycle/v1alpha3/#keptnevaluationprovider) - ## Differences between versions The `KeptnEvaluationProvider` CRD is the same for From 4015f518397dcfe6f4b2c02bc56cc314388a328c Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 18 Apr 2023 02:56:29 -0700 Subject: [PATCH 06/51] markdownlint-fix Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md | 3 ++- docs/content/en/docs/yaml-crd-ref/evaluationprovider.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index eb19e99f7e..b3a74673f0 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -30,7 +30,8 @@ spec: * **apiVersion** -- API version being used. ` -* **kind** -- Resource type. Must be set to `KeptnEvaluationDefinition` +* **kind** -- Resource type. + Must be set to `KeptnEvaluationDefinition` * **metadata** * **name** -- Unique name of this evaluation diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index efadd5953a..e2f5461a0a 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -25,7 +25,8 @@ spec: * **apiVersion** -- API version being used. ` -* **kind** -- Resource type. Must be set to `KeptnTaskDefinition` +* **kind** -- Resource type. + Must be set to `KeptnTaskDefinition` * **metadata** * **name** -- Unique name of this data provider. From c0212fb895f8e095efc8c85b35946f149ccc0064 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 19 Apr 2023 04:13:38 -0700 Subject: [PATCH 07/51] initial info for KeptnMetric yaml CRD Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metric.md | 82 +++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index 7d48b8222f..db0a444df7 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -3,3 +3,85 @@ title: KeptnMetric description: Define all workloads and checks associated with an application weight: 50 --- + +A `KeptnMetric` is represents a metric that is collected +from a provider. +Providing the metrics as CRD into a Kubernetes cluster +facilitates the reusability of this data across multiple components +and llows using multiple observability platforms for different metrics. + +The metric will be collected from the provider specified in the +specs.provider.name field. +The query is a string in the provider-specific query language, used to obtain a metric. + +## Yaml Synopsis + +```yaml +apiVersion: metrics.keptn.sh/v?alpha? +kind: KeptnMetric +metadata: + name: + namespace: +spec: + provider: + name: "prometheus | dynatrace | dql" + query: "" + fetchIntervalSeconds: +``` + +## Fields + +* **apiVersion** -- API version being used. +` +* **kind** -- Resource type. Must be set to `KeptnTaskDefinition` + +* **metadata** + * **name** -- Unique name of this metric. + * Must be an alphanumeric string and, by convention, is all lowercase. + * Can include the special characters `_`, `-`, (others?) + * Should not include spaces. + * **namespace** -- namespace of the application using this metric + +## Usage + + +## Examples + + +```yaml +apiVersion: metrics.keptn.sh/v1alpha1 +kind: KeptnMetric +metadata: + name: keptnmetric-sample + namespace: podtato-kubectl +spec: + provider: + name: "prometheus" + query: "sum(kube_pod_container_resource_limits{resource='cpu'})" + fetchIntervalSeconds: 5 +``` + +### Example 1: inline script + +### More examples + +See the [operator/config/samples](https://github.com/keptn/lifecycle-toolkit/tree/main/operator/config/samples) +directory for more example `KeptnTaskDefinition` YAML files. +Separate examples are provided for each API version. +For example, the `lifecycle_v1alpha3_keptntaskdefinition` file +contains examples for the `v1alpha3` version of the lifecycle API group. + +## Files + +API Reference: + +* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition) + +## Differences between versions + +The `KeptnTaskDefinition` is the same for +all `v1alpha?` library versions. + +## See also + +* Link to reference pages for any related CRDs From c60874a2b131904e7f9506791d3dee1aaaa753b5 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 20 Apr 2023 22:35:55 -0700 Subject: [PATCH 08/51] Add metrics; update for 0.8.0 Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/_index.md | 14 ++ docs/content/en/docs/implementing/metrics.md | 169 ++++++++++++++++++ .../docs/yaml-crd-ref/evaluationdefinition.md | 55 ++++-- .../docs/yaml-crd-ref/evaluationprovider.md | 53 +++--- docs/content/en/docs/yaml-crd-ref/metric.md | 89 ++++++--- .../en/docs/yaml-crd-ref/metricsprovider.md | 122 ++++++++++++- 6 files changed, 431 insertions(+), 71 deletions(-) create mode 100644 docs/content/en/docs/implementing/metrics.md diff --git a/docs/content/en/docs/implementing/_index.md b/docs/content/en/docs/implementing/_index.md index a8d31f3f49..68c8f181fb 100644 --- a/docs/content/en/docs/implementing/_index.md +++ b/docs/content/en/docs/implementing/_index.md @@ -12,3 +12,17 @@ This section is under development. Information that is published here has been reviewed for technical accuracy but the format and content is still evolving. We welcome your input!** + +This section provides information about how to implement +various features and functionality with the Keptn Lifecycle Toolkit. +The following topics are covered: + +* Workloads, Applications, and Deployments + +* Observability + + * Evaluations + * [Site metrics](metrics.md) that provides a single entry-point + to site metrics at the application or workload level, + based on one or more standard data providers + * Tracing diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md new file mode 100644 index 0000000000..3bcd345072 --- /dev/null +++ b/docs/content/en/docs/implementing/metrics.md @@ -0,0 +1,169 @@ +--- +title: Keptn Metrics +description: Implement Keptn site metrics +weight: 130 +--- + +Kubernetes provides two metrics servers, +one that is custom, the other external. +However, the Kubernetes metrics servers +only allow you to release a single service on a API; +you cannot use multiple observability platforms +in one namespace for one API. + +Keptn Metrics provides a single entry point to all metrics in the cluster +and allows you to use multiple observability platforms +and, beginning with V0.8.0, +multiple instances of any observability platform. +Keptn Metrics are also application aware +so report data for all workflows that are included in the Keptn application. + +This data can be presented on Grafana +or any standard dashboard application that you configure. + +[More introductory info to come] + +## Keptn metrics basics + +Keptn metrics are implemented with two CRDs: + +* [KeptnMetric](../yaml-crd-ref/metric.md) -- + define the metric to report +* [KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) -- + define the data provider to be used for this metric + +## Using OpenTelemetry with Keptn metrics + +Keptn metrics can be exposed as OpenTelemetry (OTel) metrics +via port `9999` of the KLT metrics-operator. + +To expose OTel metrics, +be sure that the `EXPOSE_KEPTN_METRICS` environment variable +in the `metrics-operator` manifest is set to `true`, +which is the default value. + +To access the metrics, use the following command: + +```shell +kubectl port-forward deployment/metrics-operator 9999 -n keptn-lifecycle-toolkit-system +``` + +You can access the metrics from your browser at: + +```http://localhost:9999/metrics``` + +## Accessing Metrics via the Kubernetes Custom Metrics API + +`KeptnMetrics` can also be retrieved via the Kubernetes Custom Metrics API. + +### Using the HorizontalPodAutoscaler + +Use the Kubernetes Custom Metrics API +to refer to Keptnmetrics via the +[Kubernetes HorizontalPodAutoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) +(HPA), +as in the following example: + +```yaml +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: podtato-head-entry + namespace: podtato-kubectl +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: podtato-head-entry + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Object + object: + metric: + name: keptnmetric-sample + describedObject: + apiVersion: metrics.keptn.sh/v1alpha1 + kind: KeptnMetric + name: keptnmetric-sample + target: + type: Value + value: "10" +``` + +See the [Scaling Kubernetes Workloads based on Dynatrace Metrics](https://www.linkedin.com/pulse/scaling-kubernetes-workloads-based-dynatrace-metrics-keptnproject/) +blog post +for a detailed discussion of doing this with Dynatrace metrics. +A similar approach could be used to implement HPA with other data providers. + +### Retrieve KeptnMetric values with kubectl raw + +Use the `kubectl raw` command +to retrieve the values of a `KeptnMetric`, as in the following example: + +```shell +$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/podtato-kubectl/keptnmetrics.metrics.sh/keptnmetric-sample/keptnmetric-sample" | jq . + +{ + "kind": "MetricValueList", + "apiVersion": "custom.metrics.k8s.io/v1beta2", + "metadata": {}, + "items": [ + { + "describedObject": { + "kind": "KeptnMetric", + "namespace": "podtato-kubectl", + "name": "keptnmetric-sample", + "apiVersion": "metrics.keptn.sh/v1alpha1" + }, + "metric": { + "name": "keptnmetric-sample", + "selector": { + "matchLabels": { + "app": "frontend" + } + } + }, + "timestamp": "2023-01-25T09:26:15Z", + "value": "10" + } + ] +} +``` + +### Filter on matching labels + +You can filter based on matching labels. +For example, to retrieve all metrics +that are labelled with `app=frontend`, +use the following command: + +```shell +$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/podtato-kubectl/keptnmetrics.metrics.sh/*/*?labelSelector=app%3Dfrontend" | jq . + +{ + "kind": "MetricValueList", + "apiVersion": "custom.metrics.k8s.io/v1beta2", + "metadata": {}, + "items": [ + { + "describedObject": { + "kind": "KeptnMetric", + "namespace": "keptn-lifecycle-toolkit-system", + "name": "keptnmetric-sample", + "apiVersion": "metrics.keptn.sh/v1alpha1" + }, + "metric": { + "name": "keptnmetric-sample", + "selector": { + "matchLabels": { + "app": "frontend" + } + } + }, + "timestamp": "2023-01-25T09:26:15Z", + "value": "10" + } + ] +} +``` diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index b3a74673f0..55f94d9f4a 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -1,4 +1,10 @@ --- +title: KeptnEvaluationDefinition +description: Define all workloads and checks associated with an application +weight: 20 +--- +--- + title: KeptnEvaluationDefinition description: Define all evaluations associated with an application weight: 30 @@ -11,19 +17,16 @@ as part of pre- and post-analysis phases of a workload or application. ## Yaml Synopsis ```yaml -apiVersion: lifecycle.keptn.sh/v?alpha? +apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnEvaluationDefinition metadata: - name: + name: pre-deployment-hello spec: - source: prometheus | dynatrace | datadog objectives: - - name: query-1 - query: "xxxx" - evaluationTarget: <20 - - name: query-2 - query: "yyyy" - evaluationTarget: >4 + - evaluationTarget: ">1" + keptnMetricRef: + name: available-cpus + namespace: some-namespace ``` ## Fields @@ -71,9 +74,37 @@ API Reference: ## Differences between versions -The `KeptnTaskDefinition` is the same for -all `v1alpha?` library versions. +In the `v1alpha1` and `v1alpha2` API versions, +`KeptnEvaluationDefinition` references the `KeptnEvaluationProvider` CRD +to identify the data source associated with this definition +and itself contained the queries +that are now taken from the specified [KeptnMetric](metric.md) CRD. +The synopsis was: + +```yaml +apiVersion: lifecycle.keptn.sh/v?alpha? +kind: KeptnEvaluationDefinition +metadata: + name: +spec: + source: prometheus | dynatrace | datadog + objectives: + - name: query-1 + query: "xxxx" + evaluationTarget: <20 + - name: query-2 + query: "yyyy" + evaluationTarget: >4 +``` + +Beginning with `v1alpha3` API version, +`KeptnEvaluationDefinition` references the data source defined +in the [KeptnMetricsProvider](metricsprovider.md) +and the queries are specified in the corresponding +[KeptnMetric](metric.md) CRD +although the `evaluationTarget` is defined in this CRD. ## See also -* [KeptnEvaluationProvider](evaluationprovider.md) +* [KeptnMetricsProvider](metricsprovider.md) +* [KeptnMetric](metric.md) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index e2f5461a0a..421bbba55e 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -1,24 +1,20 @@ --- -title: KeptnEvaluationProvider -description: Define the data provider for evaluations -weight: 33 +title: KeptnEvaluationProvider (deprecated) +description: Define the evaluation provider +weight: 13 --- -A `KeptnEvaluationProvider` identifies an evaluation provider -that provides data for evaluations done -during the pre- and post-analysis phases of a workload or application. +In earlier releases of the Lifecycle Toolkit, +`KeptnEvaluationProvider` defined the data provider +used by [KeptnEvaluationDefinition]( ## Yaml Synopsis ```yaml apiVersion: lifecycle.keptn.sh/v?alpha? -kind: KeptnEvaluationProvider -metadata: -source: - name: prometheus | dynatrace | datadog -spec: - targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" - secretName: prometheusLoginCredentials +kind: KeptnTaskDefinition +metadata: + name: ``` ## Fields @@ -28,32 +24,29 @@ spec: * **kind** -- Resource type. Must be set to `KeptnTaskDefinition` -* **metadata** - * **name** -- Unique name of this data provider. - * Must be an alphanumeric string and, by convention, is all lowercase. - * Can include the special characters `_`, `-`, (others?) - * Should not include spaces. - -* **spec** - * **source** -- Type of data provider being used - Note that you can configure one each of the different providers - for your KLT cluster - but you cannot currently configure more than one instance - of any of the providers. - * **targetServer** -- Location of the data provider - * **secretName** -- Secret used to access the data provider +* **name** -- Unique name of this task. + * Must be an alphanumeric string and, by convention, is all lowercase. + * Can include the special characters `_`, `-`, (others?) + * Should not include spaces. ## Usage +### Create secret text + +## Examples + ## Files API Reference: +* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition) + ## Differences between versions -The `KeptnEvaluationProvider` CRD is the same for -all `v1alpha?` library versions. +The `KeptnEvaluationProvider` is deprecated in the v1alpha3 API version. +`KeptnEvaluationDefinition` now gets provider information from the +[KeptnMetricsProvider](metricsprovider.md) CR. ## See also -* [KeptnEvaluationDefinition](evaluationdefinition.md) +* [KeptnEvaluationDefinition](evaluationdefinition) diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index db0a444df7..a1156e2ac7 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -4,15 +4,13 @@ description: Define all workloads and checks associated with an application weight: 50 --- -A `KeptnMetric` is represents a metric that is collected -from a provider. -Providing the metrics as CRD into a Kubernetes cluster +A `KeptnMetric` represents a metric that is collected from a provider. +Providing the metrics as a CRD into a Kubernetes cluster facilitates the reusability of this data across multiple components -and llows using multiple observability platforms for different metrics. +and allows using multiple observability platforms +for different metrics at the same time. -The metric will be collected from the provider specified in the -specs.provider.name field. -The query is a string in the provider-specific query language, used to obtain a metric. +A `KeptnMetric` looks like the following: ## Yaml Synopsis @@ -24,16 +22,17 @@ metadata: namespace: spec: provider: - name: "prometheus | dynatrace | dql" - query: "" - fetchIntervalSeconds: + name: "" + query: "" + fetchIntervalSeconds: <#-seconds> ``` ## Fields * **apiVersion** -- API version being used. ` -* **kind** -- Resource type. Must be set to `KeptnTaskDefinition` +* **kind** -- Resource type. + Must be set to `KeptnTaskDefinition` * **metadata** * **name** -- Unique name of this metric. @@ -42,34 +41,43 @@ spec: * Should not include spaces. * **namespace** -- namespace of the application using this metric -## Usage +* **spec** + * **provider.name** -- + Name of this instance of the data source + from which the metric is collected. + This value must match the value of the `spec.provider.name` field + of the corresponding [KeptnMetricsProvider](metricsprovider.md) CRD + Assigning your own name to the provider + rather than just the type of provider + enables you to support multiple instances of a data provider. + For example, you might have `dev-prometheus` + as the name of the Prometheus server that monitors the dev deployment + and `prod-prometheus` as the name of the Prometheus server + that monitors the production deployment + * **query** -- String in the provider-specific query language, + used to obtain a metric. + * **fetchIntervalSeconds** -- Number of seconds between ?? +## Usage -## Examples +## Example +This example pulls metrics from the data provider +defined as `my-provider` in the `spec.provider.name` field +of the corresponding `KeptnMetricsProvider` CRD. ```yaml -apiVersion: metrics.keptn.sh/v1alpha1 +apiVersion: metrics.keptn.sh/v1alpha3 kind: KeptnMetric metadata: name: keptnmetric-sample namespace: podtato-kubectl spec: provider: - name: "prometheus" + name: "my-provider" query: "sum(kube_pod_container_resource_limits{resource='cpu'})" fetchIntervalSeconds: 5 -``` - -### Example 1: inline script - -### More examples -See the [operator/config/samples](https://github.com/keptn/lifecycle-toolkit/tree/main/operator/config/samples) -directory for more example `KeptnTaskDefinition` YAML files. -Separate examples are provided for each API version. -For example, the `lifecycle_v1alpha3_keptntaskdefinition` file -contains examples for the `v1alpha3` version of the lifecycle API group. ## Files @@ -79,9 +87,34 @@ API Reference: ## Differences between versions -The `KeptnTaskDefinition` is the same for -all `v1alpha?` library versions. +Beginning with the `v1alpha3` API version, +Keptn allows you to define multiple instances of the same data source. +In earlier versions, you could use multiple data sources +but only one instance of each. +Consequently the `v1alpha1` and `v1alpha2` library versions +define the `provider` field with the name of the data provider +(`prometheus`, `dynatrace`, or `dql`) +rather than the particular name assigned +to the instance of the data provider +that is assigned in the +[KeptnMetricsProvider](metricsprovider.md) CRD. + +So the `v1alpha1` and `v1alpha2` synopsis +of the `spec` field is: + +```yaml +... +spec: + provider: + name: "prometheus | dynatrace | dql" + fetchIntervalSeconds: + query: >- + "" +``` ## See also -* Link to reference pages for any related CRDs +* [KeptnEvaluationDefinition](evaluationdefinition.md) +* [KeptnMetricsProvider](metricsprovider.md) +* Implementing [Keptn Metrics](../implementing/metrics.md) +* Architecture of the [Keptn Metrics Operator](../concepts/architecture/components/metrics-operator/_index.md) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index 0ca9078a11..c319c56357 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -1,5 +1,125 @@ --- title: KeptnMetricsProvider -description: Define all workloads and checks associated with an application +description: Define data provider used for metrics and evaluations weight: 55 --- + +`KeptnMetricsProvider` defines an instance of the data provider +(such as Prometheus, Dynatrace, or Datadog) +that is used by the [KeptnMetric](metric.md) +and [KeptnEvaluationDefinition](evaluationdefinition.md) CRDs. +One Keptn application can perform evaluations and metrics +from more than one data provider +and, beginning in V0.8.0, +more than one instance of each data provider. +To implement this, create a `KeptnMetricsProvider` CRD +for each instance of each data provider being used +then reference the appropriate provider +for each evaluation or metric definition. + +## Yaml Synopsis + +```yaml +apiVersion: lifecycle.keptn.sh/v?alpha? +kind: KeptnMetricsProvider +metadata: + name: + namespace: +spec: + type: prometheus | dynatrace | dql + targetServer: "" + secretKeyRef: + name: + key: + + +## Fields + +* **apiVersion** -- API version being used. +` +* **kind** -- Resource type. Must be set to `KeptnMetricsProvider` + +* **metadata** + * **name** -- Unique name of this provider, + used to reference the provider for the + [KeptnEvaluationDefinition](evaluationdefinition) + and [KeptnMetric](metric.md) CRs. + * Must be an alphanumeric string and, by convention, is all lowercase. + * Can include the special characters `_`, `-`, (others?) + * Should not include spaces. + + * **namespace** -- Namespace where this provider is used. + +* **spec** + + * **type** -- The type of data provider for this instance + * **targetServer** -- URL of the data provider, enclosed in double quotes + * **secretKeyRef** + * **name:** -- Name of the token for this data provider + * **key:** -- Key for this data provider + + +## Usage + + +## Examples + +### Example 1: Dynatrace data provider + +```yaml +apiVersion: metrics.keptn.sh/v1alpha2 +kind: KeptnMetricsProvider +metadata: + name: dynatrace + namespace: podtato-kubectl +spec: + targetServer: "" + secretKeyRef: + name: dt-api-token + key: DT_TOKEN +``` + +## Files + +API Reference: + +* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition) + +## Differences between versions + +For the `v1alpha1` and `v1alpha2` API versions, +Keptn did not support +using more than one instance of a particular data provider +in the same namespace. +In other words, one namespace could support one instance each +of Prometheus, Dynatrace, and Datadog +but could not support, for example, two instances of Prometheus. + +The synopsis in those older API versions +only specified the `metadata.name` field +that identified the data provider (`prometheus`, `dynatrace`, or `dql`): + +```yaml +apiVersion: metrics.keptn.sh/v1alpha2 +kind: KeptnMetricsProvider +metadata: + name: prometheus | dynatrace |dql + namespace: +spec: + targetServer: "" + secretKeyRef: + name: dt-api-token + key: DT_TOKEN +``` + +Also note that, for the v1alpha1 and v1alpha2 API versions, +`KeptnMetricsProvider` only specifies the provider +for the `KeptnMetrics` CR. +Beginning with `v1alpha3` API version, +`KeptnMetricsProvider` is also used to specify the provider +for the `KeptnEvaluationDefinition` CR. + +## See also + +* [KeptnEvaluationDefinition](evaluationdefinition.md) +* [KeptnMetric](metric.md) From 9aea80561c1c787e444571bd2bd257b662f0f96f Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 20 Apr 2023 22:48:16 -0700 Subject: [PATCH 09/51] delete concepts/metrics Signed-off-by: Meg McRoberts --- .../en/docs/concepts/metrics/_index.md | 184 ------------------ 1 file changed, 184 deletions(-) delete mode 100644 docs/content/en/docs/concepts/metrics/_index.md diff --git a/docs/content/en/docs/concepts/metrics/_index.md b/docs/content/en/docs/concepts/metrics/_index.md deleted file mode 100644 index d3a1f1c521..0000000000 --- a/docs/content/en/docs/concepts/metrics/_index.md +++ /dev/null @@ -1,184 +0,0 @@ ---- -title: Metrics -description: Learn what Keptn Metrics are and how to use them -icon: concepts -layout: quickstart -weight: 10 -hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html ---- - -### Keptn Metric - -A `KeptnMetric` is a CRD representing a metric. -The metric will be collected from the provider specified in the -specs.provider.name field. -The query is a string in the provider-specific query language, used to obtain a metric. -Providing the metrics as CRD into a K8s cluster will facilitate the reusability of this data across multiple components. -Furthermore, this allows using multiple observability platforms for different metrics. - -A `KeptnMetric` looks like the following: - -```yaml -apiVersion: metrics.keptn.sh/v1alpha1 -kind: KeptnMetric -metadata: - name: keptnmetric-sample - namespace: podtato-kubectl -spec: - provider: - name: "prometheus" - query: "sum(kube_pod_container_resource_limits{resource='cpu'})" - fetchIntervalSeconds: 5 -``` - -In this example, the provider is set to `prometheus`, which is one of the currently supported `KeptnMetricProviders`. -The provider tells the metrics-operator where to get the value for the `KeptnMetric`, and its configuration looks follows: - -```yaml -apiVersion: metrics.keptn.sh/v1alpha2 -kind: KeptnMetricsProvider -metadata: - name: prometheus -spec: - targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" -``` - -Other supported providers are `dynatrace`, and `dql`: - -````yaml -apiVersion: metrics.keptn.sh/v1alpha2 -kind: KeptnMetricsProvider -metadata: - name: dynatrace - namespace: podtato-kubectl -spec: - targetServer: "" - secretKeyRef: - name: dt-api-token - key: DT_TOKEN ---- -apiVersion: metrics.keptn.sh/v1alpha2 -kind: KeptnMetricsProvider -metadata: - name: dql - namespace: podtato-kubectl -spec: - secretKeyRef: - key: CLIENT_SECRET - name: dt-third-gen-secret - targetServer: "" -```` - -Keptn metrics can be exposed as OTel metrics via port `9999` of the KLT metrics-operator. -To expose them, the env -variable `EXPOSE_KEPTN_METRICS` in the metrics-operator manifest needs to be set to `true`. -The default value of this variable -is `true`. -To access the metrics, use the following command: - -```shell -kubectl port-forward deployment/metrics-operator 9999 -n keptn-lifecycle-toolkit-system -``` - -and access the metrics via your browser with: - -```http://localhost:9999/metrics``` - -#### Accessing Metrics via the Kubernetes Custom Metrics API - -`KeptnMetrics` can also be retrieved via the Kubernetes Custom Metrics API. -This makes it possible to refer to these metrics via the Kubernetes *HorizontalPodAutoscaler*, as in the following -example: - -```yaml -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: podtato-head-entry - namespace: podtato-kubectl -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: podtato-head-entry - minReplicas: 1 - maxReplicas: 10 - metrics: - - type: Object - object: - metric: - name: keptnmetric-sample - describedObject: - apiVersion: metrics.keptn.sh/v1alpha1 - kind: KeptnMetric - name: keptnmetric-sample - target: - type: Value - value: "10" -``` - -You can also use the `kubectl raw` command to retrieve the values of a `KeptnMetric`, as in the following example: - -```shell -$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/podtato-kubectl/keptnmetrics.metrics.sh/keptnmetric-sample/keptnmetric-sample" | jq . - -{ - "kind": "MetricValueList", - "apiVersion": "custom.metrics.k8s.io/v1beta2", - "metadata": {}, - "items": [ - { - "describedObject": { - "kind": "KeptnMetric", - "namespace": "podtato-kubectl", - "name": "keptnmetric-sample", - "apiVersion": "metrics.keptn.sh/v1alpha1" - }, - "metric": { - "name": "keptnmetric-sample", - "selector": { - "matchLabels": { - "app": "frontend" - } - } - }, - "timestamp": "2023-01-25T09:26:15Z", - "value": "10" - } - ] -} -``` - -You can also filter based on matching labels. -So to e.g. retrieve all metrics that are labelled with `app=frontend`, you -can use the following command: - -```shell -$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/podtato-kubectl/keptnmetrics.metrics.sh/*/*?labelSelector=app%3Dfrontend" | jq . - -{ - "kind": "MetricValueList", - "apiVersion": "custom.metrics.k8s.io/v1beta2", - "metadata": {}, - "items": [ - { - "describedObject": { - "kind": "KeptnMetric", - "namespace": "keptn-lifecycle-toolkit-system", - "name": "keptnmetric-sample", - "apiVersion": "metrics.keptn.sh/v1alpha1" - }, - "metric": { - "name": "keptnmetric-sample", - "selector": { - "matchLabels": { - "app": "frontend" - } - } - }, - "timestamp": "2023-01-25T09:26:15Z", - "value": "10" - } - ] -} -``` From 4660b305839967c32e5d92f854cd9cfe5aa991f2 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Sun, 23 Apr 2023 03:46:14 -0700 Subject: [PATCH 10/51] Flo comments Signed-off-by: Meg McRoberts --- .../docs/yaml-crd-ref/evaluationdefinition.md | 21 +++++++------------ .../docs/yaml-crd-ref/evaluationprovider.md | 12 +++++------ docs/content/en/docs/yaml-crd-ref/metric.md | 11 +++++----- .../en/docs/yaml-crd-ref/metricsprovider.md | 6 +++--- 4 files changed, 23 insertions(+), 27 deletions(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index 55f94d9f4a..6c7e989223 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -1,14 +1,8 @@ --- title: KeptnEvaluationDefinition -description: Define all workloads and checks associated with an application +description: Define an evaluation query weight: 20 --- ---- - -title: KeptnEvaluationDefinition -description: Define all evaluations associated with an application -weight: 30 ---- A `KeptnEvaluationDefinition` defines evaluation tasks that can be run by the Keptn Lifecycle Toolkit @@ -20,7 +14,7 @@ as part of pre- and post-analysis phases of a workload or application. apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnEvaluationDefinition metadata: - name: pre-deployment-hello + name: spec: objectives: - evaluationTarget: ">1" @@ -39,9 +33,9 @@ spec: * **metadata** * **name** -- Unique name of this evaluation such as `pre-deploy-eval` or `post-deploy-resource-eval`. - * Must be an alphanumeric string and, by convention, is all lowercase. - * Can include the special characters `_`, `-`, (others?) - * Should not include spaces. + Names must comply with the + [Kubernetes Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) + specification. * **spec** * **source** -- Name of the data provider being used for this evaluation. @@ -57,10 +51,11 @@ spec: in your KLT cluster. * **objectives** -- define the evaluations to be performed. - Each objective is expressed as a `query` and an `evaluationTarget` value. + Each objective is expressed as a `keptnMetricRef` + and an `evaluationTarget` value. * **query** -- Any query that is supported by the data provider. - * **value** -- Desired value of the query, + * **evaluationTarget** -- Desired value of the query, expressed as an arithmatic formula, usually less than (`<`) or greater than (`>`) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index 421bbba55e..80db880332 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -14,7 +14,7 @@ used by [KeptnEvaluationDefinition]( apiVersion: lifecycle.keptn.sh/v?alpha? kind: KeptnTaskDefinition metadata: - name: + name: ``` ## Fields @@ -25,9 +25,9 @@ metadata: Must be set to `KeptnTaskDefinition` * **name** -- Unique name of this task. - * Must be an alphanumeric string and, by convention, is all lowercase. - * Can include the special characters `_`, `-`, (others?) - * Should not include spaces. + Names must comply with the + [Kubernetes Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) + specification. ## Usage @@ -39,7 +39,7 @@ metadata: API Reference: -* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition) +* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition.md) ## Differences between versions @@ -49,4 +49,4 @@ The `KeptnEvaluationProvider` is deprecated in the v1alpha3 API version. ## See also -* [KeptnEvaluationDefinition](evaluationdefinition) +* [KeptnEvaluationDefinition](evaluationdefinition.md) diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index a1156e2ac7..d7f60e4162 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -36,17 +36,18 @@ spec: * **metadata** * **name** -- Unique name of this metric. - * Must be an alphanumeric string and, by convention, is all lowercase. - * Can include the special characters `_`, `-`, (others?) - * Should not include spaces. + Names must comply with the + [Kubernetes Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) + specification. * **namespace** -- namespace of the application using this metric * **spec** * **provider.name** -- Name of this instance of the data source from which the metric is collected. - This value must match the value of the `spec.provider.name` field + This value must match the value of the `metadata.name` field of the corresponding [KeptnMetricsProvider](metricsprovider.md) CRD + Assigning your own name to the provider rather than just the type of provider enables you to support multiple instances of a data provider. @@ -56,7 +57,7 @@ spec: that monitors the production deployment * **query** -- String in the provider-specific query language, used to obtain a metric. - * **fetchIntervalSeconds** -- Number of seconds between ?? + * **fetchIntervalSeconds** -- Number of seconds between updates of the metric ## Usage diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index c319c56357..11f0f0d6d1 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -44,9 +44,9 @@ spec: used to reference the provider for the [KeptnEvaluationDefinition](evaluationdefinition) and [KeptnMetric](metric.md) CRs. - * Must be an alphanumeric string and, by convention, is all lowercase. - * Can include the special characters `_`, `-`, (others?) - * Should not include spaces. + Names must comply with the + [Kubernetes Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) + specification. * **namespace** -- Namespace where this provider is used. From 6ccac150639981e0d18eeed737dfe4112219b3f9 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Sun, 23 Apr 2023 18:59:58 -0700 Subject: [PATCH 11/51] Flo comments Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 5 ++-- .../docs/yaml-crd-ref/evaluationdefinition.md | 29 +++++++------------ docs/content/en/docs/yaml-crd-ref/metric.md | 6 ++-- .../en/docs/yaml-crd-ref/metricsprovider.md | 13 +++++++-- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 3bcd345072..6aae5a16eb 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -18,8 +18,9 @@ multiple instances of any observability platform. Keptn Metrics are also application aware so report data for all workflows that are included in the Keptn application. -This data can be presented on Grafana -or any standard dashboard application that you configure. +This data can be displayed on Grafana +or another standard dashboard application that you configure +or can be retrieved using standard Kubernetes commands. [More introductory info to come] diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index 6c7e989223..f55270512c 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -26,6 +26,7 @@ spec: ## Fields * **apiVersion** -- API version being used. + Must be `v1alpha3` or later for this syntax. ` * **kind** -- Resource type. Must be set to `KeptnEvaluationDefinition` @@ -38,23 +39,14 @@ spec: specification. * **spec** - * **source** -- Name of the data provider being used for this evaluation. - The value of the `source` field must match - the string used for the `name` field - in the corresponding [KeptnEvaluationProvider](evaluationprovider.md) CRD. - - Each `KeptnEvaluationDefinition` CRD can use only one data provider; - if you are using multiple data provider, you must create - `KeptnEvaluationProvider` and `KeptnEvaluationDefinition` CRDs for each. - - Currently, you can only access one occurrance of each type of data provider - in your KLT cluster. * **objectives** -- define the evaluations to be performed. Each objective is expressed as a `keptnMetricRef` and an `evaluationTarget` value. - * **query** -- Any query that is supported by the data provider. + * **KeptnMericRef** -- A reference to the + [KeptnMetric](metric) object that contains the value, + identified by `name` and `namespace` * **evaluationTarget** -- Desired value of the query, expressed as an arithmatic formula, usually less than (`<`) or greater than (`>`) @@ -70,14 +62,14 @@ API Reference: ## Differences between versions In the `v1alpha1` and `v1alpha2` API versions, -`KeptnEvaluationDefinition` references the `KeptnEvaluationProvider` CRD +`KeptnEvaluationDefinition` referenced the `KeptnEvaluationProvider` CRD to identify the data source associated with this definition and itself contained the queries that are now taken from the specified [KeptnMetric](metric.md) CRD. The synopsis was: ```yaml -apiVersion: lifecycle.keptn.sh/v?alpha? +apiVersion: lifecycle.keptn.sh/v1alpha2 kind: KeptnEvaluationDefinition metadata: name: @@ -93,11 +85,10 @@ spec: ``` Beginning with `v1alpha3` API version, -`KeptnEvaluationDefinition` references the data source defined -in the [KeptnMetricsProvider](metricsprovider.md) -and the queries are specified in the corresponding -[KeptnMetric](metric.md) CRD -although the `evaluationTarget` is defined in this CRD. +`KeptnEvaluationDefinition` references a `keptnMetricRef` +that points to a [KeptnMetric](metric.md) CRD, +that defines the data source, the query and the namespace to use. +The `KeptnEvaluationDefinition` merely specifies the evaluation target. ## See also diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index d7f60e4162..dd49338b37 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -10,8 +10,6 @@ facilitates the reusability of this data across multiple components and allows using multiple observability platforms for different metrics at the same time. -A `KeptnMetric` looks like the following: - ## Yaml Synopsis ```yaml @@ -32,14 +30,14 @@ spec: * **apiVersion** -- API version being used. ` * **kind** -- Resource type. - Must be set to `KeptnTaskDefinition` + Must be set to `KeptnMetric` * **metadata** * **name** -- Unique name of this metric. Names must comply with the [Kubernetes Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) specification. - * **namespace** -- namespace of the application using this metric + * **namespace** -- Namespace of the application using this metric * **spec** * **provider.name** -- diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index 11f0f0d6d1..6280dd1863 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -10,10 +10,10 @@ that is used by the [KeptnMetric](metric.md) and [KeptnEvaluationDefinition](evaluationdefinition.md) CRDs. One Keptn application can perform evaluations and metrics from more than one data provider -and, beginning in V0.8.0, -more than one instance of each data provider. +and, beginning with the v1alpha3 API version, +can use more than one instance of each data provider. To implement this, create a `KeptnMetricsProvider` CRD -for each instance of each data provider being used +for each instance of each data provider being used, then reference the appropriate provider for each evaluation or metric definition. @@ -48,6 +48,13 @@ spec: [Kubernetes Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) specification. + For example, you might define `dev-prometheus` + for the Prometheus instance that monitors the development deployment, + and `qa-prometheus` for the Prometheus instance + that monitors the Prometheus instance that monitors the QA deployment, + and `prod-dynatrace` for the Dynatrace instance + that monitors the production deployment. + * **namespace** -- Namespace where this provider is used. * **spec** From 718dba29650571f0f542f3135db6c3b553fa9957 Mon Sep 17 00:00:00 2001 From: Simon Schrottner Date: Mon, 24 Apr 2023 07:42:39 +0200 Subject: [PATCH 12/51] fixing links Signed-off-by: Simon Schrottner --- docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md | 2 +- docs/content/en/docs/yaml-crd-ref/evaluationprovider.md | 2 +- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index f55270512c..fdc0f00bd4 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -45,7 +45,7 @@ spec: and an `evaluationTarget` value. * **KeptnMericRef** -- A reference to the - [KeptnMetric](metric) object that contains the value, + [KeptnMetric](metric.md) object that contains the value, identified by `name` and `namespace` * **evaluationTarget** -- Desired value of the query, expressed as an arithmatic formula, diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index 80db880332..f8966fc7ab 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -39,7 +39,7 @@ metadata: API Reference: -* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition.md) +* [KeptnTaskDefinition](../crd-ref/lifecycle/v1alpha3/_index.md#keptntaskdefinition) ## Differences between versions diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index 6280dd1863..e93a45d674 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -90,7 +90,7 @@ spec: API Reference: -* [KeptnTaskDefinition](../../crd-ref/lifecycle/v1alpha3/#keptntaskdefinition) +* [KeptnTaskDefinition](../crd-ref/lifecycle/v1alpha3/_index.md#keptntaskdefinition) ## Differences between versions From efdd43c39919a168926b78bcf4af5d29e044e087 Mon Sep 17 00:00:00 2001 From: Simon Schrottner Date: Mon, 24 Apr 2023 08:51:29 +0200 Subject: [PATCH 13/51] crd-ref update Signed-off-by: Simon Schrottner --- .../en/docs/crd-ref/lifecycle/v1alpha1/_index.md | 15 ++------------- .../en/docs/crd-ref/lifecycle/v1alpha2/_index.md | 16 ++-------------- .../en/docs/crd-ref/lifecycle/v1alpha3/_index.md | 16 ++-------------- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/docs/content/en/docs/crd-ref/lifecycle/v1alpha1/_index.md b/docs/content/en/docs/crd-ref/lifecycle/v1alpha1/_index.md index cd168f85ec..8fbfb15470 100644 --- a/docs/content/en/docs/crd-ref/lifecycle/v1alpha1/_index.md +++ b/docs/content/en/docs/crd-ref/lifecycle/v1alpha1/_index.md @@ -257,12 +257,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `version` _string_ | | -| `workloads` _[KeptnWorkloadRef](#keptnworkloadref) array_ | | -| `preDeploymentTasks` _string array_ | | -| `postDeploymentTasks` _string array_ | | -| `preDeploymentEvaluations` _string array_ | | -| `postDeploymentEvaluations` _string array_ | | +| `KeptnAppSpec` _[KeptnAppSpec](#keptnappspec)_ | | | `appName` _string_ | | | `previousVersion` _string_ | | | `traceId` _object (keys:string, values:string)_ | | @@ -594,13 +589,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `app` _string_ | | -| `version` _string_ | | -| `preDeploymentTasks` _string array_ | | -| `postDeploymentTasks` _string array_ | | -| `preDeploymentEvaluations` _string array_ | | -| `postDeploymentEvaluations` _string array_ | | -| `resourceReference` _[ResourceReference](#resourcereference)_ | | +| `KeptnWorkloadSpec` _[KeptnWorkloadSpec](#keptnworkloadspec)_ | | | `workloadName` _string_ | | | `previousVersion` _string_ | | | `traceId` _object (keys:string, values:string)_ | | diff --git a/docs/content/en/docs/crd-ref/lifecycle/v1alpha2/_index.md b/docs/content/en/docs/crd-ref/lifecycle/v1alpha2/_index.md index 9e8e26a7b7..4bbf82a291 100644 --- a/docs/content/en/docs/crd-ref/lifecycle/v1alpha2/_index.md +++ b/docs/content/en/docs/crd-ref/lifecycle/v1alpha2/_index.md @@ -258,13 +258,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `version` _string_ | | -| `revision` _integer_ | | -| `workloads` _[KeptnWorkloadRef](#keptnworkloadref) array_ | | -| `preDeploymentTasks` _string array_ | | -| `postDeploymentTasks` _string array_ | | -| `preDeploymentEvaluations` _string array_ | | -| `postDeploymentEvaluations` _string array_ | | +| `KeptnAppSpec` _[KeptnAppSpec](#keptnappspec)_ | | | `appName` _string_ | | | `previousVersion` _string_ | | | `traceId` _object (keys:string, values:string)_ | | @@ -596,13 +590,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `app` _string_ | | -| `version` _string_ | | -| `preDeploymentTasks` _string array_ | | -| `postDeploymentTasks` _string array_ | | -| `preDeploymentEvaluations` _string array_ | | -| `postDeploymentEvaluations` _string array_ | | -| `resourceReference` _[ResourceReference](#resourcereference)_ | | +| `KeptnWorkloadSpec` _[KeptnWorkloadSpec](#keptnworkloadspec)_ | | | `workloadName` _string_ | | | `previousVersion` _string_ | | | `traceId` _object (keys:string, values:string)_ | | diff --git a/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md b/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md index 271e40457e..8f3bebf99b 100644 --- a/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md +++ b/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md @@ -309,13 +309,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `version` _string_ | | -| `revision` _integer_ | | -| `workloads` _[KeptnWorkloadRef](#keptnworkloadref) array_ | | -| `preDeploymentTasks` _string array_ | | -| `postDeploymentTasks` _string array_ | | -| `preDeploymentEvaluations` _string array_ | | -| `postDeploymentEvaluations` _string array_ | | +| `KeptnAppSpec` _[KeptnAppSpec](#keptnappspec)_ | | | `appName` _string_ | | | `previousVersion` _string_ | | | `traceId` _object (keys:string, values:string)_ | | @@ -665,13 +659,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `app` _string_ | | -| `version` _string_ | | -| `preDeploymentTasks` _string array_ | | -| `postDeploymentTasks` _string array_ | | -| `preDeploymentEvaluations` _string array_ | | -| `postDeploymentEvaluations` _string array_ | | -| `resourceReference` _[ResourceReference](#resourcereference)_ | | +| `KeptnWorkloadSpec` _[KeptnWorkloadSpec](#keptnworkloadspec)_ | | | `workloadName` _string_ | | | `previousVersion` _string_ | | | `traceId` _object (keys:string, values:string)_ | | From ccb77470227eb0831132bf7426b648674c3cff3f Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 24 Apr 2023 00:52:42 -0700 Subject: [PATCH 14/51] clarify evaluation target Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index fdc0f00bd4..149719a107 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -50,6 +50,9 @@ spec: * **evaluationTarget** -- Desired value of the query, expressed as an arithmatic formula, usually less than (`<`) or greater than (`>`) + This is used to define success or failure criteria + for the referenced `KeptnMetric` in order to pass or fail + the pre- and post-evaluation stages ## Usage From 506502313bda8a4142dede18d7f98a61b6f38296 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 24 Apr 2023 00:55:48 -0700 Subject: [PATCH 15/51] delete mention of KeptnEvaluationDefinition from metricsprovider intro Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index e93a45d674..8175216520 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -6,8 +6,7 @@ weight: 55 `KeptnMetricsProvider` defines an instance of the data provider (such as Prometheus, Dynatrace, or Datadog) -that is used by the [KeptnMetric](metric.md) -and [KeptnEvaluationDefinition](evaluationdefinition.md) CRDs. +that is used by the [KeptnMetric](metric.md) CRD. One Keptn application can perform evaluations and metrics from more than one data provider and, beginning with the v1alpha3 API version, From db39067895ad471d696834ddbd5fffa8711f72d3 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:16:55 -0700 Subject: [PATCH 16/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 6aae5a16eb..2fa1351d7c 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -11,7 +11,7 @@ only allow you to release a single service on a API; you cannot use multiple observability platforms in one namespace for one API. -Keptn Metrics provides a single entry point to all metrics in the cluster +The Keptn Metrics Operator provides a single entry point to all metrics in the cluster and allows you to use multiple observability platforms and, beginning with V0.8.0, multiple instances of any observability platform. From 866445067e8ebe0656f4beecf5c96c720738f534 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:17:27 -0700 Subject: [PATCH 17/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 2fa1351d7c..e76631fa71 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -13,7 +13,7 @@ in one namespace for one API. The Keptn Metrics Operator provides a single entry point to all metrics in the cluster and allows you to use multiple observability platforms -and, beginning with V0.8.0, +and, beginning with v0.8.0, multiple instances of any observability platform. Keptn Metrics are also application aware so report data for all workflows that are included in the Keptn application. From 326cba2b2c70d2217c3fe83b0f54fa2c858d0a0c Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:19:19 -0700 Subject: [PATCH 18/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index e76631fa71..6239f5ea58 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -16,7 +16,7 @@ and allows you to use multiple observability platforms and, beginning with v0.8.0, multiple instances of any observability platform. Keptn Metrics are also application aware -so report data for all workflows that are included in the Keptn application. +so they report data for all workflows that are included in the Keptn application. This data can be displayed on Grafana or another standard dashboard application that you configure From 56cf54da4bc9419ed635427ce5eabb99ef0a522a Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:19:43 -0700 Subject: [PATCH 19/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 6239f5ea58..02fcb6a88d 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -22,7 +22,7 @@ This data can be displayed on Grafana or another standard dashboard application that you configure or can be retrieved using standard Kubernetes commands. -[More introductory info to come] +TODO: Add more introductory info ## Keptn metrics basics From e500c805fad421dc352e17231cc6f04fc0378508 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:21:19 -0700 Subject: [PATCH 20/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 02fcb6a88d..fd125af908 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -51,7 +51,6 @@ kubectl port-forward deployment/metrics-operator 9999 -n keptn-lifecycle-toolkit You can access the metrics from your browser at: -```http://localhost:9999/metrics``` ## Accessing Metrics via the Kubernetes Custom Metrics API From 09034be021ce3fa30404cea58721d248cb382b84 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:22:53 -0700 Subject: [PATCH 21/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index fd125af908..990a795e69 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -96,7 +96,7 @@ blog post for a detailed discussion of doing this with Dynatrace metrics. A similar approach could be used to implement HPA with other data providers. -### Retrieve KeptnMetric values with kubectl raw +### Retrieve KeptnMetric values with kubectl Use the `kubectl raw` command to retrieve the values of a `KeptnMetric`, as in the following example: From ba05ab8849dd3858e1663695344d0169555b40c8 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:23:24 -0700 Subject: [PATCH 22/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 990a795e69..26d4a585ce 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -98,7 +98,7 @@ A similar approach could be used to implement HPA with other data providers. ### Retrieve KeptnMetric values with kubectl -Use the `kubectl raw` command +Use the `kubectl get --raw` command to retrieve the values of a `KeptnMetric`, as in the following example: ```shell From b9ec4587cdd72d402e6759b9428fb2f4b1765852 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:24:05 -0700 Subject: [PATCH 23/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 26d4a585ce..f63e528245 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -151,7 +151,7 @@ $ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/podtato-kube "kind": "KeptnMetric", "namespace": "keptn-lifecycle-toolkit-system", "name": "keptnmetric-sample", - "apiVersion": "metrics.keptn.sh/v1alpha1" + "apiVersion": "metrics.keptn.sh/v1alpha3" }, "metric": { "name": "keptnmetric-sample", From 7e6bcdc904dc522cef3d3cee7b7d46f9d1fab625 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:25:14 -0700 Subject: [PATCH 24/51] Update docs/content/en/docs/yaml-crd-ref/evaluationprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/evaluationprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index f8966fc7ab..b80510bb15 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -4,7 +4,7 @@ description: Define the evaluation provider weight: 13 --- -In earlier releases of the Lifecycle Toolkit, +In earlier releases of the Keptn Lifecycle Toolkit, `KeptnEvaluationProvider` defined the data provider used by [KeptnEvaluationDefinition]( From 992903e35b61e90a2471a43a4c63fbc2537a16eb Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:26:58 -0700 Subject: [PATCH 25/51] Update docs/content/en/docs/yaml-crd-ref/evaluationprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/evaluationprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index b80510bb15..590ebe777d 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -6,7 +6,7 @@ weight: 13 In earlier releases of the Keptn Lifecycle Toolkit, `KeptnEvaluationProvider` defined the data provider -used by [KeptnEvaluationDefinition]( +used by [KeptnEvaluationDefinition](evaluationdefinition.md) ## Yaml Synopsis From 6258b62ae1db3459c04f7e7bef848bcce5a39e13 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:29:07 -0700 Subject: [PATCH 26/51] Update docs/content/en/docs/yaml-crd-ref/metric.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metric.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index dd49338b37..647b9d16d2 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -5,7 +5,7 @@ weight: 50 --- A `KeptnMetric` represents a metric that is collected from a provider. -Providing the metrics as a CRD into a Kubernetes cluster +Providing the metrics as a CRD in a Kubernetes cluster facilitates the reusability of this data across multiple components and allows using multiple observability platforms for different metrics at the same time. From 4828ff47760d0730ee1a3eb0e9d5086e2d78f99d Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:30:56 -0700 Subject: [PATCH 27/51] Update docs/content/en/docs/yaml-crd-ref/evaluationprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/evaluationprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md index 590ebe777d..65829afca0 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationprovider.md @@ -11,7 +11,7 @@ used by [KeptnEvaluationDefinition](evaluationdefinition.md) ## Yaml Synopsis ```yaml -apiVersion: lifecycle.keptn.sh/v?alpha? +apiVersion: lifecycle.keptn.sh/v1alpha2 kind: KeptnTaskDefinition metadata: name: From d431642989e3e441017901c20ba612d17cb6a632 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:31:43 -0700 Subject: [PATCH 28/51] Update docs/content/en/docs/yaml-crd-ref/metric.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metric.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index 647b9d16d2..64c4fa0fef 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -13,7 +13,7 @@ for different metrics at the same time. ## Yaml Synopsis ```yaml -apiVersion: metrics.keptn.sh/v?alpha? +apiVersion: metrics.keptn.sh/v1alpha3 kind: KeptnMetric metadata: name: From 2962a042c0b60530a378bdce0b3cdbd9ba7da1bc Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:33:52 -0700 Subject: [PATCH 29/51] Update docs/content/en/docs/yaml-crd-ref/metric.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metric.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index 64c4fa0fef..09856a506c 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -77,7 +77,6 @@ spec: query: "sum(kube_pod_container_resource_limits{resource='cpu'})" fetchIntervalSeconds: 5 - ## Files API Reference: From 6153d7743106b8c2492101cafb45f93f624c6fe8 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:36:42 -0700 Subject: [PATCH 30/51] Update docs/content/en/docs/yaml-crd-ref/metric.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metric.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index 09856a506c..dbb2f0177a 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -90,7 +90,7 @@ Keptn allows you to define multiple instances of the same data source. In earlier versions, you could use multiple data sources but only one instance of each. Consequently the `v1alpha1` and `v1alpha2` library versions -define the `provider` field with the name of the data provider +define the `provider` field with the type of the data provider (`prometheus`, `dynatrace`, or `dql`) rather than the particular name assigned to the instance of the data provider From 47250d226c3d5e52532416177f8a6c151f020cad Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:37:26 -0700 Subject: [PATCH 31/51] Update docs/content/en/docs/yaml-crd-ref/metricsprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index 8175216520..cf55dd1366 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -1,6 +1,6 @@ --- title: KeptnMetricsProvider -description: Define data provider used for metrics and evaluations +description: Define a data provider used for metrics and evaluations weight: 55 --- From 502dd9b209f49276313c15a95b0db22ef252e9af Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:38:16 -0700 Subject: [PATCH 32/51] Update docs/content/en/docs/yaml-crd-ref/metricsprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index cf55dd1366..ce94f9450a 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -14,7 +14,7 @@ can use more than one instance of each data provider. To implement this, create a `KeptnMetricsProvider` CRD for each instance of each data provider being used, then reference the appropriate provider -for each evaluation or metric definition. +for each evaluation or metric definition by its name. ## Yaml Synopsis From d4498eca296e4d7b025d0f4ce586a1ec792836e3 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:38:56 -0700 Subject: [PATCH 33/51] Update docs/content/en/docs/yaml-crd-ref/metricsprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index ce94f9450a..9f643e71f9 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -19,7 +19,7 @@ for each evaluation or metric definition by its name. ## Yaml Synopsis ```yaml -apiVersion: lifecycle.keptn.sh/v?alpha? +apiVersion: metrics.keptn.sh/v1alpha3 kind: KeptnMetricsProvider metadata: name: From 143fd29d10ae799368f06abfad84375c17c2c488 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:40:14 -0700 Subject: [PATCH 34/51] Update docs/content/en/docs/yaml-crd-ref/metricsprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index 9f643e71f9..a2016c86c1 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -28,7 +28,7 @@ spec: type: prometheus | dynatrace | dql targetServer: "" secretKeyRef: - name: + name: key: From 5db89116c9d8883b6e64771949c636e69b1b3c9b Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:40:39 -0700 Subject: [PATCH 35/51] Update docs/content/en/docs/yaml-crd-ref/metricsprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index a2016c86c1..df27be2935 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -29,7 +29,7 @@ spec: targetServer: "" secretKeyRef: name: - key: + key: ## Fields From 565ce8651bc712f6a92ddd330f24a26f7d0c5227 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:41:11 -0700 Subject: [PATCH 36/51] Update docs/content/en/docs/yaml-crd-ref/metricsprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index df27be2935..79281c77f4 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -73,7 +73,7 @@ spec: ### Example 1: Dynatrace data provider ```yaml -apiVersion: metrics.keptn.sh/v1alpha2 +apiVersion: metrics.keptn.sh/v1alpha3 kind: KeptnMetricsProvider metadata: name: dynatrace From e27895b2b2a3bd85f3cd01afd0691d524d38f14d Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 03:57:26 -0700 Subject: [PATCH 37/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index f63e528245..85ac8d46ba 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -59,7 +59,7 @@ You can access the metrics from your browser at: ### Using the HorizontalPodAutoscaler Use the Kubernetes Custom Metrics API -to refer to Keptnmetrics via the +to refer to `KeptnMetric` via the [Kubernetes HorizontalPodAutoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) (HPA), as in the following example: From d9bd0661206de1ddebe767e495cd3e846ae7e78f Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 25 Apr 2023 04:03:51 -0700 Subject: [PATCH 38/51] mo comments Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 3 +-- docs/content/en/docs/yaml-crd-ref/metric.md | 1 + docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index f63e528245..1d75787426 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -24,7 +24,7 @@ or can be retrieved using standard Kubernetes commands. TODO: Add more introductory info -## Keptn metrics basics +## Keptn metric basics Keptn metrics are implemented with two CRDs: @@ -51,7 +51,6 @@ kubectl port-forward deployment/metrics-operator 9999 -n keptn-lifecycle-toolkit You can access the metrics from your browser at: - ## Accessing Metrics via the Kubernetes Custom Metrics API `KeptnMetrics` can also be retrieved via the Kubernetes Custom Metrics API. diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index 09856a506c..abd144f2ff 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -76,6 +76,7 @@ spec: name: "my-provider" query: "sum(kube_pod_container_resource_limits{resource='cpu'})" fetchIntervalSeconds: 5 +``` ## Files diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index 8175216520..35570deae8 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -30,13 +30,14 @@ spec: secretKeyRef: name: key: - +``` ## Fields * **apiVersion** -- API version being used. ` -* **kind** -- Resource type. Must be set to `KeptnMetricsProvider` +* **kind** -- Resource type. + Must be set to `KeptnMetricsProvider` * **metadata** * **name** -- Unique name of this provider, @@ -64,10 +65,8 @@ spec: * **name:** -- Name of the token for this data provider * **key:** -- Key for this data provider - ## Usage - ## Examples ### Example 1: Dynatrace data provider From c12c6cfd936dcd844df412efa47883f1e6b5953d Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 26 Apr 2023 02:31:45 -0700 Subject: [PATCH 39/51] Update docs/content/en/docs/implementing/_index.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/_index.md b/docs/content/en/docs/implementing/_index.md index 68c8f181fb..5faf2710bc 100644 --- a/docs/content/en/docs/implementing/_index.md +++ b/docs/content/en/docs/implementing/_index.md @@ -22,7 +22,7 @@ The following topics are covered: * Observability * Evaluations - * [Site metrics](metrics.md) that provides a single entry-point + * [Metrics](metrics.md) that provides a single entry-point to site metrics at the application or workload level, based on one or more standard data providers * Tracing From f87d60f9395039efce15a447a24ed94724497c09 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 26 Apr 2023 02:40:51 -0700 Subject: [PATCH 40/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Giovanni Liva Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 35cdd31720..b4b53cce33 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -31,7 +31,7 @@ Keptn metrics are implemented with two CRDs: * [KeptnMetric](../yaml-crd-ref/metric.md) -- define the metric to report * [KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) -- - define the data provider to be used for this metric + define the configuration for a data provider ## Using OpenTelemetry with Keptn metrics From fb924ca2752a65314fb32755f6c46767c6dd3cc4 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 26 Apr 2023 02:45:45 -0700 Subject: [PATCH 41/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Giovanni Liva Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index b4b53cce33..de036baa22 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -93,7 +93,7 @@ spec: See the [Scaling Kubernetes Workloads based on Dynatrace Metrics](https://www.linkedin.com/pulse/scaling-kubernetes-workloads-based-dynatrace-metrics-keptnproject/) blog post for a detailed discussion of doing this with Dynatrace metrics. -A similar approach could be used to implement HPA with other data providers. +The same approach could be used to implement HPA with other data providers. ### Retrieve KeptnMetric values with kubectl From 8c3706753944e5ebeee4a1a15c0845e8df111cac Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 26 Apr 2023 02:46:36 -0700 Subject: [PATCH 42/51] Update docs/content/en/docs/implementing/metrics.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Giovanni Liva Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index de036baa22..e18588b8b9 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -49,7 +49,7 @@ To access the metrics, use the following command: kubectl port-forward deployment/metrics-operator 9999 -n keptn-lifecycle-toolkit-system ``` -You can access the metrics from your browser at: +You can access the metrics from your browser at: `http://localhost:9999` ## Accessing Metrics via the Kubernetes Custom Metrics API From e6e9a9b9f8ed7e75984a732ffafa07022d64cb29 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 26 Apr 2023 02:50:53 -0700 Subject: [PATCH 43/51] Update docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Giovanni Liva Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index 149719a107..815f94e64a 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -27,7 +27,6 @@ spec: * **apiVersion** -- API version being used. Must be `v1alpha3` or later for this syntax. -` * **kind** -- Resource type. Must be set to `KeptnEvaluationDefinition` From 20c4b6c4f743da7e550ec0aac7095d9776d4c426 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 26 Apr 2023 03:44:14 -0700 Subject: [PATCH 44/51] remove ref to specific versions for features Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index e18588b8b9..f6356d32eb 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -13,8 +13,7 @@ in one namespace for one API. The Keptn Metrics Operator provides a single entry point to all metrics in the cluster and allows you to use multiple observability platforms -and, beginning with v0.8.0, -multiple instances of any observability platform. +and multiple instances of any observability platform. Keptn Metrics are also application aware so they report data for all workflows that are included in the Keptn application. From e35f915bcf8635f595ecb688b6d4fd1c9868dc88 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 26 Apr 2023 04:00:58 -0700 Subject: [PATCH 45/51] Update metrics.md Signed-off-by Meg McRoberts meg.mcroberts@dynatrace Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index f6356d32eb..6cc980ef11 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -14,8 +14,8 @@ in one namespace for one API. The Keptn Metrics Operator provides a single entry point to all metrics in the cluster and allows you to use multiple observability platforms and multiple instances of any observability platform. -Keptn Metrics are also application aware -so they report data for all workflows that are included in the Keptn application. +Metrics are fetched independently +and can be used for an evaluation at workload- and application-level. This data can be displayed on Grafana or another standard dashboard application that you configure @@ -32,6 +32,9 @@ Keptn metrics are implemented with two CRDs: * [KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) -- define the configuration for a data provider +A Metric can be created with a query that fetches data for a property +that describes some quality of the application, but this is not done automatically. + ## Using OpenTelemetry with Keptn metrics Keptn metrics can be exposed as OpenTelemetry (OTel) metrics From 6d1666aa1ae17a132fc82779f2cfebced9eba798 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 1 May 2023 05:33:33 -0700 Subject: [PATCH 46/51] remove mention of k8s metrics from intro Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/metrics.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/content/en/docs/implementing/metrics.md b/docs/content/en/docs/implementing/metrics.md index 6cc980ef11..97db815f84 100644 --- a/docs/content/en/docs/implementing/metrics.md +++ b/docs/content/en/docs/implementing/metrics.md @@ -4,16 +4,10 @@ description: Implement Keptn site metrics weight: 130 --- -Kubernetes provides two metrics servers, -one that is custom, the other external. -However, the Kubernetes metrics servers -only allow you to release a single service on a API; -you cannot use multiple observability platforms -in one namespace for one API. - -The Keptn Metrics Operator provides a single entry point to all metrics in the cluster -and allows you to use multiple observability platforms -and multiple instances of any observability platform. +The Keptn Metrics Operator provides a single entry point +to all metrics in the cluster +and allows you to define metrics based on multiple data platforms +and multiple instances of any data platform. Metrics are fetched independently and can be used for an evaluation at workload- and application-level. @@ -33,7 +27,8 @@ Keptn metrics are implemented with two CRDs: define the configuration for a data provider A Metric can be created with a query that fetches data for a property -that describes some quality of the application, but this is not done automatically. +that describes some quality of the application, +but this is not done automatically. ## Using OpenTelemetry with Keptn metrics From 8bef90af2a68c24f7743e303feaee20592023036 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 1 May 2023 05:39:18 -0700 Subject: [PATCH 47/51] fix list in implementing/_index.md Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/_index.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/content/en/docs/implementing/_index.md b/docs/content/en/docs/implementing/_index.md index 5faf2710bc..a79be877fa 100644 --- a/docs/content/en/docs/implementing/_index.md +++ b/docs/content/en/docs/implementing/_index.md @@ -19,10 +19,8 @@ The following topics are covered: * Workloads, Applications, and Deployments -* Observability - - * Evaluations - * [Metrics](metrics.md) that provides a single entry-point - to site metrics at the application or workload level, - based on one or more standard data providers +* Evaluations +* [Metrics](metrics.md) that provides a single entry-point + to site metrics at the application or workload level, + based on one or more standard data providers * Tracing From 815df79aad2247a0c3ef6508ef91e5bc32ff89f5 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 2 May 2023 04:05:26 -0700 Subject: [PATCH 48/51] usage note, example from giovanni's PR Signed-off-by: Meg McRoberts --- .../docs/yaml-crd-ref/evaluationdefinition.md | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index 815f94e64a..6bc31873f9 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -55,7 +55,33 @@ spec: ## Usage -## Examples +A `KeptnEvaluationDefinition` references one or more +[KeptnMetric](metric.md) CRDs. +When multiple `KeptnMetric`s are used, +the Keptn Lifecycle Toolkit considers the evaluation successful +if **all** metrics meet their `evaluationTarget`. + + +## Example + +```yaml +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnEvaluationDefinition +metadata: + name: my-prometheus-evaluation + namespace: example +spec: + source: prometheus + objectives: + - keptnMetricRef: + name: available-cpus + namespace: example + evaluationTarget: ">1" + - keptnMetricRef: + name: cpus-throttling + namespace: example + evaluationTarget: "<0.01" +``` ## Files From 5590c6715fc3703d3d979482204fdefa0bf0ddd2 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 2 May 2023 04:12:43 -0700 Subject: [PATCH 49/51] add go.sum go.mod so I can push content Signed-off-by: Meg McRoberts --- docs/go.mod | 6 ++++++ docs/go.sum | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/go.mod b/docs/go.mod index 2fd941ea51..ef6ad6c918 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -1,3 +1,9 @@ module github.com/keptn/keptn-lifecycle-toolkit/docs go 1.20 + +require ( + github.com/google/docsy/dependencies v0.6.0 // indirect + github.com/keptn/community v0.0.0-20230429154843-72d65a6e2b39 // indirect + github.com/keptn/docs-tooling v0.1.1 // indirect +) diff --git a/docs/go.sum b/docs/go.sum index e69de29bb2..b87cab2184 100644 --- a/docs/go.sum +++ b/docs/go.sum @@ -0,0 +1,9 @@ +github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/google/docsy v0.6.0 h1:43bVF18t2JihAamelQjjGzx1vO2ljCilVrBgetCA8oI= +github.com/google/docsy/dependencies v0.6.0 h1:BFXDCINbp8ZuUGl/mrHjMfhCg+b1YX+hVLAA5fGW7Pc= +github.com/google/docsy/dependencies v0.6.0/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE= +github.com/keptn/community v0.0.0-20230429154843-72d65a6e2b39 h1:cexkJyNwTSwU+XgNKbu3ttr71rK/W9AwuyqUdefzPfc= +github.com/keptn/community v0.0.0-20230429154843-72d65a6e2b39/go.mod h1:0G5nUhSv7ch9BgIFXiY7+U+cV5SbVmneysNGQwQkH8s= +github.com/keptn/docs-tooling v0.1.1 h1:IuI0Fgs0JrtffLN05iaRZVkRMbPu6h9bxR4C8q1ApGU= +github.com/keptn/docs-tooling v0.1.1/go.mod h1:x0iT5YsJosz6wzjQke/YaLgiXF6PV+N8QzxSAc2MY/4= +github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= From 72339ab88178e93637417bf823695ba7a0906356 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Fri, 5 May 2023 00:54:15 -0700 Subject: [PATCH 50/51] Update docs/content/en/docs/implementing/_index.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Giovanni Liva Signed-off-by: Meg McRoberts --- docs/content/en/docs/implementing/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/implementing/_index.md b/docs/content/en/docs/implementing/_index.md index a79be877fa..2baf4d943f 100644 --- a/docs/content/en/docs/implementing/_index.md +++ b/docs/content/en/docs/implementing/_index.md @@ -23,4 +23,4 @@ The following topics are covered: * [Metrics](metrics.md) that provides a single entry-point to site metrics at the application or workload level, based on one or more standard data providers - * Tracing +* Tracing From 20a604badd71f67082a0175a37893de7c8d443ce Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Fri, 5 May 2023 00:57:42 -0700 Subject: [PATCH 51/51] Update docs/content/en/docs/yaml-crd-ref/metricsprovider.md Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Giovanni Liva Signed-off-by: Meg McRoberts --- docs/content/en/docs/yaml-crd-ref/metricsprovider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md index a7dc89fa54..9e06f3c052 100644 --- a/docs/content/en/docs/yaml-crd-ref/metricsprovider.md +++ b/docs/content/en/docs/yaml-crd-ref/metricsprovider.md @@ -25,7 +25,7 @@ metadata: name: namespace: spec: - type: prometheus | dynatrace | dql + type: prometheus | dynatrace | dql | datadog targetServer: "" secretKeyRef: name: