GithubHelp home page GithubHelp logo

neo-liang-sap / dynatrace-oneagent-operator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dynatrace/dynatrace-oneagent-operator

0.0 1.0 0.0 135 KB

Kubernetes/Openshift Operator for managing Dynatrace OneAgent deployments

License: Apache License 2.0

Go 95.70% Dockerfile 0.39% Shell 3.91%

dynatrace-oneagent-operator's Introduction

CircleCI Docker Repository on Quay

Dynatrace OneAgent Operator

This is the home of Dynatrace OneAgent Operator which supports the rollout and lifecycle of Dynatrace OneAgent in Kubernetes and OpenShift clusters. Rolling out Dynatrace OneAgent via DaemonSet on a cluster is straightforward. Maintaining its lifecycle places a burden on the operational team. Dynatrace OneAgent Operator closes this gap by automating the repetitive steps involved in keeping Dynatrace OneAgent at its latest desired version.

Overview

Dynatrace OneAgent Operator is based on Operator SDK and uses its framework for interacting with Kubernetes and OpenShift environments. It watches custom resources OneAgent and monitors the desired state constantly. The rollout of Dynatrace OneAgent is managed by a DaemonSet initially. From here on Dynatrace OneAgent Operator controlls the lifecycle and keeps track of new versions and triggers updates if required.

Overview

Supported platforms

Dynatrace OneAgent Operator is supported on the following platforms:

  • Kubernetes 1.9+
  • OpenShift Container Platform 3.9+

Help topic How do I deploy Dynatrace OneAgent as a Docker container? lists compatible image and OneAgent versions in its requirements section.

Quick Start

The Dynatrace OneAgent Operator acts on its separate namespace dynatrace. It holds the operator deployment and all dependent objects like permissions, custom resources and corresponding DaemonSets. Create neccessary objects and observe its logs:

Kubernetes

$ kubectl create -f https://raw.githubusercontent.com/Dynatrace/dynatrace-oneagent-operator/master/deploy/kubernetes.yaml
$ kubectl -n dynatrace logs -f deployment/dynatrace-oneagent-operator

OpenShift

$ oc create -f https://raw.githubusercontent.com/Dynatrace/dynatrace-oneagent-operator/master/deploy/openshift.yaml
$ oc -n dynatrace logs -f deployment/dynatrace-oneagent-operator

Create OneAgent custom resource for OneAgent rollout

The rollout of Dynatrace OneAgent is governed by a custom resource of type OneAgent:

apiVersion: dynatrace.com/v1alpha1
kind: OneAgent
metadata:
  # a descriptive name for this object.
  # all created child objects will be based on it.
  name: oneagent
  namespace: dynatrace
spec:
  # dynatrace api url including `/api` path at the end
  apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api
  # disable certificate validation checks for installer download and API communication
  skipCertCheck: false
  # name of secret holding `apiToken` and `paasToken`
  # if unset, name of custom resource is used
  tokens: ""
  # node selector to control the selection of nodes (optional)
  nodeSelector: {}
  # https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ (optional)
  tolerations: []
  # oneagent installer image (optional)
  # certified image from Red Hat Container Catalog for use on OpenShift: registry.connect.redhat.com/dynatrace/oneagent
  # defaults to docker.io/dynatrace/oneagent
  image: ""
  # arguments to oneagent installer (optional)
  # https://www.dynatrace.com/support/help/shortlink/oneagent-docker#limitations
  args:
  - APP_LOG_CONTENT_ACCESS=1
  # environment variables for oneagent (optional)
  env: []
  # resource settings for oneagent pods (optional)
  # consumption of oneagent heavily depends on the workload to monitor
  # please adjust values accordingly
  #resources:
  #  requests:
  #    cpu: 100m
  #    memory: 512Mi
  #  limits:
  #    cpu: 300m
  #    memory: 1.5Gi

Save the snippet to a file or use ./deploy/cr.yaml from this repository and adjust its values accordingly. 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.

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

Kubernetes
$ kubectl -n dynatrace create secret generic oneagent --from-literal="apiToken=DYNATRACE_API_TOKEN" --from-literal="paasToken=PLATFORM_AS_A_SERVICE_TOKEN"
$ kubectl create -f cr.yaml
OpenShift

In order to use the certified OneAgent image from Red Hat Container Catalog you need to set .spec.image to registry.connect.redhat.com/dynatrace/oneagent in the custom resource and provide image pull secrets:

$ oc -n dynatrace create secret docker-registry redhat-connect --docker-server=registry.connect.redhat.com --docker-username=REDHAT_CONNECT_USERNAME --docker-password=REDHAT_CONNECT_PASSWORD --docker-email=unused
$ oc -n dynatrace create secret docker-registry redhat-connect-sso --docker-server=sso.redhat.com --docker-username=REDHAT_CONNECT_USERNAME --docker-password=REDHAT_CONNECT_PASSWORD --docker-email=unused
$ oc -n dynatrace secrets link dynatrace-oneagent redhat-connect --for=pull
$ oc -n dynatrace secrets link dynatrace-oneagent redhat-connect-sso --for=pull
$ oc -n dynatrace create secret generic oneagent --from-literal="apiToken=DYNATRACE_API_TOKEN" --from-literal="paasToken=PLATFORM_AS_A_SERVICE_TOKEN"
$ oc create -f cr.yaml

Uninstall dynatrace-oneagent-operator

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

Kubernetes

$ kubectl delete -n dynatrace oneagent --all
$ kubectl delete -f https://raw.githubusercontent.com/Dynatrace/dynatrace-oneagent-operator/master/deploy/kubernetes.yaml

OpenShift

$ oc delete -n dynatrace oneagent --all
$ oc delete -f https://raw.githubusercontent.com/Dynatrace/dynatrace-oneagent-operator/master/deploy/openshift.yaml

Hacking

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

Contributing

See CONTRIBUTING for details on submitting changes.

License

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

dynatrace-oneagent-operator's People

Contributors

baichinger avatar esukram avatar jsm84 avatar martingoodwell avatar peterfeicht avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.