diff --git a/docs/content/en/docs/core-concepts/assets/usecase-orchestrate.md_1.yaml b/docs/content/en/docs/core-concepts/assets/usecase-orchestrate.md_1.yaml new file mode 100644 index 00000000000..fbaaa666370 --- /dev/null +++ b/docs/content/en/docs/core-concepts/assets/usecase-orchestrate.md_1.yaml @@ -0,0 +1,11 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnEvaluationDefinition +metadata: + name: evaluate-dependencies + namespace: simplenode-dev +spec: + objectives: + - keptnMetricRef: + name: available-cpus + namespace: simplenode-dev + evaluationTarget: ">4" diff --git a/docs/content/en/docs/core-concepts/assets/usecase-orchestrate.md_2.yaml b/docs/content/en/docs/core-concepts/assets/usecase-orchestrate.md_2.yaml new file mode 100644 index 00000000000..c7b086b2620 --- /dev/null +++ b/docs/content/en/docs/core-concepts/assets/usecase-orchestrate.md_2.yaml @@ -0,0 +1,11 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnTaskDefinition +metadata: + name: notify +spec: + function: + inline: + code: | + + secureParameters: + secret: slack-notification diff --git a/docs/content/en/docs/core-concepts/usecase-orchestrate.md b/docs/content/en/docs/core-concepts/usecase-orchestrate.md index aa7eef70cfe..84939993126 100644 --- a/docs/content/en/docs/core-concepts/usecase-orchestrate.md +++ b/docs/content/en/docs/core-concepts/usecase-orchestrate.md @@ -98,19 +98,7 @@ file. For example, the definition of the `evaluate-dependencies` evaluation looks like this: -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnEvaluationDefinition -metadata: - name: evaluate-dependencies - namespace: simplenode-dev -spec: - objectives: - - keptnMetricRef: - name: available-cpus - namespace: simplenode-dev - evaluationTarget: ">4" -``` +{% include "usecase-orchestrate.md_1.yaml" %} You see that the `available-cpus` metric is defined in the [keptn-metric.yaml](https://github.com/keptn-sandbox/klt-on-k3s-with-argocd/blob/main/simplenode-dev/keptn-metric.yaml) @@ -132,19 +120,7 @@ we have a `notify` task that composes some Markdown text to be sent as Slack notifications The `KeptnTaskDefinition` looks like this: -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnTaskDefinition -metadata: - name: notify -spec: - function: - inline: - code: | - - secureParameters: - secret: slack-notification -``` +{% include "usecase-orchestrate.md_2.yaml" %} The code to be executed is expressed as a [Deno](https://deno.com) diff --git a/docs/content/en/docs/getting-started/assets/lifecycle-management.md_1.yaml b/docs/content/en/docs/getting-started/assets/lifecycle-management.md_1.yaml new file mode 100644 index 00000000000..6f85d1db9e2 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/lifecycle-management.md_1.yaml @@ -0,0 +1,21 @@ +--- +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnTaskDefinition +metadata: + name: send-event + namespace: keptndemo +spec: + retries: 0 + timeout: 5s + container: + name: curlcontainer + image: curlimages/curl:latest + args: [ + '-X', + 'POST', + 'http://webhook.webhook.svc.cluster.local:8084/YOUR-UUID-HERE', + '-H', + 'Content-Type: application/json', + '-d', + '{ "from": "keptn send-event" }' + ] diff --git a/docs/content/en/docs/getting-started/assets/lifecycle-management.md_2.yaml b/docs/content/en/docs/getting-started/assets/lifecycle-management.md_2.yaml new file mode 100644 index 00000000000..59011b62b7d --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/lifecycle-management.md_2.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnTask +metadata: + name: runsendevent1 + namespace: keptndemo +spec: + taskDefinition: send-event + context: + appName: "my-test-app" + appVersion: "1.0.0" + objectType: "" + taskType: "" + workloadName: "my-test-workload" + workloadVersion: "1.0.0" diff --git a/docs/content/en/docs/getting-started/assets/lifecycle-management.md_3.yaml b/docs/content/en/docs/getting-started/assets/lifecycle-management.md_3.yaml new file mode 100644 index 00000000000..221c28cf5dc --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/lifecycle-management.md_3.yaml @@ -0,0 +1,7 @@ +... +labels: + app.kubernetes.io/part-of: keptndemoapp + app.kubernetes.io/name: nginx + app.kubernetes.io/version: 0.0.2 + keptn.sh/post-deployment-tasks: "send-event" +... diff --git a/docs/content/en/docs/getting-started/assets/lifecycle-management.md_4.yaml b/docs/content/en/docs/getting-started/assets/lifecycle-management.md_4.yaml new file mode 100644 index 00000000000..96802057b8a --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/lifecycle-management.md_4.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment + namespace: keptndemo + labels: + app.kubernetes.io/name: nginx +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: nginx + template: + metadata: + labels: + app.kubernetes.io/part-of: keptndemoapp + app.kubernetes.io/name: nginx + app.kubernetes.io/version: 0.0.2 + keptn.sh/post-deployment-tasks: "send-event" + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 diff --git a/docs/content/en/docs/getting-started/assets/metrics.md_1.yaml b/docs/content/en/docs/getting-started/assets/metrics.md_1.yaml new file mode 100644 index 00000000000..faa4ccf4897 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/metrics.md_1.yaml @@ -0,0 +1,7 @@ +kind: KeptnMetricsProvider +metadata: + name: dev-prometheus + namespace: simplenode-dev +spec: + type: prometheus + targetserver: "http://prometheus-k8s-monitoring-svc.cluster.local:9090" diff --git a/docs/content/en/docs/getting-started/assets/metrics.md_2.yaml b/docs/content/en/docs/getting-started/assets/metrics.md_2.yaml new file mode 100644 index 00000000000..21f8a60b932 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/metrics.md_2.yaml @@ -0,0 +1,11 @@ +kind: KeptnMetricsProvider +metadata: + name: dev-dynatrace + namespace: simplenode-dev +spec: + type: dynatrace + targetServer: "https://hci34192.live.dynatrace.com" + secretKeyRef: + name: dynatrace + key: DT_TOKEN +... diff --git a/docs/content/en/docs/getting-started/assets/metrics.md_3.yaml b/docs/content/en/docs/getting-started/assets/metrics.md_3.yaml new file mode 100644 index 00000000000..de11d4f0b28 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/metrics.md_3.yaml @@ -0,0 +1,21 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: Keptnmetric +metadata: + name: available-cpus + namespace: simplenode-dev +spec: + provider: + name: dev-prometheus + query: "sum(kube_node_status_capacity{resources`cpu`})" + fetchIntervalSeconds: 10 +--- +apiVersion: metrics.keptn.sh/v1beta1 +kind: Keptnmetric +metadata: + name: availability-slo + namespace: simplenode-dev +spec: + provider: + name: dev-dynatrace + query: "func:slo.availability_simplenodeservice" + fetchIntervalSeconds: 10 diff --git a/docs/content/en/docs/getting-started/assets/metrics.md_4.yaml b/docs/content/en/docs/getting-started/assets/metrics.md_4.yaml new file mode 100644 index 00000000000..152b122e62b --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/metrics.md_4.yaml @@ -0,0 +1 @@ +kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces//keptnmetrics.metrics.sh//" diff --git a/docs/content/en/docs/getting-started/assets/metrics.md_5.yaml b/docs/content/en/docs/getting-started/assets/metrics.md_5.yaml new file mode 100644 index 00000000000..5b6d2c6f3eb --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/metrics.md_5.yaml @@ -0,0 +1,23 @@ +$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/simplenode-dev/keptnmetrics.metrics.sh/available-cpus/available-cpus" + +{ + "kind": "MetricValueList", + "apiVersion": "custom.metrics.k8s.io/v1beta2", + "metadata": {}, + "items": [ + { + "describedObject": { + "kind": "KeptnMetric", + "namespace": "simplenode-dev", + "name": "available-cpus", + "apiVersion": "metrics.keptn.sh/v1beta1" + }, + "metric": { + "name": "available-cpus", + "selector": {} + }, + "timestamp": "2023-05-11T08:05:36Z", + "value": "6" + } + ] +} diff --git a/docs/content/en/docs/getting-started/assets/observability.md_1.yaml b/docs/content/en/docs/getting-started/assets/observability.md_1.yaml new file mode 100644 index 00000000000..e36ed40f5ce --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/observability.md_1.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: options.keptn.sh/v1alpha1 +kind: KeptnConfig +metadata: + name: keptnconfig-sample + namespace: keptn-system +spec: + OTelCollectorUrl: 'jaeger-collector.keptn-system.svc.cluster.local:4317' + keptnAppCreationRequestTimeoutSeconds: 30 diff --git a/docs/content/en/docs/getting-started/assets/observability.md_2.yaml b/docs/content/en/docs/getting-started/assets/observability.md_2.yaml new file mode 100644 index 00000000000..5d855d58041 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/observability.md_2.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: keptndemo + annotations: + keptn.sh/lifecycle-toolkit: enabled diff --git a/docs/content/en/docs/getting-started/assets/observability.md_3.yaml b/docs/content/en/docs/getting-started/assets/observability.md_3.yaml new file mode 100644 index 00000000000..db689656a16 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/observability.md_3.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment + namespace: keptndemo + labels: + app.kubernetes.io/name: nginx +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: nginx + template: + metadata: + labels: + app.kubernetes.io/part-of: keptndemoapp + app.kubernetes.io/name: nginx + app.kubernetes.io/version: 0.0.1 + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 +--- +apiVersion: apps/v1 +kind: Service +apiVersion: v1 +kind: Service +metadata: + name: nginx + namespace: keptndemo +spec: + selector: + app.kubernetes.io/name: nginx + ports: + - protocol: TCP + port: 8080 + targetPort: 80 diff --git a/docs/content/en/docs/getting-started/assets/observability.md_4.yaml b/docs/content/en/docs/getting-started/assets/observability.md_4.yaml new file mode 100644 index 00000000000..ab6039c6f21 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/observability.md_4.yaml @@ -0,0 +1,6 @@ +apiVersion: jaegertracing.io/v1 +kind: Jaeger +metadata: + name: jaeger +spec: + strategy: allInOne diff --git a/docs/content/en/docs/getting-started/assets/observability.md_5.yaml b/docs/content/en/docs/getting-started/assets/observability.md_5.yaml new file mode 100644 index 00000000000..a0ed412e1d7 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/observability.md_5.yaml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + labels: + grafana_datasource: "1" + name: grafana-datasources + namespace: monitoring +stringData: + datasources.yaml: |- + { + "apiVersion": 1, + "datasources": [ + { + "access": "proxy", + "editable": false, + "name": "prometheus", + "orgId": 1, + "type": "prometheus", + "url": "http://observability-stack-kube-p-prometheus.monitoring.svc:9090", + "version": 1 + }, + { + "orgId":1, + "name":"Jaeger", + "type":"jaeger", + "typeName":"Jaeger", + "typeLogoUrl":"public/app/plugins/datasource/jaeger/img/jaeger_logo.svg", + "access":"proxy", + "url":"http://jaeger-query.keptn-system.svc.cluster.local:16686", + "user":"", + "database":"", + "basicAuth":false, + "isDefault":false, + "jsonData":{"spanBar":{"type":"None"}}, + "readOnly":false + } + ] + } diff --git a/docs/content/en/docs/getting-started/assets/observability.md_6.yaml b/docs/content/en/docs/getting-started/assets/observability.md_6.yaml new file mode 100644 index 00000000000..dadb233f68c --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/observability.md_6.yaml @@ -0,0 +1,10 @@ +grafana: + adminPassword: admin + sidecar.datasources.defaultDatasourceEnabled: false +prometheus: + prometheusSpec: + additionalScrapeConfigs: + - job_name: "scrape_klt" + scrape_interval: 5s + static_configs: + - targets: ['lifecycle-operator-metrics-service.keptn-system.svc.cluster.local:2222'] diff --git a/docs/content/en/docs/getting-started/assets/observability.md_7.yaml b/docs/content/en/docs/getting-started/assets/observability.md_7.yaml new file mode 100644 index 00000000000..3d365e2949a --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/observability.md_7.yaml @@ -0,0 +1,21 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnApp +metadata: + name: + namespace: +spec: + version: "x.y" + revision: x + workloads: + - name: + version: + - name: + version: + preDeploymentTasks: + - + postDeploymentTasks: + - + preDeploymentEvaluations: + - + postDeploymentEvaluations: + - diff --git a/docs/content/en/docs/getting-started/assets/observability.md_8.yaml b/docs/content/en/docs/getting-started/assets/observability.md_8.yaml new file mode 100644 index 00000000000..4416ee049e1 --- /dev/null +++ b/docs/content/en/docs/getting-started/assets/observability.md_8.yaml @@ -0,0 +1,16 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnApp +metadata: + name: podtato-head + namespace: podtato-kubectl +spec: + version: "latest" + workloads: + - name: podtato-head-left-arm + version: "my_vers12.5" + - name: podtato-head-left-leg + version: "my_v24" + postDeploymentTasks: + - post-deployment-hello + preDeploymentEvaluations: + - my-prometheus-definition diff --git a/docs/content/en/docs/getting-started/lifecycle-management.md b/docs/content/en/docs/getting-started/lifecycle-management.md index 9a3ed83aed6..27ccd015354 100644 --- a/docs/content/en/docs/getting-started/lifecycle-management.md +++ b/docs/content/en/docs/getting-started/lifecycle-management.md @@ -75,29 +75,7 @@ Add a task which will trigger after a deployment. Change `UUID` to whatever value you have. Apply this manifest: -```yaml ---- -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnTaskDefinition -metadata: - name: send-event - namespace: keptndemo -spec: - retries: 0 - timeout: 5s - container: - name: curlcontainer - image: curlimages/curl:latest - args: [ - '-X', - 'POST', - 'http://webhook.webhook.svc.cluster.local:8084/YOUR-UUID-HERE', - '-H', - 'Content-Type: application/json', - '-d', - '{ "from": "keptn send-event" }' - ] -``` +{% include "lifecycle-management.md_1.yaml" %} ### Verify it works @@ -109,23 +87,7 @@ In the following steps we will have Keptn orchestrate this for us automatically. Apply this manifest: -```yaml ---- -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnTask -metadata: - name: runsendevent1 - namespace: keptndemo -spec: - taskDefinition: send-event - context: - appName: "my-test-app" - appVersion: "1.0.0" - objectType: "" - taskType: "" - workloadName: "my-test-workload" - workloadVersion: "1.0.0" -``` +{% include "lifecycle-management.md_2.yaml" %} If it works, `kubectl -n keptndemo get jobs` should show: @@ -155,48 +117,13 @@ Getting started guide. Add a new label so the `labels` section looks like this: -```yaml -... -labels: - app.kubernetes.io/part-of: keptndemoapp - app.kubernetes.io/name: nginx - app.kubernetes.io/version: 0.0.2 - keptn.sh/post-deployment-tasks: "send-event" -... -``` +{% include "lifecycle-management.md_3.yaml" %} Increase the version number to `0.0.2` and re-apply the manifest. Here is a full version of the new YAML: -```yaml ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment - namespace: keptndemo - labels: - app.kubernetes.io/name: nginx -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: nginx - template: - metadata: - labels: - app.kubernetes.io/part-of: keptndemoapp - app.kubernetes.io/name: nginx - app.kubernetes.io/version: 0.0.2 - keptn.sh/post-deployment-tasks: "send-event" - spec: - containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 -``` +{% include "lifecycle-management.md_4.yaml" %} > Best Practice: Start with post deployment tasks. > Pre-deployment tasks can potentially block deployments (see below). diff --git a/docs/content/en/docs/getting-started/metrics.md b/docs/content/en/docs/getting-started/metrics.md index 15512b46bb3..3e7bd06082f 100644 --- a/docs/content/en/docs/getting-started/metrics.md +++ b/docs/content/en/docs/getting-started/metrics.md @@ -107,15 +107,7 @@ Definition of [dev-prometheus](https://github.com/keptn-sandbox/klt-on-k3s-with-argocd/blob/main/simplenode-dev/keptn-prometheus-provider.yaml) data source: -```yaml -kind: KeptnMetricsProvider -metadata: - name: dev-prometheus - namespace: simplenode-dev -spec: - type: prometheus - targetserver: "http://prometheus-k8s-monitoring-svc.cluster.local:9090" -``` +{% include "metrics.md_1.yaml" %} Definition of the [dev-dynatrace](https://github.com/keptn-sandbox/klt-on-k3s-with-argocd/blob/main/simplenode-dev/dynatrace-provider.yaml.tmp) @@ -123,19 +115,7 @@ data source. Note that the `dev-dynatrace` server is protected by a secret key so that information is included in the provider definition: -```yaml -kind: KeptnMetricsProvider -metadata: - name: dev-dynatrace - namespace: simplenode-dev -spec: - type: dynatrace - targetServer: "https://hci34192.live.dynatrace.com" - secretKeyRef: - name: dynatrace - key: DT_TOKEN -... -``` +{% include "metrics.md_2.yaml" %} ### Define KeptnMetric information @@ -158,29 +138,7 @@ The [keptn-metric.yaml](https://github.com/keptn-sandbox/klt-on-k3s-with-argocd/blob/main/simplenode-dev/keptn-metric.yaml) file for our example looks like: -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: Keptnmetric -metadata: - name: available-cpus - namespace: simplenode-dev -spec: - provider: - name: dev-prometheus - query: "sum(kube_node_status_capacity{resources`cpu`})" - fetchIntervalSeconds: 10 ---- -apiVersion: metrics.keptn.sh/v1beta1 -kind: Keptnmetric -metadata: - name: availability-slo - namespace: simplenode-dev -spec: - provider: - name: dev-dynatrace - query: "func:slo.availability_simplenodeservice" - fetchIntervalSeconds: 10 -``` +{% include "metrics.md_3.yaml" %} Note the following: @@ -238,37 +196,11 @@ cpu-throttling my-provider sum(kube_node_status_capacity{resource=`cpu`}) 6 The syntax to retrieve metrics through the Kubernetes API is: -```yaml -kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces//keptnmetrics.metrics.sh//" -``` +{% include "metrics.md_4.yaml" %} For example, the output for the `available-cpus` looks like: -```yaml -$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/simplenode-dev/keptnmetrics.metrics.sh/available-cpus/available-cpus" - -{ - "kind": "MetricValueList", - "apiVersion": "custom.metrics.k8s.io/v1beta2", - "metadata": {}, - "items": [ - { - "describedObject": { - "kind": "KeptnMetric", - "namespace": "simplenode-dev", - "name": "available-cpus", - "apiVersion": "metrics.keptn.sh/v1beta1" - }, - "metric": { - "name": "available-cpus", - "selector": {} - }, - "timestamp": "2023-05-11T08:05:36Z", - "value": "6" - } - ] -} -``` +{% include "metrics.md_5.yaml" %} You can also display the metrics graphically using a dashboard such as Grafana. diff --git a/docs/content/en/docs/getting-started/observability.md b/docs/content/en/docs/getting-started/observability.md index 998d91dd315..cb5f4e33083 100644 --- a/docs/content/en/docs/getting-started/observability.md +++ b/docs/content/en/docs/getting-started/observability.md @@ -64,17 +64,7 @@ but creating this configuration now means the system is preconfigured. Save this file as `keptnconfig.yaml`. It doesn't matter where this file is located on your local machine: -```yaml ---- -apiVersion: options.keptn.sh/v1alpha1 -kind: KeptnConfig -metadata: - name: keptnconfig-sample - namespace: keptn-system -spec: - OTelCollectorUrl: 'jaeger-collector.keptn-system.svc.cluster.local:4317' - keptnAppCreationRequestTimeoutSeconds: 30 -``` +{% include "observability.md_1.yaml" %} Apply the file and wait for Keptn to pick up the new configuration: @@ -91,14 +81,7 @@ and can be influenced by network latency. Save this file as `namespace.yaml`. The annotation means that Keptn is active for workloads in this namespace. -```yaml -apiVersion: v1 -kind: Namespace -metadata: - name: keptndemo - annotations: - keptn.sh/lifecycle-toolkit: enabled -``` +{% include "observability.md_2.yaml" %} Create the namespace: @@ -112,47 +95,7 @@ It is time to deploy the demo application. Save this manifest as `app.yaml`: -```yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment - namespace: keptndemo - labels: - app.kubernetes.io/name: nginx -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: nginx - template: - metadata: - labels: - app.kubernetes.io/part-of: keptndemoapp - app.kubernetes.io/name: nginx - app.kubernetes.io/version: 0.0.1 - spec: - containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 ---- -apiVersion: apps/v1 -kind: Service -apiVersion: v1 -kind: Service -metadata: - name: nginx - namespace: keptndemo -spec: - selector: - app.kubernetes.io/name: nginx - ports: - - protocol: TCP - port: 8080 - targetPort: 80 -``` +{% include "observability.md_3.yaml" %} Now apply it: @@ -300,14 +243,7 @@ helm install cert-manager --namespace cert-manager --version v1.12.2 jetstack/ce Save this file as `jaeger.yaml` (it can be saved anywhere on your computer): -```yaml -apiVersion: jaegertracing.io/v1 -kind: Jaeger -metadata: - name: jaeger -spec: - strategy: allInOne -``` +{% include "observability.md_4.yaml" %} Install Jaeger to store and visualise the deployment traces generated by Keptn: @@ -347,47 +283,7 @@ This file will configure Grafana to look at the Jaeger service and the Prometheu Save this file as `datasources.yaml`: -```yaml -apiVersion: v1 -kind: Secret -type: Opaque -metadata: - labels: - grafana_datasource: "1" - name: grafana-datasources - namespace: monitoring -stringData: - datasources.yaml: |- - { - "apiVersion": 1, - "datasources": [ - { - "access": "proxy", - "editable": false, - "name": "prometheus", - "orgId": 1, - "type": "prometheus", - "url": "http://observability-stack-kube-p-prometheus.monitoring.svc:9090", - "version": 1 - }, - { - "orgId":1, - "name":"Jaeger", - "type":"jaeger", - "typeName":"Jaeger", - "typeLogoUrl":"public/app/plugins/datasource/jaeger/img/jaeger_logo.svg", - "access":"proxy", - "url":"http://jaeger-query.keptn-system.svc.cluster.local:16686", - "user":"", - "database":"", - "basicAuth":false, - "isDefault":false, - "jsonData":{"spanBar":{"type":"None"}}, - "readOnly":false - } - ] - } -``` +{% include "observability.md_5.yaml" %} Now apply it: @@ -405,18 +301,7 @@ This will install: Save this file as `values.yaml`: -```yaml -grafana: - adminPassword: admin - sidecar.datasources.defaultDatasourceEnabled: false -prometheus: - prometheusSpec: - additionalScrapeConfigs: - - job_name: "scrape_klt" - scrape_interval: 5s - static_configs: - - targets: ['lifecycle-operator-metrics-service.keptn-system.svc.cluster.local:2222'] -``` +{% include "observability.md_6.yaml" %} ```shell helm repo add prometheus-community https://prometheus-community.github.io/helm-charts @@ -478,29 +363,7 @@ View the Keptn Applications Dashboard and you should see the DORA metrics and an To customize workloads and checks associated with the application, we can edit the autogenerated KeptnApp or create our own. -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnApp -metadata: - name: - namespace: -spec: - version: "x.y" - revision: x - workloads: - - name: - version: - - name: - version: - preDeploymentTasks: - - - postDeploymentTasks: - - - preDeploymentEvaluations: - - - postDeploymentEvaluations: - - -``` +{% include "observability.md_7.yaml" %} ## Fields @@ -566,24 +429,7 @@ If used, these fields must be populated manually: ## Example -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnApp -metadata: - name: podtato-head - namespace: podtato-kubectl -spec: - version: "latest" - workloads: - - name: podtato-head-left-arm - version: "my_vers12.5" - - name: podtato-head-left-leg - version: "my_v24" - postDeploymentTasks: - - post-deployment-hello - preDeploymentEvaluations: - - my-prometheus-definition -``` +{% include "observability.md_8.yaml" %} You may have noticed that the `KeptnApp` Custom Resources are created automatically by Keptn. diff --git a/docs/content/en/docs/guides/assets/auto-app-discovery.md_1.yaml b/docs/content/en/docs/guides/assets/auto-app-discovery.md_1.yaml new file mode 100644 index 00000000000..87a8747b659 --- /dev/null +++ b/docs/content/en/docs/guides/assets/auto-app-discovery.md_1.yaml @@ -0,0 +1,3 @@ +metadata: + name: simpleapp + namespace: simplenode-dev diff --git a/docs/content/en/docs/guides/assets/auto-app-discovery.md_2.yaml b/docs/content/en/docs/guides/assets/auto-app-discovery.md_2.yaml new file mode 100644 index 00000000000..73e3f66f3ae --- /dev/null +++ b/docs/content/en/docs/guides/assets/auto-app-discovery.md_2.yaml @@ -0,0 +1,42 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: podtato-kubectl + annotations: + keptn.sh/lifecycle-toolkit: "enabled" + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: podtato-head-frontend + namespace: podtato-kubectl +spec: + template: + metadata: + labels: + app.kubernetes.io/name: podtato-head-frontend + app.kubernetes.io/part-of: podtato-head + app.kubernetes.io/version: 0.1.0 + spec: + containers: + - name: podtato-head-frontend + image: podtato-head-frontend +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: podtato-head-hat + namespace: podtato-kubectl +spec: + replicas: 1 + template: + metadata: + labels: + app.kubernetes.io/name: podtato-head-hat + app.kubernetes.io/part-of: podtato-head + app.kubernetes.io/version: 0.1.1 + spec: + containers: + - name: podtato-head-hat + image: podtato-head-hat diff --git a/docs/content/en/docs/guides/assets/auto-app-discovery.md_3.yaml b/docs/content/en/docs/guides/assets/auto-app-discovery.md_3.yaml new file mode 100644 index 00000000000..4853bbbdd8f --- /dev/null +++ b/docs/content/en/docs/guides/assets/auto-app-discovery.md_3.yaml @@ -0,0 +1,14 @@ +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnApp +metadata: + name: podtato-head + namespace: podtato-kubectl + annotations: + app.kubernetes.io/managed-by: "keptn" +spec: + version: "" + workloads: + - name: podtato-head-frontend + version: 0.1.0 + - name: podtato-head-hat + version: 1.1.1 diff --git a/docs/content/en/docs/guides/assets/evaluatemetrics.md_1.yaml b/docs/content/en/docs/guides/assets/evaluatemetrics.md_1.yaml new file mode 100644 index 00000000000..981febc382f --- /dev/null +++ b/docs/content/en/docs/guides/assets/evaluatemetrics.md_1.yaml @@ -0,0 +1,8 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: KeptnMetricsProvider +metadata: + name: prometheus-provider + namespace: simplenode-dev +spec: + type: prometheus + targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" diff --git a/docs/content/en/docs/guides/assets/evaluatemetrics.md_2.yaml b/docs/content/en/docs/guides/assets/evaluatemetrics.md_2.yaml new file mode 100644 index 00000000000..ce49be532a0 --- /dev/null +++ b/docs/content/en/docs/guides/assets/evaluatemetrics.md_2.yaml @@ -0,0 +1,11 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: KeptnMetricsProvider +metadata: + name: dynatrace-provider + namespace: podtato-kubectl +spec: + type: dynatrace + targetServer: "" + secretKeyRef: + name: dt-api-token + key: DT_TOKEN diff --git a/docs/content/en/docs/guides/assets/evaluatemetrics.md_3.yaml b/docs/content/en/docs/guides/assets/evaluatemetrics.md_3.yaml new file mode 100644 index 00000000000..de11d4f0b28 --- /dev/null +++ b/docs/content/en/docs/guides/assets/evaluatemetrics.md_3.yaml @@ -0,0 +1,21 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: Keptnmetric +metadata: + name: available-cpus + namespace: simplenode-dev +spec: + provider: + name: dev-prometheus + query: "sum(kube_node_status_capacity{resources`cpu`})" + fetchIntervalSeconds: 10 +--- +apiVersion: metrics.keptn.sh/v1beta1 +kind: Keptnmetric +metadata: + name: availability-slo + namespace: simplenode-dev +spec: + provider: + name: dev-dynatrace + query: "func:slo.availability_simplenodeservice" + fetchIntervalSeconds: 10 diff --git a/docs/content/en/docs/guides/assets/evaluatemetrics.md_4.yaml b/docs/content/en/docs/guides/assets/evaluatemetrics.md_4.yaml new file mode 100644 index 00000000000..b4bc0731226 --- /dev/null +++ b/docs/content/en/docs/guides/assets/evaluatemetrics.md_4.yaml @@ -0,0 +1,11 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: KeptnMetric +metadata: + name: good-metric +spec: + provider: + name: my-provider + query: "sum(kube_pod_container_resource_limits{resource='cpu'})" + fetchIntervalSeconds: 10 + range: + interval: "3m" diff --git a/docs/content/en/docs/guides/assets/integrate.md_1.yaml b/docs/content/en/docs/guides/assets/integrate.md_1.yaml new file mode 100644 index 00000000000..dcf976876c2 --- /dev/null +++ b/docs/content/en/docs/guides/assets/integrate.md_1.yaml @@ -0,0 +1,4 @@ +keptn.sh/workload: myAwesomeWorkload +keptn.sh/version: myAwesomeWorkloadVersion +keptn.sh/app: myAwesomeAppName +keptn.sh/container: myAwesomeContainer diff --git a/docs/content/en/docs/guides/assets/integrate.md_2.yaml b/docs/content/en/docs/guides/assets/integrate.md_2.yaml new file mode 100644 index 00000000000..d7f31beba5d --- /dev/null +++ b/docs/content/en/docs/guides/assets/integrate.md_2.yaml @@ -0,0 +1,3 @@ +app.kubernetes.io/name: myAwesomeWorkload +app.kubernetes.io/version: myAwesomeWorkloadVersion +app.kubernetes.io/part-of: myAwesomeAppName diff --git a/docs/content/en/docs/guides/assets/integrate.md_3.yaml b/docs/content/en/docs/guides/assets/integrate.md_3.yaml new file mode 100644 index 00000000000..5374a8769f1 --- /dev/null +++ b/docs/content/en/docs/guides/assets/integrate.md_3.yaml @@ -0,0 +1,4 @@ +keptn.sh/pre-deployment-evaluations: <`EvaluationDefinition`-name> +keptn.sh/pre-deployment-tasks: <`TaskDefinition`-name> +keptn.sh/post-deployment-evaluations: <`EvaluationDefinition`-name> +keptn.sh/post-deployment-tasks: <`TaskDefinition`-name> diff --git a/docs/content/en/docs/guides/assets/restart-application-deployment.md_1.yaml b/docs/content/en/docs/guides/assets/restart-application-deployment.md_1.yaml new file mode 100644 index 00000000000..36e0f830c06 --- /dev/null +++ b/docs/content/en/docs/guides/assets/restart-application-deployment.md_1.yaml @@ -0,0 +1,62 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: restartable-apps + annotations: + keptn.sh/lifecycle-toolkit: "enabled" +--- +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnApp +metadata: + name: podtato-head + namespace: restartable-apps +spec: + version: "0.1.1" + revision: 1 + workloads: + - name: podtato-head-entry + version: "0.1.2" + preDeploymentTasks: + - pre-deployment-check +--- +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnTaskDefinition +metadata: + name: pre-deployment-check + namespace: restartable-apps +spec: + function: + inline: + code: | + console.error("I failed") + process.exit(1) +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: podtato-head-entry + namespace: restartable-apps + labels: + app: podtato-head +spec: + selector: + matchLabels: + component: podtato-head-entry + template: + metadata: + labels: + component: podtato-head-entry + keptn.sh/workload: podtato-head-entry + keptn.sh/app: podtato-head + keptn.sh/version: "0.1.2" + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: ghcr.io/podtato-head/entry:0.2.7 + imagePullPolicy: Always + ports: + - containerPort: 9000 + env: + - name: PODTATO_PORT + value: "9000" diff --git a/docs/content/en/docs/guides/assets/restart-application-deployment.md_2.yaml b/docs/content/en/docs/guides/assets/restart-application-deployment.md_2.yaml new file mode 100644 index 00000000000..b8c258a9c18 --- /dev/null +++ b/docs/content/en/docs/guides/assets/restart-application-deployment.md_2.yaml @@ -0,0 +1,10 @@ +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnTaskDefinition +metadata: + name: pre-deployment-check + namespace: restartable-apps +spec: + function: + inline: + code: | + console.error("Success") diff --git a/docs/content/en/docs/guides/assets/restart-application-deployment.md_3.yaml b/docs/content/en/docs/guides/assets/restart-application-deployment.md_3.yaml new file mode 100644 index 00000000000..80dfd9bd249 --- /dev/null +++ b/docs/content/en/docs/guides/assets/restart-application-deployment.md_3.yaml @@ -0,0 +1,13 @@ +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnApp +metadata: + name: podtato-head + namespace: restartable-apps +spec: + version: "0.1.1" + revision: 2 # Increased this value from 1 to 2 + workloads: + - name: podtato-head-entry + version: "0.1.2" + preDeploymentTasks: + - pre-deployment-check diff --git a/docs/content/en/docs/guides/assets/tasks.md_1.yaml b/docs/content/en/docs/guides/assets/tasks.md_1.yaml new file mode 100644 index 00000000000..3daacec6a08 --- /dev/null +++ b/docs/content/en/docs/guides/assets/tasks.md_1.yaml @@ -0,0 +1,13 @@ +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnTaskDefinition +metadata: + name: slack-notification-dev +spec: + function: + functionRef: + name: slack-notification + parameters: + map: + textMessage: "This is my configuration" + secureParameters: + secret: slack-token diff --git a/docs/content/en/docs/guides/assets/tasks.md_2.yaml b/docs/content/en/docs/guides/assets/tasks.md_2.yaml new file mode 100644 index 00000000000..df1eeeb8ce9 --- /dev/null +++ b/docs/content/en/docs/guides/assets/tasks.md_2.yaml @@ -0,0 +1,13 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnTaskDefinition +metadata: + name: dummy-task + namespace: "default" +spec: + function: + secureParameters: + secret: my-secret + inline: + code: | + let secret_text = Deno.env.get("SECURE_DATA"); + // secret_text = "foo" diff --git a/docs/content/en/docs/guides/assets/tasks.md_3.yaml b/docs/content/en/docs/guides/assets/tasks.md_3.yaml new file mode 100644 index 00000000000..645ac6134a9 --- /dev/null +++ b/docs/content/en/docs/guides/assets/tasks.md_3.yaml @@ -0,0 +1,15 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnTaskDefinition +metadata: + name: dummy-task + namespace: "default" +spec: + function: + secureParameters: + secret: my-secret + inline: + code: | + let secret_text = Deno.env.get("SECURE_DATA"); + let secret_text_obj = JSON.parse(secret_text); + // secret_text_obj["foo"] = "bar" + // secret_text_obj["foo2"] = "bar2" diff --git a/docs/content/en/docs/guides/assets/tasks.md_4.yaml b/docs/content/en/docs/guides/assets/tasks.md_4.yaml new file mode 100644 index 00000000000..41074844174 --- /dev/null +++ b/docs/content/en/docs/guides/assets/tasks.md_4.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: deno-demo-secret + namespace: default +type: Opaque +data: + SECURE_DATA: YmFyCg== # base64 encoded string, e.g. 'bar' diff --git a/docs/content/en/docs/guides/assets/tasks.md_5.yaml b/docs/content/en/docs/guides/assets/tasks.md_5.yaml new file mode 100644 index 00000000000..589e3cd9d00 --- /dev/null +++ b/docs/content/en/docs/guides/assets/tasks.md_5.yaml @@ -0,0 +1,16 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnTaskDefinition +metadata: + name: deployment-hello + namespace: "default" +spec: + function: + secureParameters: + secret: deno-demo-secret + inline: + code: | + console.log("Deployment Hello Task has been executed"); + + let foo = Deno.env.get('SECURE_DATA'); + console.log(foo); + Deno.exit(0); diff --git a/docs/content/en/docs/guides/auto-app-discovery.md b/docs/content/en/docs/guides/auto-app-discovery.md index c1e1b04a36b..4332003bcb9 100644 --- a/docs/content/en/docs/guides/auto-app-discovery.md +++ b/docs/content/en/docs/guides/auto-app-discovery.md @@ -19,11 +19,7 @@ kubectl get keptnworkloadversion -n podtato-kubectl -w The generated `KeptnApp` file includes `metadata` that names this `KeptnApp` and identifies the Namespace where it resides. -```yaml -metadata: - name: simpleapp - namespace: simplenode-dev -``` +{% include "auto-app-discovery.md_1.yaml" %} It also includes a `spec.workloads` list that defines the workloads to be included. @@ -41,70 +37,12 @@ Note that: 1. The `Deployment` workloads are annotated appropriately. This example does not use other workloads. -```yaml -apiVersion: v1 -kind: Namespace -metadata: - name: podtato-kubectl - annotations: - keptn.sh/lifecycle-toolkit: "enabled" - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: podtato-head-frontend - namespace: podtato-kubectl -spec: - template: - metadata: - labels: - app.kubernetes.io/name: podtato-head-frontend - app.kubernetes.io/part-of: podtato-head - app.kubernetes.io/version: 0.1.0 - spec: - containers: - - name: podtato-head-frontend - image: podtato-head-frontend ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: podtato-head-hat - namespace: podtato-kubectl -spec: - replicas: 1 - template: - metadata: - labels: - app.kubernetes.io/name: podtato-head-hat - app.kubernetes.io/part-of: podtato-head - app.kubernetes.io/version: 0.1.1 - spec: - containers: - - name: podtato-head-hat - image: podtato-head-hat -``` +{% include "auto-app-discovery.md_2.yaml" %} Applying these resources results in the creation of the following `KeptnApp` resource: -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnApp -metadata: - name: podtato-head - namespace: podtato-kubectl - annotations: - app.kubernetes.io/managed-by: "keptn" -spec: - version: "" - workloads: - - name: podtato-head-frontend - version: 0.1.0 - - name: podtato-head-hat - version: 1.1.1 -``` +{% include "auto-app-discovery.md_3.yaml" %} With the `KeptnApp` resource created, you get observability of your application's deployments diff --git a/docs/content/en/docs/guides/evaluatemetrics.md b/docs/content/en/docs/guides/evaluatemetrics.md index 6fb0688ff2e..52a446c6962 100644 --- a/docs/content/en/docs/guides/evaluatemetrics.md +++ b/docs/content/en/docs/guides/evaluatemetrics.md @@ -72,33 +72,12 @@ For example, the `KeptnMetricProvider` resource for a Prometheus data source that does not use a secret could look like: -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: KeptnMetricsProvider -metadata: - name: prometheus-provider - namespace: simplenode-dev -spec: - type: prometheus - targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" -``` +{% include "evaluatemetrics.md_1.yaml" %} The `KeptnMetricProvider` resource for a Dynatrace provider that uses a secret could look like: -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: KeptnMetricsProvider -metadata: - name: dynatrace-provider - namespace: podtato-kubectl -spec: - type: dynatrace - targetServer: "" - secretKeyRef: - name: dt-api-token - key: DT_TOKEN -``` +{% include "evaluatemetrics.md_2.yaml" %} ### Define KeptnMetric information @@ -121,29 +100,7 @@ The [keptn-metric.yaml](https://github.com/keptn-sandbox/klt-on-k3s-with-argocd/blob/main/simplenode-dev/keptn-metric.yaml) file for our example looks like: -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: Keptnmetric -metadata: - name: available-cpus - namespace: simplenode-dev -spec: - provider: - name: dev-prometheus - query: "sum(kube_node_status_capacity{resources`cpu`})" - fetchIntervalSeconds: 10 ---- -apiVersion: metrics.keptn.sh/v1beta1 -kind: Keptnmetric -metadata: - name: availability-slo - namespace: simplenode-dev -spec: - provider: - name: dev-dynatrace - query: "func:slo.availability_simplenodeservice" - fetchIntervalSeconds: 10 -``` +{% include "evaluatemetrics.md_3.yaml" %} Note the following: @@ -254,16 +211,4 @@ In other words, the span is The default value is set to be `5m` if the `range.interval` is not set. -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: KeptnMetric -metadata: - name: good-metric -spec: - provider: - name: my-provider - query: "sum(kube_pod_container_resource_limits{resource='cpu'})" - fetchIntervalSeconds: 10 - range: - interval: "3m" -``` +{% include "evaluatemetrics.md_4.yaml" %} diff --git a/docs/content/en/docs/guides/integrate.md b/docs/content/en/docs/guides/integrate.md index ab2f9729649..bf6b3d58165 100644 --- a/docs/content/en/docs/guides/integrate.md +++ b/docs/content/en/docs/guides/integrate.md @@ -67,22 +67,13 @@ resources for the version it detects. The basic keptn.sh keys that can be used for annotations or labels are: -```yaml -keptn.sh/workload: myAwesomeWorkload -keptn.sh/version: myAwesomeWorkloadVersion -keptn.sh/app: myAwesomeAppName -keptn.sh/container: myAwesomeContainer -``` +{% include "integrate.md_1.yaml" %} Alternatively, you can use Kubernetes keys for annotations or labels. These are part of the Kubernetes [Recommended Labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/): -```yaml -app.kubernetes.io/name: myAwesomeWorkload -app.kubernetes.io/version: myAwesomeWorkloadVersion -app.kubernetes.io/part-of: myAwesomeAppName -``` +{% include "integrate.md_2.yaml" %} These keys are defined as: @@ -224,12 +215,7 @@ you must manually edit the YAML file to add them. Specify one of the following annotations/labels for each evaluation or task you want to execute: -```yaml -keptn.sh/pre-deployment-evaluations: <`EvaluationDefinition`-name> -keptn.sh/pre-deployment-tasks: <`TaskDefinition`-name> -keptn.sh/post-deployment-evaluations: <`EvaluationDefinition`-name> -keptn.sh/post-deployment-tasks: <`TaskDefinition`-name> -``` +{% include "integrate.md_3.yaml" %} The value of these annotations corresponds to the name of Keptn [resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) diff --git a/docs/content/en/docs/guides/restart-application-deployment.md b/docs/content/en/docs/guides/restart-application-deployment.md index aff0111b4ba..3e935f9d62b 100644 --- a/docs/content/en/docs/guides/restart-application-deployment.md +++ b/docs/content/en/docs/guides/restart-application-deployment.md @@ -26,70 +26,7 @@ to enter their respective deployment phases. To illustrate this, consider the following example: -```yaml -apiVersion: v1 -kind: Namespace -metadata: - name: restartable-apps - annotations: - keptn.sh/lifecycle-toolkit: "enabled" ---- -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnApp -metadata: - name: podtato-head - namespace: restartable-apps -spec: - version: "0.1.1" - revision: 1 - workloads: - - name: podtato-head-entry - version: "0.1.2" - preDeploymentTasks: - - pre-deployment-check ---- -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTaskDefinition -metadata: - name: pre-deployment-check - namespace: restartable-apps -spec: - function: - inline: - code: | - console.error("I failed") - process.exit(1) ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: podtato-head-entry - namespace: restartable-apps - labels: - app: podtato-head -spec: - selector: - matchLabels: - component: podtato-head-entry - template: - metadata: - labels: - component: podtato-head-entry - keptn.sh/workload: podtato-head-entry - keptn.sh/app: podtato-head - keptn.sh/version: "0.1.2" - spec: - terminationGracePeriodSeconds: 5 - containers: - - name: server - image: ghcr.io/podtato-head/entry:0.2.7 - imagePullPolicy: Always - ports: - - containerPort: 9000 - env: - - name: PODTATO_PORT - value: "9000" -``` +{% include "restart-application-deployment.md_1.yaml" %} In this example, the `KeptnApp` executes a pre-deployment check which clearly fails because of the `pre-deployment-check` task, @@ -129,18 +66,7 @@ kubectl -n restartable-apps edit keptntaskdefinitions.lifecycle.keptn.sh pre-dep Modify the manifest to look like this: -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTaskDefinition -metadata: - name: pre-deployment-check - namespace: restartable-apps -spec: - function: - inline: - code: | - console.error("Success") -``` +{% include "restart-application-deployment.md_2.yaml" %} To restart the deployment of our `KeptnApplication`, edit the manifest: @@ -151,21 +77,7 @@ kubectl -n restartable-apps edit keptnapps.lifecycle.keptn.sh podtato-head Increment the value of the `spec.revision` field by one: -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnApp -metadata: - name: podtato-head - namespace: restartable-apps -spec: - version: "0.1.1" - revision: 2 # Increased this value from 1 to 2 - workloads: - - name: podtato-head-entry - version: "0.1.2" - preDeploymentTasks: - - pre-deployment-check -``` +{% include "restart-application-deployment.md_3.yaml" %} After those changes have been made, you will notice a new revision of the `podtato-head` `KeptnAppVersion`: diff --git a/docs/content/en/docs/guides/tasks.md b/docs/content/en/docs/guides/tasks.md index 692828650b8..3f517855ee5 100644 --- a/docs/content/en/docs/guides/tasks.md +++ b/docs/content/en/docs/guides/tasks.md @@ -192,21 +192,7 @@ while the `secret` parameters refer to a single Kubernetes `secret`. Consider the following example: -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTaskDefinition -metadata: - name: slack-notification-dev -spec: - function: - functionRef: - name: slack-notification - parameters: - map: - textMessage: "This is my configuration" - secureParameters: - secret: slack-token -``` +{% include "tasks.md_1.yaml" %} Note the following about using parameters with functions: @@ -234,21 +220,7 @@ execute this command: kubectl create secret generic my-secret --from-literal=SECURE_DATA=foo ``` -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnTaskDefinition -metadata: - name: dummy-task - namespace: "default" -spec: - function: - secureParameters: - secret: my-secret - inline: - code: | - let secret_text = Deno.env.get("SECURE_DATA"); - // secret_text = "foo" -``` +{% include "tasks.md_2.yaml" %} To pass multiple variables you can create a Kubernetes secret using a JSON string: @@ -258,23 +230,7 @@ kubectl create secret generic my-secret \ --from-literal=SECURE_DATA="{\"foo\": \"bar\", \"foo2\": \"bar2\"}" ``` -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnTaskDefinition -metadata: - name: dummy-task - namespace: "default" -spec: - function: - secureParameters: - secret: my-secret - inline: - code: | - let secret_text = Deno.env.get("SECURE_DATA"); - let secret_text_obj = JSON.parse(secret_text); - // secret_text_obj["foo"] = "bar" - // secret_text_obj["foo2"] = "bar2" -``` +{% include "tasks.md_3.yaml" %} ### Pass secrets to a function @@ -291,34 +247,8 @@ For example, if you have a task function that should make use of secret data, you must first ensure that the secret containing the `SECURE_DATA` key exists For example: -```yaml -apiVersion: v1 -kind: Secret -metadata: - name: deno-demo-secret - namespace: default -type: Opaque -data: - SECURE_DATA: YmFyCg== # base64 encoded string, e.g. 'bar' -``` +{% include "tasks.md_4.yaml" %} Then, you can make use of that secret as follows: -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnTaskDefinition -metadata: - name: deployment-hello - namespace: "default" -spec: - function: - secureParameters: - secret: deno-demo-secret - inline: - code: | - console.log("Deployment Hello Task has been executed"); - - let foo = Deno.env.get('SECURE_DATA'); - console.log(foo); - Deno.exit(0); -``` +{% include "tasks.md_5.yaml" %} diff --git a/docs/content/en/docs/installation/_index.md b/docs/content/en/docs/installation/_index.md index 2c6a23dfb60..81a417a8318 100644 --- a/docs/content/en/docs/installation/_index.md +++ b/docs/content/en/docs/installation/_index.md @@ -78,14 +78,7 @@ you must enable Keptn in your via annotations. For example, for the `testy-test` namespace: -```yaml -apiVersion: v1 -kind: Namespace -metadata: - name: testy-test - annotations: - keptn.sh/lifecycle-toolkit: "enabled" # this tells Keptn to watch the namespace -``` +{% include "_index.md_1.yaml" %} Some helpful hints: diff --git a/docs/content/en/docs/installation/assets/_index.md_1.yaml b/docs/content/en/docs/installation/assets/_index.md_1.yaml new file mode 100644 index 00000000000..edd860abf89 --- /dev/null +++ b/docs/content/en/docs/installation/assets/_index.md_1.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: testy-test + annotations: + keptn.sh/lifecycle-toolkit: "enabled" # this tells Keptn to watch the namespace diff --git a/docs/content/en/docs/installation/assets/tips-tricks.md_1.yaml b/docs/content/en/docs/installation/assets/tips-tricks.md_1.yaml new file mode 100644 index 00000000000..daaf5122de4 --- /dev/null +++ b/docs/content/en/docs/installation/assets/tips-tricks.md_1.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: simplenode-dev + annotations: + keptn.sh/lifecycle-toolkit: "enabled" diff --git a/docs/content/en/docs/installation/configuration/assets/cert-manager.md_1.yaml b/docs/content/en/docs/installation/configuration/assets/cert-manager.md_1.yaml new file mode 100644 index 00000000000..f698c4fe885 --- /dev/null +++ b/docs/content/en/docs/installation/configuration/assets/cert-manager.md_1.yaml @@ -0,0 +1,23 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: keptn-certs + namespace: +spec: + dnsNames: + - lifecycle-webhook-service..svc + - lifecycle-webhook-service..svc.cluster.local + - metrics-webhook-service..svc + - metrics-webhook-service..svc.cluster.local + issuerRef: + kind: Issuer + name: keptn-selfsigned-issuer + secretName: keptn-certs +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: keptn-selfsigned-issuer + namespace: +spec: + selfSigned: {} diff --git a/docs/content/en/docs/installation/configuration/cert-manager.md b/docs/content/en/docs/installation/configuration/cert-manager.md index ca5ba746dc9..ccd3fda060b 100644 --- a/docs/content/en/docs/installation/configuration/cert-manager.md +++ b/docs/content/en/docs/installation/configuration/cert-manager.md @@ -33,31 +33,7 @@ The steps are: These are the CRs for `cert-manager.io` to be applied to your cluster: -```yaml -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: keptn-certs - namespace: -spec: - dnsNames: - - lifecycle-webhook-service..svc - - lifecycle-webhook-service..svc.cluster.local - - metrics-webhook-service..svc - - metrics-webhook-service..svc.cluster.local - issuerRef: - kind: Issuer - name: keptn-selfsigned-issuer - secretName: keptn-certs ---- -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: keptn-selfsigned-issuer - namespace: -spec: - selfSigned: {} -``` +{% include "cert-manager.md_1.yaml" %} Note the following about these fields: diff --git a/docs/content/en/docs/installation/tips-tricks.md b/docs/content/en/docs/installation/tips-tricks.md index 6e16d4ec7e8..2628b04f84b 100644 --- a/docs/content/en/docs/installation/tips-tricks.md +++ b/docs/content/en/docs/installation/tips-tricks.md @@ -81,14 +81,7 @@ To enable Keptn, annotate the appropriate `Namespace` resource(s). For example, for the `simplenode-dev` namespace, the annotation looks like this: -```yaml -apiVersion: v1 -kind: Namespace -metadata: - name: simplenode-dev - annotations: - keptn.sh/lifecycle-toolkit: "enabled" -``` +{% include "tips-tricks.md_1.yaml" %} You see the annotation line `keptn.sh/lifecycle-toolkit: "enabled"`. diff --git a/docs/content/en/docs/migrate/assets/metrics-observe.md_1.yaml b/docs/content/en/docs/migrate/assets/metrics-observe.md_1.yaml new file mode 100644 index 00000000000..a27fe86b5b6 --- /dev/null +++ b/docs/content/en/docs/migrate/assets/metrics-observe.md_1.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 + items: + - apiVersion: metrics.keptn.sh/v1beta1 + kind: Analysis + metadata: + creationTimestamp: "2023-09-14T11:00:01Z" + generation: 4 + name: analysis-sample-1 + namespace: keptn-lifecycle-poc + resourceVersion: "71327" + uid: 1c5e043d-ed5e-42f8-ba32-b7af54b55c35 + spec: + analysisDefinition: + name: my-project-ad + namespace: keptn-lifecycle-poc + args: + ns: keptn-system + project: my-project + timeframe: + from: "2023-09-14T11:20:19Z" + to: "2023-09-14T11:22:19Z" + status: + pass: true + raw: '{"objectiveResults":[{"result":{"failResult":{"operator":{"greaterThan":{"fixedValue":"50"}}},"warnResult":{"operator":{"greaterThan":{"fixedValue":"50"}}},"pass":true},"value":7,"score":1}],"totalScore":1,"maximumScore":1,"pass":true}' + kind: List + metadata: + resourceVersion: "" diff --git a/docs/content/en/docs/migrate/assets/metrics-observe.md_2.yaml b/docs/content/en/docs/migrate/assets/metrics-observe.md_2.yaml new file mode 100644 index 00000000000..f54825841d0 --- /dev/null +++ b/docs/content/en/docs/migrate/assets/metrics-observe.md_2.yaml @@ -0,0 +1,10 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: AnalysisValueTemplate +metadata: + creationTimestamp: null + name: response-time +spec: + provider: + name: my-prometheus-provider + namespace: keptn-lifecycle-poc + query: response_time{label="{{.service}}"} diff --git a/docs/content/en/docs/migrate/assets/metrics-observe.md_3.yaml b/docs/content/en/docs/migrate/assets/metrics-observe.md_3.yaml new file mode 100644 index 00000000000..4eec463fc0d --- /dev/null +++ b/docs/content/en/docs/migrate/assets/metrics-observe.md_3.yaml @@ -0,0 +1,14 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: Analysis +metadata: + name: analysis-sample-1 + namespace: keptn-lifecycle-poc +spec: + timeframe: + from: 2023-09-14T11:20:19Z + to: 2023-09-14T11:22:19Z + args: + "service": "my-service" + analysisDefinition: + name: my-project-ad + namespace: keptn-lifecycle-poc diff --git a/docs/content/en/docs/migrate/metrics-observe.md b/docs/content/en/docs/migrate/metrics-observe.md index 80c0b426a87..d0a50a7e404 100644 --- a/docs/content/en/docs/migrate/metrics-observe.md +++ b/docs/content/en/docs/migrate/metrics-observe.md @@ -245,35 +245,7 @@ The process is: kubectl get analysis -n keptn-lifecycle-poc -oyaml ``` - ```yaml - apiVersion: v1 - items: - - apiVersion: metrics.keptn.sh/v1beta1 - kind: Analysis - metadata: - creationTimestamp: "2023-09-14T11:00:01Z" - generation: 4 - name: analysis-sample-1 - namespace: keptn-lifecycle-poc - resourceVersion: "71327" - uid: 1c5e043d-ed5e-42f8-ba32-b7af54b55c35 - spec: - analysisDefinition: - name: my-project-ad - namespace: keptn-lifecycle-poc - args: - ns: keptn-system - project: my-project - timeframe: - from: "2023-09-14T11:20:19Z" - to: "2023-09-14T11:22:19Z" - status: - pass: true - raw: '{"objectiveResults":[{"result":{"failResult":{"operator":{"greaterThan":{"fixedValue":"50"}}},"warnResult":{"operator":{"greaterThan":{"fixedValue":"50"}}},"pass":true},"value":7,"score":1}],"totalScore":1,"maximumScore":1,"pass":true}' - kind: List - metadata: - resourceVersion: "" - ``` + {% include "metrics-observe.md_1.yaml" %} As can be seen in the yaml above, the `status.raw` property contains the detailed breakdown @@ -303,39 +275,13 @@ to insert a variable as a placeholder (for example, in this case, `{{.service}}`) for the service identifier in the prometheus query: -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: AnalysisValueTemplate -metadata: - creationTimestamp: null - name: response-time -spec: - provider: - name: my-prometheus-provider - namespace: keptn-lifecycle-poc - query: response_time{label="{{.service}}"} -``` +{% include "metrics-observe.md_2.yaml" %} Then, if an analysis for that particular service should be performed, the name of the service can be passed to the analysis using the `spec.args` property from the `Analysis` resource: -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: Analysis -metadata: - name: analysis-sample-1 - namespace: keptn-lifecycle-poc -spec: - timeframe: - from: 2023-09-14T11:20:19Z - to: 2023-09-14T11:22:19Z - args: - "service": "my-service" - analysisDefinition: - name: my-project-ad - namespace: keptn-lifecycle-poc -``` +{% include "metrics-observe.md_3.yaml" %} This way, you can use the same `AnalysisDefinition` and `AnalysisValueTemplates` for multiple services within the same project. diff --git a/docs/content/en/docs/reference/crd-reference/analysis.md b/docs/content/en/docs/reference/crd-reference/analysis.md index 26537b37173..a8737e82280 100644 --- a/docs/content/en/docs/reference/crd-reference/analysis.md +++ b/docs/content/en/docs/reference/crd-reference/analysis.md @@ -13,26 +13,7 @@ that are used in the `AnalysisDefinition` query. ## Synopsis -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: Analysis -metadata: - name: analysis-sample -spec: - timeframe: from: to: | `recent ` - args: - : - : - ... - analysisDefinition: - name: - state: Completed | Progressing -``` +{% include "analysis.md_1.yaml" %} ## Fields diff --git a/docs/content/en/docs/reference/crd-reference/analysisdefinition.md b/docs/content/en/docs/reference/crd-reference/analysisdefinition.md index 54fdeeb57a6..f40c5f39324 100644 --- a/docs/content/en/docs/reference/crd-reference/analysisdefinition.md +++ b/docs/content/en/docs/reference/crd-reference/analysisdefinition.md @@ -9,30 +9,7 @@ list of Service Level Objectives (SLOs) for an `Analysis`. ## Synopsis -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: AnalysisDefinition -metadata: - name: - namespace: -spec: - objectives: - - analysisValueTemplateRef: - name: - namespace: - target: - failure | warning: - : - : | - : - lowbound: - highBound: - weight: - keyObjective: - totalScore: - passPercentage: 90 - warningPercentage: 75 -``` +{% include "analysisdefinition.md_1.yaml" %} ## Fields @@ -118,36 +95,7 @@ Each of these objectives must specify: ## Example -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: AnalysisDefinition -metadata: - name: ed-my-proj-dev-svc1 - namespace: keptn-system -spec: - objectives: - - analysisValueTemplateRef: - name: response-time-p95 - namespace: keptn-system - target: - failure: - : - fixedValue: integer> | - inRange: | notInRange: - lowBound: - highBound: - warning: - : - fixedValue: integer> | - inRange: | notInRange: - lowBound: - highBound: - weight: - keyObjective: - totalScore: - passPercentage: - warningPercentage: -``` +{% include "analysisdefinition.md_2.yaml" %} For an example of how to implement the Keptn Analysis feature, see the [Analysis](../../guides/slo.md) diff --git a/docs/content/en/docs/reference/crd-reference/analysisvaluetemplate.md b/docs/content/en/docs/reference/crd-reference/analysisvaluetemplate.md index a24d559235c..976c6cae480 100644 --- a/docs/content/en/docs/reference/crd-reference/analysisvaluetemplate.md +++ b/docs/content/en/docs/reference/crd-reference/analysisvaluetemplate.md @@ -13,17 +13,7 @@ of multiple types of data provider. ## Synopsis -```yaml -apiVersion: metrics.keptn.sh/v1beta1 -kind: AnalysisValueTemplate -metadata: - name: response-time-p95 - namespace: -spec: - provider: - name: prometheus | dynatrace | dql | datadog - query: -``` +{% include "analysisvaluetemplate.md_1.yaml" %} ## Fields diff --git a/docs/content/en/docs/reference/crd-reference/app.md b/docs/content/en/docs/reference/crd-reference/app.md index e4b2b614d27..e149874c22f 100644 --- a/docs/content/en/docs/reference/crd-reference/app.md +++ b/docs/content/en/docs/reference/crd-reference/app.md @@ -19,29 +19,7 @@ It contains information about: ## Synopsis -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnApp -metadata: - name: - namespace: -spec: - version: "x.y" - revision: x - workloads: - - name: - version: - - name: - version: - preDeploymentTasks: - - - postDeploymentTasks: - - - preDeploymentEvaluations: - - - postDeploymentEvaluations: - - -``` +{% include "app.md_1.yaml" %} ## Fields @@ -141,24 +119,7 @@ you can code them all into a single `KeptnTaskDefinition`. ## Example -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnApp -metadata: - name: podtato-head - namespace: podtato-kubectl -spec: - version: "latest" - workloads: - - name: podtato-head-left-arm - version: "my_vers12.5" - - name: podtato-head-left-leg - version: "my_v24" - postDeploymentTasks: - - post-deployment-hello - preDeploymentEvaluations: - - my-prometheus-definition -``` +{% include "app.md_2.yaml" %} ## Files diff --git a/docs/content/en/docs/reference/crd-reference/assets/analysis.md_1.yaml b/docs/content/en/docs/reference/crd-reference/assets/analysis.md_1.yaml new file mode 100644 index 00000000000..3f1c5955272 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/analysis.md_1.yaml @@ -0,0 +1,18 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: Analysis +metadata: + name: analysis-sample +spec: + timeframe: from: to: | `recent ` + args: + : + : + ... + analysisDefinition: + name: + state: Completed | Progressing diff --git a/docs/content/en/docs/reference/crd-reference/assets/analysisdefinition.md_1.yaml b/docs/content/en/docs/reference/crd-reference/assets/analysisdefinition.md_1.yaml new file mode 100644 index 00000000000..5962e239aaf --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/analysisdefinition.md_1.yaml @@ -0,0 +1,22 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: AnalysisDefinition +metadata: + name: + namespace: +spec: + objectives: + - analysisValueTemplateRef: + name: + namespace: + target: + failure | warning: + : + : | + : + lowbound: + highBound: + weight: + keyObjective: + totalScore: + passPercentage: 90 + warningPercentage: 75 diff --git a/docs/content/en/docs/reference/crd-reference/assets/analysisdefinition.md_2.yaml b/docs/content/en/docs/reference/crd-reference/assets/analysisdefinition.md_2.yaml new file mode 100644 index 00000000000..a4e44bb3288 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/analysisdefinition.md_2.yaml @@ -0,0 +1,28 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: AnalysisDefinition +metadata: + name: ed-my-proj-dev-svc1 + namespace: keptn-system +spec: + objectives: + - analysisValueTemplateRef: + name: response-time-p95 + namespace: keptn-system + target: + failure: + : + fixedValue: integer> | + inRange: | notInRange: + lowBound: + highBound: + warning: + : + fixedValue: integer> | + inRange: | notInRange: + lowBound: + highBound: + weight: + keyObjective: + totalScore: + passPercentage: + warningPercentage: diff --git a/docs/content/en/docs/reference/crd-reference/assets/analysisvaluetemplate.md_1.yaml b/docs/content/en/docs/reference/crd-reference/assets/analysisvaluetemplate.md_1.yaml new file mode 100644 index 00000000000..94a133da8a5 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/analysisvaluetemplate.md_1.yaml @@ -0,0 +1,9 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: AnalysisValueTemplate +metadata: + name: response-time-p95 + namespace: +spec: + provider: + name: prometheus | dynatrace | dql | datadog + query: diff --git a/docs/content/en/docs/reference/crd-reference/assets/app.md_1.yaml b/docs/content/en/docs/reference/crd-reference/assets/app.md_1.yaml new file mode 100644 index 00000000000..3d365e2949a --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/app.md_1.yaml @@ -0,0 +1,21 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnApp +metadata: + name: + namespace: +spec: + version: "x.y" + revision: x + workloads: + - name: + version: + - name: + version: + preDeploymentTasks: + - + postDeploymentTasks: + - + preDeploymentEvaluations: + - + postDeploymentEvaluations: + - diff --git a/docs/content/en/docs/reference/crd-reference/assets/app.md_2.yaml b/docs/content/en/docs/reference/crd-reference/assets/app.md_2.yaml new file mode 100644 index 00000000000..4416ee049e1 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/app.md_2.yaml @@ -0,0 +1,16 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnApp +metadata: + name: podtato-head + namespace: podtato-kubectl +spec: + version: "latest" + workloads: + - name: podtato-head-left-arm + version: "my_vers12.5" + - name: podtato-head-left-leg + version: "my_v24" + postDeploymentTasks: + - post-deployment-hello + preDeploymentEvaluations: + - my-prometheus-definition diff --git a/docs/content/en/docs/reference/crd-reference/assets/config.md_1.yaml b/docs/content/en/docs/reference/crd-reference/assets/config.md_1.yaml new file mode 100644 index 00000000000..8d6feb64458 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/config.md_1.yaml @@ -0,0 +1,8 @@ +apiVersion: options.keptn.sh/v?alpha? +kind: KeptnConfig +metadata: + name: +spec: + OTelCollectorUrl: '' + keptnAppCreationRequestTimeoutSeconds: <#-seconds> + cloudEventsEndpoint: diff --git a/docs/content/en/docs/reference/crd-reference/assets/config.md_2.yaml b/docs/content/en/docs/reference/crd-reference/assets/config.md_2.yaml new file mode 100644 index 00000000000..74971da17a9 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/config.md_2.yaml @@ -0,0 +1,8 @@ +apiVersion: options.keptn.sh/v1alpha2 +kind: KeptnConfig +metadata: + name: keptn-config +spec: + OTelCollectorUrl: 'otel-collector:4317' + keptnAppCreationRequestTimeoutSeconds: 40 + cloudEventsEndpoint: 'http://endpoint.com' diff --git a/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_1.yaml b/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_1.yaml new file mode 100644 index 00000000000..c190e4dc301 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_1.yaml @@ -0,0 +1,10 @@ +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnEvaluationDefinition +metadata: + name: +spec: + objectives: + - evaluationTarget: "" + keptnMetricRef: + name: available-cpus + namespace: some-namespace diff --git a/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_2.yaml b/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_2.yaml new file mode 100644 index 00000000000..24862c6d1aa --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_2.yaml @@ -0,0 +1,16 @@ +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" diff --git a/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_3.yaml b/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_3.yaml new file mode 100644 index 00000000000..dd16b83a9d9 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/evaluationdefinition.md_3.yaml @@ -0,0 +1,13 @@ +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnEvaluationDefinition +metadata: + name: +spec: + source: prometheus | dynatrace | datadog + objectives: + - name: query-1 + query: "xxxx" + evaluationTarget: <20 + - name: query-2 + query: "yyyy" + evaluationTarget: >4 diff --git a/docs/content/en/docs/reference/crd-reference/assets/metric.md_1.yaml b/docs/content/en/docs/reference/crd-reference/assets/metric.md_1.yaml new file mode 100644 index 00000000000..bdf0082f1d7 --- /dev/null +++ b/docs/content/en/docs/reference/crd-reference/assets/metric.md_1.yaml @@ -0,0 +1,18 @@ +apiVersion: metrics.keptn.sh/v1beta1 +kind: KeptnMetric +metadata: + name: + namespace: +spec: + provider: + name: "" + query: "" + fetchIntervalSeconds: <#-seconds> + range: + interval: "" + status: + properties: + value: + rawValue: + errMsg: + lastUpdated: