• Home
  • Deploy
  • Kubernetes
  • Deployment
  • Get started with Kubernetes observability

Get started with Kubernetes observability

However, if you're interested in gaining a more comprehensive view of your environment that includes aspects such as Application observability and user experience, you should consider a full Kubernetes observability approach, such as cloud native full stack or classic full stack.

This page provides instructions for deploying the Dynatrace Operator in host monitoring configuration to a Kubernetes cluster.

Prerequisites

Before you begin

Before installing Dynatrace on your Kubernetes cluster, ensure that you meet the following requirements:

  • Your kubectl CLI is connected to the Kubernetes cluster that you want to monitor.
  • You have sufficient privileges on the monitored cluster to run kubectl or oc commands.

Cluster setup and configuration

  • You must allow egress for Dynatrace pods (default: Dynatrace namespace) to your Dynatrace environment or to your Environment ActiveGate
  • For OpenShift Dedicated, you need the cluster-admin role.
  • Helm installation Use Helm version 3.

Supported versions

See supported Kubernetes/OpenShift platform versions and distributions.

Installation options

Choose one of the installation methods that best suits your needs.

Manifest

Helm

Manifest

  1. Create a dynatrace namespace

    bash
    kubectl create namespace dynatrace
  2. Install Dynatrace Operator

    bash
    kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/kubernetes.yaml kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/kubernetes-csi.yaml
    Without CSI driver when fileystem for OneAgent is mounted read-write

    Whenever the CSI driver is in use the host file-system is mounted readonly by OneAgent. If you don't want to use the CSI driver, the file-system needs to be mounted read-write by disabling the readonly-mode. For more information how to disable readonly-mode, see Read-only file systems support.

    bash
    kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/kubernetes.yaml
    For VMware Tanzu Kubernetes (TGKI) where CSI driver is used

    For VMware Tanzu Kubernetes Grid Integrated Edition (formerly PKE), follow the steps below instead.

    1. Get kubernetes-csi.yaml from GitHub.
    2. Adjust the YAML file by replacing the /var/lib/kubelet/ path with /var/vcap/data/kubelet/ in all instances.
    3. Run the commands below.
    bash
    kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/kubernetes.yaml kubectl apply -f kubernetes-csi.yaml
    For IBM Kubernetes Service (IKS) where CSI driver is used

    For IBM Cloud Kubernetes Service (IKS), follow the steps below.

    1. Get kubernetes-csi.yaml from GitHub.
    2. Adjust the YAML file by replacing the /var/lib/kubelet/ path with /var/data/kubelet in all instances.
    3. Run the commands below.
    bash
    kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.11.0/kubernetes.yaml kubectl apply -f kubernetes-csi.yaml

    Run the following command to see when Dynatrace Operator components finish initialization:

    bash
    kubectl -n dynatrace wait pod --for=condition=ready --selector=app.kubernetes.io/name=dynatrace-operator,app.kubernetes.io/component=webhook --timeout=300s
  3. Create secret for API token

    Create a secret named dynakube for the API token obtained in Tokens and permissions required.

    bash
    kubectl -n dynatrace create secret generic dynakube --from-literal="apiToken=<API_TOKEN>"
  4. Apply the DynaKube custom resource

    Download the DynaKube custom resource sample for host monitoring from GitHub. In addition, you can review the available parameters or how-to-guides, and adapt the DynaKube custom resource according to your requirements.

    Run the command below to apply the DynaKube custom resource, making sure to replace <your-DynaKube-CR> with your actual DynaKube custom resource file name. A validation webhook will provide helpful error messages if there's a problem.

    bash
    kubectl apply -f <your-DynaKube-CR>.yaml
  5. optional Verify deployment

    Verify that your DynaKube is running and all pods in your Dynatrace namespace are running and ready.

    bash
    > kubectl get dynakube -n dynatrace NAME APIURL STATUS AGE dynakube https://<ENVIRONMENTID>.live.dynatrace.com/api Running 45s

    In a default DynaKube configuration with CSI driver, you should see the following pods:

    bash
    > kubectl get pods -n dynatrace NAME READY STATUS RESTARTS AGE dynakube-activegate-0 1/1 Running 0 50s dynakube-oneagent-b88rn 1/1 Running 0 50s dynakube-oneagent-m5jm4 1/1 Running 0 50s dynakube-oneagent-qhd9u 1/1 Running 0 50s dynatrace-oneagent-csi-driver-qxfwx 4/4 Running 0 2m49s dynatrace-oneagent-csi-driver-xk5c4 4/4 Running 0 2m49s dynatrace-oneagent-csi-driver-mz6ch 4/4 Running 0 2m49s dynatrace-operator-7dc8dc7d8c-wmh4z 1/1 Running 0 2m59s dynatrace-webhook-7bb6957fb5-l8fsq 1/1 Running 0 2m59s dynatrace-webhook-7bb6957fb5-rqnqk 1/1 Running 0 2m59s

    As OneAgent and CSI-driver are deployed as DaemonSet you should have a OneAgent and CSI-driver pod on each node.

  1. Add a dynatrace project

    bash
    oc adm new-project --node-selector="" dynatrace
  2. Install Dynatrace Operator

    bash
    oc apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/openshift.yaml oc apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/openshift-csi.yaml
    Without CSI driver when fileystem for OneAgent is mounted read-write

    Whenever the CSI driver is in use the host file-system is mounted readonly by OneAgent. If you don't want to use the CSI driver, the file-system needs to be mounted read-write by disabling the readonly-mode. For more information how to disable readonly-mode, see Read-only file systems support.

    bash
    oc apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/kubernetes.yaml

    Run the following command to see when Dynatrace Operator components finish initialization:

    bash
    oc -n dynatrace wait pod --for=condition=ready --selector=app.kubernetes.io/name=dynatrace-operator,app.kubernetes.io/component=webhook --timeout=300s
  3. Create secret for API token

    Create a secret named dynakube for the API token obtained in Tokens and permissions required.

    bash
    oc -n dynatrace create secret generic dynakube --from-literal="apiToken=<API_TOKEN>"
  4. Apply the DynaKube custom resource

    Download the DynaKube custom resource sample for host monitoring from GitHub. In addition, you can review the available parameters or how-to-guides, and adapt the DynaKube custom resource according to your requirements.

    Run the command below to apply the DynaKube custom resource, making sure to replace <your-DynaKube-CR> with your actual DynaKube custom resource file name. A validation webhook will provide helpful error messages if there's a problem.

    bash
    oc apply -f <your-DynaKube-CR>.yaml
  5. optional Verify deployment

    Verify that your DynaKube is running and all pods in your Dynatrace namespace are running and ready.

    bash
    > oc get dynakube -n dynatrace NAME APIURL STATUS AGE dynakube https://<ENVIRONMENTID>.live.dynatrace.com/api Running 45s

    In a default DynaKube configuration with CSI driver, you should see the following pods:

    bash
    > oc get pods -n dynatrace NAME READY STATUS RESTARTS AGE dynakube-activegate-0 1/1 Running 0 50s dynakube-oneagent-b88rn 1/1 Running 0 50s dynakube-oneagent-m5jm4 1/1 Running 0 50s dynakube-oneagent-qhd9u 1/1 Running 0 50s dynatrace-oneagent-csi-driver-qxfwx 4/4 Running 0 2m49s dynatrace-oneagent-csi-driver-xk5c4 4/4 Running 0 2m49s dynatrace-oneagent-csi-driver-mz6ch 4/4 Running 0 2m49s dynatrace-operator-7dc8dc7d8c-wmh4z 1/1 Running 0 2m59s dynatrace-webhook-7bb6957fb5-l8fsq 1/1 Running 0 2m59s dynatrace-webhook-7bb6957fb5-rqnqk 1/1 Running 0 2m59s

    As OneAgent and CSI-driver are deployed as DaemonSet you should have a OneAgent and CSI-driver pod on each node.

Helm

Dynatrace Operator version 0.8.0+

  1. Add the Dynatrace Helm repository

    bash
    helm repo add dynatrace \ https://raw.githubusercontent.com/Dynatrace/dynatrace-operator/main/config/helm/repos/stable

    Note that attempting to access the above URL will result in a 404 error page as it is only used internally by the Helm client.

  2. Install Dynatrace Operator

    You have two options:

    Option 1: Install Dynatrace Operator using the default values:

    bash
    helm install dynatrace-operator dynatrace/dynatrace-operator \ --set "installCRD=true" \ --set "csidriver.enabled=true" \ --atomic \ --create-namespace --namespace dynatrace

    Option 2: For additional configuration to the Helm chart, edit the values.yaml sample from GitHub, then run the install command passing the YAML file as an argument:

    Without CSI driver when fileystem for OneAgent is mounted read-write

    Whenever the CSI driver is in use the host file-system is mounted readonly by OneAgent. If you don't want to use the CSI driver, the file-system needs to be mounted read-write by disabling the readonly-mode. For more information how to disable readonly-mode, see Read-only file systems support.

    bash
    kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.12.1/kubernetes.yaml
    For VMware Tanzu Kubernetes (TGKI) with CSI driver enabled

    For VMware Tanzu Kubernetes Grid Integrated Edition (formerly PKE), you need to set the csidriver.kubeletPath value in values.yaml to /var/vcap/data/kubelet/.

    yaml
    csidriver: enabled: true kubeletPath: "/var/vcap/data/kubelet"
    For IBM Kubernetes Service (IKS) with CSI driver enabled

    Dynatrace Operator version 0.9.0+

    For IBM Cloud Kubernetes Service (IKS), you need to set the csidriver.kubeletPath value in values.yaml to /var/data/kubelet.

    yaml
    csidriver: enabled: true kubeletPath: "/var/data/kubelet"
    bash
    helm install dynatrace-operator dynatrace/dynatrace-operator \ -f values.yaml \ --atomic \ --create-namespace --namespace dynatrace

    If installCRD is set to false, you need to create the custom resource definition manually before starting the Helm installation:

    bash
    kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/dynatrace-operator-crd.yaml
  3. Create secret for API token

    Create a secret named dynakube for the API token obtained in Tokens and permissions required.

    bash
    kubectl -n dynatrace create secret generic dynakube --from-literal="apiToken=<API_TOKEN>"
  4. Apply the DynaKube custom resource

    Download the DynaKube custom resource sample for host monitoring from GitHub. In addition, you can review the available parameters or how-to-guides, and adapt the DynaKube custom resource according to your requirements.

    Run the command below to apply the DynaKube custom resource, making sure to replace <your-DynaKube-CR> with your actual DynaKube custom resource file name. A validation webhook will provide helpful error messages if there's a problem.

    bash
    kubectl apply -f <your-DynaKube-CR>.yaml
  5. optional Verify deployment

    Verify that your DynaKube is running and all pods in your Dynatrace namespace are running and ready.

    bash
    > kubectl get dynakube -n dynatrace NAME APIURL STATUS AGE dynakube https://<ENVIRONMENTID>.live.dynatrace.com/api Running 45s

    In a default DynaKube configuration with CSI driver, you should see the following pods:

    bash
    > kubectl get pods -n dynatrace NAME READY STATUS RESTARTS AGE dynakube-activegate-0 1/1 Running 0 50s dynakube-oneagent-b88rn 1/1 Running 0 50s dynakube-oneagent-m5jm4 1/1 Running 0 50s dynakube-oneagent-qhd9u 1/1 Running 0 50s dynatrace-oneagent-csi-driver-qxfwx 4/4 Running 0 2m49s dynatrace-oneagent-csi-driver-xk5c4 4/4 Running 0 2m49s dynatrace-oneagent-csi-driver-mz6ch 4/4 Running 0 2m49s dynatrace-operator-7dc8dc7d8c-wmh4z 1/1 Running 0 2m59s dynatrace-webhook-7bb6957fb5-l8fsq 1/1 Running 0 2m59s dynatrace-webhook-7bb6957fb5-rqnqk 1/1 Running 0 2m59s

    As OneAgent and CSI-driver are deployed as DaemonSet you should have a OneAgent and CSI-driver pod on each node.

  1. Add the Dynatrace Helm repository

    bash
    helm repo add dynatrace \ https://raw.githubusercontent.com/Dynatrace/dynatrace-operator/main/config/helm/repos/stable

    Note that attempting to access the above URL will result in a 404 error page as it is only used internally by the Helm client.

  2. Install Dynatrace Operator

    You have two options:

    Option 1: Install Dynatrace Operator using the default values:

    bash
    helm install dynatrace-operator dynatrace/dynatrace-operator \ --set "installCRD=true" \ --set "csidriver.enabled=true" \ --atomic \ --create-namespace --namespace dynatrace

    Option 2: For additional configuration to the Helm chart, edit the values.yaml sample from GitHub, then run the install command passing the YAML file as an argument:

    bash
    helm install dynatrace-operator dynatrace/dynatrace-operator \ -f values.yaml \ --atomic \ --create-namespace --namespace dynatrace

    If installCRD is set to false, you need to create the custom resource definition manually before starting the Helm installation:

    bash
    oc apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.13.0/dynatrace-operator-crd.yaml
  3. Create secret for API token

    Create a secret named dynakube for the API token obtained in Tokens and permissions required.

    bash
    oc -n dynatrace create secret generic dynakube --from-literal="apiToken=<API_TOKEN>"
  4. Apply the DynaKube custom resource

    Download the DynaKube custom resource sample for host monitoring from GitHub. In addition, you can review the available parameters or how-to-guides, and adapt the DynaKube custom resource according to your requirements.

    Run the command below to apply the DynaKube custom resource, making sure to replace <your-DynaKube-CR> with your actual DynaKube custom resource file name. A validation webhook will provide helpful error messages if there's a problem.

    bash
    oc apply -f <your-DynaKube-CR>.yaml
  5. optional Verify deployment

    Verify that your DynaKube is running and all pods in your Dynatrace namespace are running and ready.

    bash
    > oc get dynakube -n dynatrace NAME APIURL STATUS AGE dynakube https://<ENVIRONMENTID>.live.dynatrace.com/api Running 45s

    In a default DynaKube configuration with CSI driver, you should see the following pods:

    bash
    > oc get pods -n dynatrace NAME READY STATUS RESTARTS AGE dynakube-activegate-0 1/1 Running 0 50s dynakube-oneagent-b88rn 1/1 Running 0 50s dynakube-oneagent-m5jm4 1/1 Running 0 50s dynakube-oneagent-qhd9u 1/1 Running 0 50s dynatrace-oneagent-csi-driver-qxfwx 4/4 Running 0 2m49s dynatrace-oneagent-csi-driver-xk5c4 4/4 Running 0 2m49s dynatrace-oneagent-csi-driver-mz6ch 4/4 Running 0 2m49s dynatrace-operator-7dc8dc7d8c-wmh4z 1/1 Running 0 2m59s dynatrace-webhook-7bb6957fb5-l8fsq 1/1 Running 0 2m59s dynatrace-webhook-7bb6957fb5-rqnqk 1/1 Running 0 2m59s

    As OneAgent and CSI-driver are deployed as DaemonSet you should have a OneAgent and CSI-driver pod on each node.

Learn more

After you've successfully installed the Dynatrace Operator, you may find the following resources helpful for further learning and troubleshooting.

Get actionable answers

Start to analyze your Kubernetes clusters and containerized Apps with Dynatrace and benefit from actionable answers.

Guides

Learn how you can configure Dynatrace Operator to support specific use cases.

Troubleshooting

Troubleshoot any challenges you may encounter while working with the Dynatrace Operator and its various components.

How it works

Want to learn more about the Dynatrace components in your Kubernetes cluster?

Reference

API reference and configuration options for all Dynatrace components within your Kubernetes cluster.

Dynatrace Operator release notes

See release notes for Dynatrace Operator.

Update or uninstall

This page provides a detailed instructions on how to update and uninstall Dynatrace Operator.

Related topics
  • Kubernetes/OpenShift monitoring

    Monitor Kubernetes/OpenShift with Dynatrace.