Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #42 from keptn/release-0.2.0
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
johannes-b authored Jul 25, 2019
2 parents b6ccdd3 + e95edda commit 8e10609
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 76 deletions.
108 changes: 108 additions & 0 deletions deploy/manifests/dynatrace-service/dynatrace-service-distributors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
## dynatrace-service: sh.keptn.events.deployment-finished
apiVersion: apps/v1
kind: Deployment
metadata:
name: dynatrace-service-deployment-finished-distributor
namespace: keptn
spec:
selector:
matchLabels:
run: distributor
replicas: 1
template:
metadata:
labels:
run: distributor
spec:
containers:
- name: distributor
image: keptn/distributor:0.1.0
ports:
- containerPort: 8080
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "500m"
env:
- name: PUBSUB_URL
value: 'nats://keptn-nats-cluster'
- name: PUBSUB_TOPIC
value: 'sh.keptn.events.deployment-finished'
- name: PUBSUB_RECIPIENT
value: 'dynatrace-service'
---
## dynatrace-service: sh.keptn.events.tests-finished
apiVersion: apps/v1
kind: Deployment
metadata:
name: dynatrace-service-tests-finished-distributor
namespace: keptn
spec:
selector:
matchLabels:
run: distributor
replicas: 1
template:
metadata:
labels:
run: distributor
spec:
containers:
- name: distributor
image: keptn/distributor:0.1.0
ports:
- containerPort: 8080
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "500m"
env:
- name: PUBSUB_URL
value: 'nats://keptn-nats-cluster'
- name: PUBSUB_TOPIC
value: 'sh.keptn.events.tests-finished'
- name: PUBSUB_RECIPIENT
value: 'dynatrace-service'
---
## dynatrace-service: sh.keptn.events.evaluation-done
apiVersion: apps/v1
kind: Deployment
metadata:
name: dynatrace-service-evaluation-done-distributor
namespace: keptn
spec:
selector:
matchLabels:
run: distributor
replicas: 1
template:
metadata:
labels:
run: distributor
spec:
containers:
- name: distributor
image: keptn/distributor:0.1.0
ports:
- containerPort: 8080
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "500m"
env:
- name: PUBSUB_URL
value: 'nats://keptn-nats-cluster'
- name: PUBSUB_TOPIC
value: 'sh.keptn.events.evaluation-done'
- name: PUBSUB_RECIPIENT
value: 'dynatrace-service'
110 changes: 45 additions & 65 deletions deploy/manifests/dynatrace-service/dynatrace-service.yaml
Original file line number Diff line number Diff line change
@@ -1,73 +1,53 @@
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
name: dynatrace-service
namespace: keptn
labels:
serving.knative.dev/visibility: cluster-local
spec:
runLatest:
configuration:
revisionTemplate:
spec:
container:
image: keptn/dynatrace-service:0.1.2
env:
- name: DT_API_TOKEN
valueFrom:
secretKeyRef:
name: dynatrace
key: DT_API_TOKEN
- name: DT_TENANT
valueFrom:
secretKeyRef:
name: dynatrace
key: DT_TENANT
---
apiVersion: eventing.knative.dev/v1alpha1
kind: Subscription
metadata:
name: dynatrace-service-deployment-finished-subscription
namespace: keptn
spec:
channel:
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
name: deployment-finished
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
kind: Service
name: dynatrace-service
---
apiVersion: eventing.knative.dev/v1alpha1
kind: Subscription
apiVersion: apps/v1
kind: Deployment
metadata:
name: dynatrace-service-tests-finished-subscription
name: dynatrace-service
namespace: keptn
spec:
channel:
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
name: tests-finished
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
kind: Service
name: dynatrace-service
selector:
matchLabels:
run: dynatrace-service
replicas: 1
template:
metadata:
labels:
run: dynatrace-service
spec:
containers:
- name: dynatrace-service
image: keptn/dynatrace-service:0.2.0
ports:
- containerPort: 8080
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "500m"
env:
- name: DT_API_TOKEN
valueFrom:
secretKeyRef:
name: dynatrace
key: DT_API_TOKEN
- name: DT_TENANT
valueFrom:
secretKeyRef:
name: dynatrace
key: DT_TENANT
---
apiVersion: eventing.knative.dev/v1alpha1
kind: Subscription
apiVersion: v1
kind: Service
metadata:
name: dynatrace-service-evaluation-done-subscription
name: dynatrace-service
namespace: keptn
labels:
run: dynatrace-service
spec:
channel:
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
name: evaluation-done
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
kind: Service
name: dynatrace-service
ports:
- port: 8080
protocol: TCP
selector:
run: dynatrace-service
7 changes: 6 additions & 1 deletion deploy/scripts/deployDynatraceCommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function deploy_dt {

# Setup problem notification in Dynatrace
print_info "Set up problem notification in Dynatrace."
KEPTN_DNS=https://$(kubectl get ksvc -n keptn event-broker-ext -o=yaml | yq r - status.domain)
KEPTN_DNS=https://event-broker-ext.keptn.$(kubectl get cm -n keptn keptn-domain -oyaml | yq - r data.app_domain)
KEPTN_API_TOKEN=$(kubectl get secret keptn-api-token -n keptn -o=yaml | yq - r data.keptn-api-token | base64 --decode)
./setupProblemNotification.sh $DT_TENANT $DT_API_TOKEN $KEPTN_DNS $KEPTN_API_TOKEN
verify_install_step $? "Setup of problem notification in Dynatrace failed."
Expand All @@ -56,4 +56,9 @@ function deploy_dt {
print_info "Deploying dynatrace-service"
kubectl apply -f ../manifests/dynatrace-service/dynatrace-service.yaml
verify_kubectl $? "Deploying dynatrace-service failed."
wait_for_deployment_in_namespace "dynatrace-service" "keptn"

kubectl apply -f ../manifests/dynatrace-service/dynatrace-service-distributors.yaml
verify_kubectl $? "Deploying dynatrace-service failed."

}
6 changes: 5 additions & 1 deletion deploy/scripts/deployDynatraceOnOpenshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ print_info "Applying auto tagging rules in Dynatrace done."

# Setup problem notification in Dynatrace
print_info "Set up problem notification in Dynatrace."
KEPTN_DNS=https://$(kubectl get ksvc -n keptn event-broker-ext -o=yaml | yq r - status.domain)
KEPTN_DNS=https://event-broker-ext.keptn.$(kubectl get cm -n keptn keptn-domain -oyaml | yq - r data.app_domain)
KEPTN_API_TOKEN=$(kubectl get secret keptn-api-token -n keptn -o=yaml | yq - r data.keptn-api-token | base64 --decode)
./setupProblemNotification.sh $DT_TENANT $DT_API_TOKEN $KEPTN_DNS $KEPTN_API_TOKEN
verify_install_step $? "Setup of problem notification in Dynatrace failed."
Expand All @@ -54,3 +54,7 @@ verify_kubectl $? "Creating dynatrace secret for keptn services failed."
print_info "Deploying dynatrace-service"
kubectl apply -f ../manifests/dynatrace-service/dynatrace-service.yaml
verify_kubectl $? "Deploying dynatrace-service failed."
wait_for_deployment_in_namespace "dynatrace-service" "keptn"

kubectl apply -f ../manifests/dynatrace-service/dynatrace-service-distributors.yaml
verify_kubectl $? "Deploying dynatrace-service failed."
13 changes: 13 additions & 0 deletions deploy/scripts/uninstallDynatrace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Clean up dynatrace namespace
echo "Uninstalling Dynatrace from cluster"
kubectl delete services,deployments,pods --all -n dynatrace --ignore-not-found
kubectl delete namespace dynatrace --ignore-not-found
kubectl delete secret dynatrace -n keptn --ignore-not-found
echo "Dynatrace uninstalled"

# Deleting CRB
DT_OPERATOR_LATEST_RELEASE=$(curl -s https://api.github.com/repos/dynatrace/dynatrace-oneagent-operator/releases/latest | grep tag_name | cut -d '"' -f 4)
echo "Deleting Cluster Role Binding for Dynatrace Operator $DT_OPERATOR_LATEST_RELEASE"

kubectl delete -f https://raw.githubusercontent.com/Dynatrace/dynatrace-oneagent-operator/$DT_OPERATOR_LATEST_RELEASE/deploy/kubernetes.yaml --ignore-not-found
echo "Cluster Role Binding for Dynatrace Operator deleted"
16 changes: 8 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import (
)

type keptnEvent struct {
Specversion string `json:"specversion"`
Type string `json:"type"`
Source string `json:"source"`
ID string `json:"id"`
Time string `json:"time"`
Datacontenttype string `json:"datacontenttype"`
Shkeptncontext string `json:"shkeptncontext"`
Data struct {
Specversion string `json:"specversion"`
Type string `json:"type"`
Source string `json:"source"`
ID string `json:"id"`
Time string `json:"time"`
Contenttype string `json:"contenttype"`
Shkeptncontext string `json:"shkeptncontext"`
Data struct {
Githuborg string `json:"githuborg"`
Project string `json:"project"`
Teststrategy string `json:"teststrategy"`
Expand Down
10 changes: 10 additions & 0 deletions releasenotes/releasenotes_V0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Release Notes 0.2.0

## New Features
- Change of deployment and service manifest from Knative to Kubernetes resources [#517](https://github.com/keptn/keptn/issues/517)
- Pull operator image for openshift from quay.io [#470](https://github.com/keptn/keptn/issues/470)

## Fixed Issues
- Fixed adherence to cloud events: Changed _datacontenttype_ to _contenttype_ [#405](https://github.com/keptn/keptn/issues/405)

## Known Limitations
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.2
0.2.0

0 comments on commit 8e10609

Please sign in to comment.