Skip to content

Commit

Permalink
with newline
Browse files Browse the repository at this point in the history
Signed-off-by: David Ahmadov <[email protected]>
  • Loading branch information
ahmedavid committed Dec 6, 2023
1 parent 5d0aad0 commit eb985a7
Show file tree
Hide file tree
Showing 97 changed files with 1,140 additions and 1,213 deletions.
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: lifecycle.keptn.sh/v1alpha3
kind: KeptnTaskDefinition
metadata:
name: notify
spec:
function:
inline:
code: |
<javascript code>
secureParameters:
secret: slack-notification
28 changes: 2 additions & 26 deletions docs/content/en/docs/core-concepts/usecase-orchestrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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: |
<javascript code>
secureParameters:
secret: slack-notification
```
{% include "usecase-orchestrate.md_2.yaml" %}

The code to be executed is expressed as a
[Deno](https://deno.com)
Expand Down
Original file line number Diff line number Diff line change
@@ -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" }'
]
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
...
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions docs/content/en/docs/getting-started/assets/metrics.md_1.yaml
Original file line number Diff line number Diff line change
@@ -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"
11 changes: 11 additions & 0 deletions docs/content/en/docs/getting-started/assets/metrics.md_2.yaml
Original file line number Diff line number Diff line change
@@ -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
...
21 changes: 21 additions & 0 deletions docs/content/en/docs/getting-started/assets/metrics.md_3.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta2/namespaces/<namespace>/keptnmetrics.metrics.sh/<metric-name>/<metric-name>"
23 changes: 23 additions & 0 deletions docs/content/en/docs/getting-started/assets/metrics.md_5.yaml
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: keptndemo
annotations:
keptn.sh/lifecycle-toolkit: enabled
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: jaeger
spec:
strategy: allInOne
Original file line number Diff line number Diff line change
@@ -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
}
]
}
Original file line number Diff line number Diff line change
@@ -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']
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: lifecycle.keptn.sh/v1alpha3
kind: KeptnApp
metadata:
name: <app-name>
namespace: <app-namespace>
spec:
version: "x.y"
revision: x
workloads:
- name: <workload1-name>
version: <version-string>
- name: <workload2-name>
version: <version-string>
preDeploymentTasks:
- <list of tasks>
postDeploymentTasks:
- <list of tasks>
preDeploymentEvaluations:
- <list of evaluations>
postDeploymentEvaluations:
- <list of evaluations>
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit eb985a7

Please sign in to comment.