Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add Evaluation instructions #190

Merged
merged 18 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/observability/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LFC_NAMESPACE ?= keptn-lifecycle-controller-system
PODTATO_NAMESPACE ?= podtato-kubectl

.PHONY: install
install:
install:undeploy-podtatohead
@echo "-----------------------------------"
@echo "Create Namespace and install Jaeger"
@echo "-----------------------------------"
Expand Down Expand Up @@ -91,7 +91,7 @@ uninstall:
deploy-podtatohead:
kubectl create namespace "$(PODTATO_NAMESPACE)" --dry-run=client -o yaml | kubectl apply -f -
kubectl annotate namespace "$(PODTATO_NAMESPACE)" keptn.sh/lifecycle-controller=enabled --overwrite
kubectl apply -f ../podtatohead-deployment/.
kubectl apply -f ./assets/podtatohead-deployment-evaluation/.
kubectl wait --for=condition=available deployment/podtato-head-entry -n podtato-kubectl --timeout=120s
@echo "Watch Workload Deployment Progress: kubectl get keptnworkloadinstances -n podtato-kubectl -w"

Expand Down
1 change: 1 addition & 0 deletions examples/observability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

In this example, we will show you an example configuration for enabling the operator to send OpenTelemetry traces and metrics to the [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector).
The Collector will then be used to forward the gathered data to [Jaeger](https://www.jaegertracing.io) and [Prometheus](https://prometheus.io).
The application deployed uses an example of pre-Deployment Evaluation based on prometheus metrics.
RealAnna marked this conversation as resolved.
Show resolved Hide resolved

# TL;DR
* You can install the whole demo using: `make install`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/slack-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Create Secret for Slack here
RealAnna marked this conversation as resolved.
Show resolved Hide resolved

```
kubectl create secret generic slack-notification --from-literal=SECURE_DATA='{"slack_hook":"<WebHook>","text":"Deployed PodTatoHead Application"}' -n podtato-kubectl -oyaml --dry-run > slack-secret.yaml
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnApp
metadata:
name: podtato-head
namespace: podtato-kubectl
spec:
version: "1.3"
workloads:
- name: podtato-head-left-arm
version: 0.1.0
- name: podtato-head-left-leg
version: 0.1.0
- name: podtato-head-entry
version: 0.1.0
- name: podtato-head-right-arm
version: 0.1.0
- name: podtato-head-left-arm
version: 0.1.0
- name: podtato-head-hat
version: 0.1.0
postDeploymentTasks:
- post-deployment-hello
preDeploymentEvaluations: #Comment out this two lines if you do not have a prometheus installation
- my-prometheus-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnTaskDefinition
metadata:
name: check-entry-service
namespace: podtato-kubectl
spec:
function:
httpRef:
url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/functions-runtime/samples/ts/http.ts
parameters:
map:
url: http://podtato-head-entry.podtato-kubectl.svc.cluster.local:9000
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnEvaluationDefinition
metadata:
name: my-prometheus-definition
namespace: podtato-kubectl
spec:
source: prometheus
objectives:
- name: available-cpus
query: "sum(kube_pod_container_resource_limits{resource='cpu'}) - sum(kube_node_status_capacity{resource='cpu'})"
evaluationTarget: ">1" #string: can only be starting with < or >
- name: consumed-memory
query: "sum(kube_node_status_capacity{resource='memory'})"
evaluationTarget: "<1000000000000" #string: can only be starting with < or >

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnEvaluationProvider
metadata:
name: prometheus
namespace: podtato-kubectl
spec:
targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" #string
Loading