dynatrace-operator

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

Note: Requires Dynatrace Cluster version 1.209

Dynatrace Operator

The Dynatrace Operator supports rollout and lifecycle of various Dynatrace components in Kubernetes and OpenShift.

As of launch, the Dynatrace Operator can be used to deploy a containerized ActiveGate for Kubernetes API monitoring. New capabilities will be added to the Dynatrace Operator over time including metric routing, and API monitoring for AWS, Azure, GCP, and vSphere.

Supported platforms

Depending on the version of the Dynatrace Operator, it supports the following platforms:

Dynatrace Operator version Kubernetes OpenShift Container Platform
master 1.18+ 3.11.188+, 4.4+
v0.1.0 1.18+ 3.11.188+, 4.4+

Quick Start

The Dynatrace Operator acts on its separate namespace dynatrace. It holds the operator deployment and all dependent objects like permissions, custom resources and corresponding StatefulSets.

Kubernetes
Installation

To create the namespace and apply the operator run the following commands

$ kubectl create namespace dynatrace
$ kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/latest/download/kubernetes.yaml

A secret holding tokens for authenticating to the Dynatrace cluster needs to be created upfront. Create access tokens of type Dynatrace API and Platform as a Service and use its values in the following commands respectively. For assistance please refere to Create user-generated access tokens.

$ kubectl -n dynatrace create secret generic dynakube --from-literal="apiToken=DYNATRACE_API_TOKEN" --from-literal="paasToken=PLATFORM_AS_A_SERVICE_TOKEN"
Create DynaKube custom resource for ActiveGate rollout

The rollout of Dynatrace ActiveGate is governed by a custom resource of type DynaKube. This custom resource will contain parameters for various Dynatrace capabilities (API monitoring, routing, etc.)

Note: .spec.tokens denotes the name of the secret holding access tokens. If not specified Dynatrace Operator searches for a secret called like the DynaKube custom resource .metadata.name.

apiVersion: dynatrace.com/v1alpha1
kind: DynaKube
metadata:
  name: dynakube
  namespace: dynatrace
spec:
  # dynatrace api url including `/api` path at the end
  # either set ENVIRONMENTID to the proper tenant id or change the apiUrl as a whole, e.q. for Managed
  #
  apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api

  # name of secret holding `apiToken` and `paasToken`
  # if unset, name of custom resource is used
  #
  # tokens: ""

  # Enables and configures an ActiveGate instance that allows monitoring
  # of Kubernetes environments
  #
  kubernetesMonitoring:
    #   Enable Kubernetes monitoring functionality
    #
    enabled: true

This is the most basic configuration for the DynaKube object. In case you want to have adjustments please have a look at ./deploy/cr.yaml Save this to cr.yaml and apply it to your cluster.

$ kubectl apply -f cr.yaml
Uninstall

Uninstall dynatrace-operator

Remove DynaKube custom resources and clean-up all remaining Dynatrace Operator specific objects:

$ kubectl delete -n dynatrace dynakube --all
$ kubectl delete -f https://github.com/Dynatrace/dynatrace-operator/releases/latest/download/kubernetes.yaml
OpenShift
Installation

To create the namespace and apply the operator run the following commands

$ oc adm new-project --node-selector="" dynatrace
$ oc apply -f https://github.com/Dynatrace/dynatrace-operator/releases/latest/download/openshift.yaml

A secret holding tokens for authenticating to the Dynatrace cluster needs to be created upfront. Create access tokens of type Dynatrace API and Platform as a Service and use its values in the following commands respectively. For assistance please refere to Create user-generated access tokens.

$ oc -n dynatrace create secret generic dynakube --from-literal="apiToken=DYNATRACE_API_TOKEN" --from-literal="paasToken=PLATFORM_AS_A_SERVICE_TOKEN"
Create DynaKube custom resource for ActiveGate rollout

The rollout of Dynatrace ActiveGate is governed by a custom resource of type DynaKube.

Note: .spec.tokens denotes the name of the secret holding access tokens. If not specified Dynatrace Operator searches for a secret called like the DynaKube custom resource .metadata.name.

apiVersion: dynatrace.com/v1alpha1
kind: DynaKube
metadata:
  name: dynakube
  namespace: dynatrace
spec:
  # dynatrace api url including `/api` path at the end
  # either set ENVIRONMENTID to the proper tenant id or change the apiUrl as a whole, e.q. for Managed
  #
  apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api

  # name of secret holding `apiToken` and `paasToken`
  # if unset, name of custom resource is used
  #
  # tokens: ""

  # Enables and configures an ActiveGate instance that allows monitoring
  # of Kubernetes environments
  #
  kubernetesMonitoring:
    #   Enable Kubernetes monitoring functionality
    #
    enabled: true

This is the most basic configuration for the DynaKube object. In case you want to have adjustments please have a look at ./deploy/cr.yaml Save this to cr.yaml and apply it to your cluster.

$ oc apply -f cr.yaml
Uninstall

Uninstall dynatrace-operator

Remove DynaKube custom resources and clean-up all remaining Dynatrace Operator specific objects:

$ oc delete -n dynatrace dynakube --all
$ oc delete -f https://github.com/Dynatrace/dynatrace-operator/releases/latest/download/openshift.yaml

Hacking

See HACKING for details on how to get started enhancing Dynatrace Operator.

Contributing

See CONTRIBUTING for details on submitting changes.

License

Dynatrace Operator is under Apache 2.0 license. See LICENSE for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the dynatrace v1alpha1 API group +kubebuilder:object:generate=true +groupName=dynatrace.com
Package v1alpha1 contains API Schema definitions for the dynatrace v1alpha1 API group +kubebuilder:object:generate=true +groupName=dynatrace.com
controllers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL