This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from keptn/feature/467/merge-master
Release 0.1.2
- Loading branch information
Showing
19 changed files
with
822 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
dynatrace-service | ||
# Binary | ||
./dynatrace-service | ||
|
||
# Auto-generated files | ||
./deploy/manifests/dynatrace/gen/cr* | ||
|
||
# Creds files | ||
deploy/scripts/creds_dt.json | ||
deploy/scripts/*creds*.json | ||
creds_dt.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,71 @@ | ||
# Dynatrace Service | ||
# Dynatrace Service and Dynatrace OneAgent Operator | ||
|
||
This service sends information about the current state of a pipeline run for a service to Dynatrace by sending events for the correlating detected service. | ||
The dynatrace-service sends information about the current state of a pipeline run for a service to Dynatrace by sending events for the correlating detected service. | ||
The service is subscribed to the following keptn events: | ||
|
||
- sh.keptn.events.deployment-finished | ||
- sh.keptn.events.evaluation-done | ||
- sh.keptn.events.tests-finished | ||
|
||
## Installation | ||
## Installation of Dynatrace Service and Dynatrace OneAgent Operator | ||
|
||
To use this service, you must have set up Dynatrace monitoring, as described in the [documentation](https://keptn.sh/docs/0.2.1/monitoring/dynatrace/). | ||
Afterwards, to install the service in your keptn installation checkout or copy the `dynatrace-service.yaml`. | ||
1. Define your credentials by executing the following script: | ||
```console | ||
cd ./deploy/scripts | ||
./defineDynatraceCredentials.sh | ||
``` | ||
When the script asks for your Dynatrace tenant, please enter your tenant according to the appropriate pattern: | ||
- Dynatrace SaaS tenant: `{your-environment-id}.live.dynatrace.com` | ||
- Dynatrace-managed tenant: `{your-domain}/e/{your-environment-id}` | ||
|
||
Then apply the `dynatrace-service.yaml` using `kubectl` to create the Dynatrace service and the subscriptions to the keptn channels. | ||
1. Execute the installation script `deployDynatrace.sh` in the `/deploy/scripts` folder: | ||
```console | ||
./deployDynatrace.sh | ||
``` | ||
When this script is finished, the Dynatrace OneAgent and the dynatrace-service are deployed in your cluster. Execute the following commands to verify the deployment of the dynatrace-service. | ||
|
||
``` | ||
kubectl apply -f dynatrace-service.yaml | ||
``` | ||
```console | ||
kubectl get ksvc dynatrace-service -n keptn | ||
``` | ||
|
||
Expected output: | ||
```console | ||
NAME DOMAIN LATESTCREATED LATESTREADY READY | ||
dynatrace-service dynatrace-service.keptn.svc.cluster.local dynatrace-service-26sm4 dynatrace-service-26sm4 True | ||
``` | ||
|
||
```console | ||
kubectl get subscription -n keptn | grep dynatrace-subscription | ||
``` | ||
|
||
```console | ||
dynatrace-subscription-deployment-finished True | ||
dynatrace-subscription-evaluation-done True | ||
dynatrace-subscription-tests-finished True | ||
``` | ||
|
||
When the next event is sent to any of the keptn channels you see an event in Dynatrace for the correlating service: | ||
 | ||
|
||
## Installation of dynatrace-service only | ||
|
||
To use this service, you must have set up Dynatrace monitoring, as described in the [documentation](https://keptn.sh/docs/0.2.1/monitoring/dynatrace/). | ||
Afterwards, apply the `dynatrace-service.yaml` using `kubectl` to create the dynatrace-service and the subscriptions to the keptn channels. | ||
|
||
```console | ||
kubectl apply -f ./deploy/manifests/dynatrace-service/dynatrace-service.yaml | ||
``` | ||
|
||
```console | ||
service.serving.knative.dev/dynatrace-service created | ||
subscription.eventing.knative.dev/dynatrace-subscription-deployment-finished created | ||
subscription.eventing.knative.dev/dynatrace-subscription-tests-finished created | ||
subscription.eventing.knative.dev/dynatrace-subscription-evaluation-done created | ||
``` | ||
|
||
## Verification of installation | ||
|
||
``` | ||
$ kubectl get ksvc dynatrace-service -n keptn | ||
NAME DOMAIN LATESTCREATED LATESTREADY READY REASON | ||
dynatrace-service dynatrace-service.keptn.x.x.x.x.xip.io dynatrace-service-dd9km dynatrace-service-dd9km True | ||
``` | ||
|
||
``` | ||
$ kubectl get subscription -n keptn | grep dynatrace-subscription | ||
dynatrace-subscription-deployment-finished True | ||
dynatrace-subscription-evaluation-done True | ||
dynatrace-subscription-tests-finished True | ||
$ | ||
``` | ||
|
||
When the next event is sent to any of the keptn channels you should see an event in Dynatrace for the correlating service: | ||
 | ||
|
||
## Uninstall service | ||
## Uninstall of dynatrace-service only | ||
|
||
To uninstall the dynatrace service and remove the subscriptions to keptn channels execute this command. | ||
|
||
``` | ||
kubectl delete -f dynatrace-service.yaml | ||
```console | ||
kubectl delete -f ./deploy/manifests/dynatrace-service/dynatrace-service.yaml | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Dynatrace OneAgent Operator | ||
|
||
The [Dynatrace OneAgent Operator](https://github.com/Dynatrace/dynatrace-oneagent-operator) will be downloaded and stored here by the `setupInfastructure` script when setting up keptn. Please do not remove this directory. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Auto-generated files | ||
|
||
The directory `/gen/` contains auto-generated files that are added to the `.gitignore`: |
202 changes: 202 additions & 0 deletions
202
deploy/manifests/dynatrace/oneagent-operator-openshift.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: dynatrace-oneagent-operator | ||
namespace: dynatrace | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: dynatrace-oneagent | ||
namespace: dynatrace | ||
--- | ||
apiVersion: v1 | ||
kind: SecurityContextConstraints | ||
metadata: | ||
annotations: | ||
kubernetes.io/description: 'dynatrace-oneagent-privileged allows access to all privileged and host features and the ability to run as any user, any group, any fsGroup, and with any SELinux context. This is a copy of privileged scc.' | ||
name: dynatrace-oneagent-privileged | ||
allowHostDirVolumePlugin: true | ||
allowHostIPC: true | ||
allowHostNetwork: true | ||
allowHostPID: true | ||
allowHostPorts: true | ||
allowPrivilegedContainer: true | ||
allowedCapabilities: | ||
- '*' | ||
allowedFlexVolumes: null | ||
defaultAddCapabilities: null | ||
fsGroup: | ||
type: RunAsAny | ||
priority: null | ||
readOnlyRootFilesystem: false | ||
requiredDropCapabilities: null | ||
runAsUser: | ||
type: RunAsAny | ||
seLinuxContext: | ||
type: RunAsAny | ||
seccompProfiles: | ||
- '*' | ||
supplementalGroups: | ||
type: RunAsAny | ||
users: | ||
- system:serviceaccount:dynatrace:dynatrace-oneagent | ||
volumes: | ||
- '*' | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: Role | ||
metadata: | ||
name: dynatrace-oneagent-operator | ||
namespace: dynatrace | ||
labels: | ||
dynatrace: operator | ||
operator: oneagent | ||
rules: | ||
- apiGroups: | ||
- dynatrace.com | ||
resources: | ||
- oneagents | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- update | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- daemonsets | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- delete | ||
- apiGroups: | ||
- "" # "" indicates the core API group | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- delete | ||
- apiGroups: | ||
- "" # "" indicates the core API group | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- delete | ||
- apiGroups: | ||
- "" # "" indicates the core API group | ||
resources: | ||
- secrets | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- monitoring.coreos.com | ||
resources: | ||
- servicemonitors | ||
verbs: | ||
- get | ||
- create | ||
- apiGroups: | ||
- dynatrace.com | ||
resources: | ||
- oneagents/finalizers | ||
- oneagents/status | ||
verbs: | ||
- update | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: RoleBinding | ||
metadata: | ||
name: dynatrace-oneagent-operator | ||
namespace: dynatrace | ||
labels: | ||
dynatrace: operator | ||
operator: oneagent | ||
subjects: | ||
- kind: ServiceAccount | ||
name: dynatrace-oneagent-operator | ||
roleRef: | ||
kind: Role | ||
name: dynatrace-oneagent-operator | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: oneagents.dynatrace.com | ||
spec: | ||
group: dynatrace.com | ||
names: | ||
kind: OneAgent | ||
listKind: OneAgentList | ||
plural: oneagents | ||
singular: oneagent | ||
scope: Namespaced | ||
version: v1alpha1 | ||
subresources: | ||
status: {} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: dynatrace-oneagent-operator | ||
namespace: dynatrace | ||
labels: | ||
dynatrace: operator | ||
operator: oneagent | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 1 | ||
selector: | ||
matchLabels: | ||
name: dynatrace-oneagent-operator | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
name: dynatrace-oneagent-operator | ||
dynatrace: operator | ||
operator: oneagent | ||
spec: | ||
containers: | ||
- name: dynatrace-oneagent-operator | ||
image: quay.io/dynatrace/dynatrace-oneagent-operator:v0.3.1 | ||
command: | ||
- dynatrace-oneagent-operator | ||
imagePullPolicy: Always | ||
env: | ||
- name: WATCH_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
ports: | ||
- containerPort: 60000 | ||
name: metrics | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 64Mi | ||
limits: | ||
cpu: 100m | ||
memory: 256Mi | ||
nodeSelector: | ||
beta.kubernetes.io/os: linux | ||
beta.kubernetes.io/arch: amd64 | ||
serviceAccountName: dynatrace-oneagent-operator |
Oops, something went wrong.