---
updatedAt: 2026-07-15T16:55:26.000Z
agentTools:
  siteIndex: https://docs.jfrog.com/llms.txt
  projectIndex: https://docs.jfrog.com/integrations/llms.txt
---

# Pipelines-Dynatrace Reference Design

The JFrog Pipelines and Dynatrace Reference Design enables DevOps teams to better manage the development and delivery of software from code to production. In particular, it allows teams to use Dynatrace to track and tag deployment events for improved troubleshooting of applications and services running in production. Dynatrace automatically detects component versions allowing and centralizing this release-relevant data into a release inventory dashboard where releases by environment, open issues, and security vulnerabilities can be easily analyzed. The Dynatrace integration also opens up the use case of “monitoring as code” where Service Level Objectives, dashboards, and alerts are all managed with JFrog Pipelines and the Dynatrace configuration APIs.

If you need help with this integration, contact `partner_support@jfrog.com`

## Benefits

* **Enhance monitoring and troubleshooting** of applications and services running in production environments by correlating and tracing performance degradations to specific build updates, deployments, and commits collected through metadata provided by JFrog Pipelines.
* **Accelerate problem resolution and reduce finger-pointing** by using detailed contextual data on deployment events including build and git-related information to enable faster resolution of issues.
* **Reduce time spent on manual processes** by simplifying and standardizing Kubernetes deployments and introducing self-service Dynatrace monitoring as code.

## Prerequisites

* An active Dynatrace <Anchor label="free SaaS trial" href="https://www.dynatrace.com/trial/" target="_blank">free SaaS trial</Anchor> or license
* A JFrog Artifactory Pro (or higher) license or <Anchor label="free SaaS DevOps subscription" href="https://jfrog.com/start-free/" target="_blank">free SaaS DevOps subscription</Anchor>
* A <Anchor label="GitHub account" href="https://github.com/join" target="_blank">GitHub account</Anchor>
* A Kubernetes cluster with admin permissions

## Pipelines-Dynatrace Reference Design Configuration Overview

The JFrog Pipeline and Dynatrace reference design leverages a series of built-in integrations and custom bash scripts available within the JFrog Pipelines platform, that enable users to build a Docker image and deploy it to a Kubernetes cluster instrumented with the Dynatrace OneAgent Operator. As this is done, Dynatrace deployment events are sent to the associated service being monitored in the runtime environment with the important context and hyperlink back to the JFrog pipeline job that performed the deployment.

The reference design uses a number of repositories, integrations and pipelines. This section reviews the different tasks involved with integrating Dynatrace.

### JFrog Repositories used in the Reference Design

The following set of Artifactory [Repositories](/artifactory/docs/repository-management-overview) are used in the reference design:

<Table>
  <tbody>
    <tr>
      <td>
        **Repository Name**
      </td>
      <td>
        **Type**
      </td>
      <td>
        **Description**
      </td>
    </tr>
    <tr>
      <td>
        art-docker-dynatrace
      </td>
      <td>
        [Docker](/artifactory/docs/docker-repositories)
      </td>
      <td>
        Stores a collection of Docker images created by the pipeline.
      </td>
    </tr>
    <tr>
      <td>
        art-helm-charts-dynatrace
      </td>
      <td>
        [Helm](/artifactory/docs/kubernetes-helm-chart-repositories)
      </td>
      <td>
        Stores a collection of Helm charts created by the pipeline.
      </td>
    </tr>
  </tbody>
</Table>

### Integrations used in the Reference Design

[Integrations](/pipelines/docs/pipelines-integrations) connect Pipelines to an external service/tool. Each integration type defines the endpoint, credentials, and any other configuration detail required for Pipelines to exchange information with the service. Below are the integrations used in this reference design:

<Table>
  <tbody>
    <tr>
      <td>
        **Integration Name**
      </td>
      <td>
        **Type**
      </td>
      <td>
        **Description**
      </td>
    </tr>
    <tr>
      <td>
        **artifactoryIntegration**
      </td>
      <td>
        [Artifactory Integration](/pipelines/docs/pipelines-integrations#artifactory-integration) or [JFrog Platform Access Token Integration](/pipelines/docs/pipelines-integrations#jfrog-platform-access-token-integration)
      </td>
      <td>
        Stores the Artifactory URL and Token.
      </td>
    </tr>
    <tr>
      <td>
        **k8sIntegration**
      </td>
      <td>
        [Kubernetes Integration](/pipelines/docs/pipelines-integrations#kubernetes-integration)
      </td>
      <td>
        Stores the configuration YAML to access Kubernetes cluster connection.
      </td>
    </tr>
    <tr>
      <td>
        **githubIntegration**
      </td>
      <td>
        [GitHub Integration](https://docs.jfrog.com/integrations/docs/jfrog-and-github-integration-key-features)
      </td>
      <td>
        Stores the GitHub URL and User Access Token the GitHub account where the pipeline code is stored. The GitHub user must have admin rights for the Pipelines repository.
      </td>
    </tr>
    <tr>
      <td>
        **dynatraceIntegration**
      </td>
      <td>
        [Generic Integration](/pipelines/docs/pipelines-integrations#generic-integration)
      </td>
      <td>
        Stores the Dynatrace instance URL and API token. The API token is configured with the permissions for any APIs it calls. The reference design API permissions are defined as lower in this document.
      </td>
    </tr>
  </tbody>
</Table>

### Pipeline Steps used in the Reference Design

The reference JFrog Pipelines executes the following [pipelines steps](https://docs.jfrog.com/integrations/docs/pipelines-dynatrace-reference-design) as shown in the JFrog picture below.

![pipelines-steps.png](https://files.readme.io/5ec1e44e0d32f5d5de416d18a2dbe88c40d59d37de803c153a54bf90301d13bf-uuid-bfdd5288-c3f2-efa6-d871-847facb64c48.png)

1. **DockerBuild**: Native JFrog Pipelines step that builds a docker image from a Dockerfile and source code within the **githubIntegration** repo. This step uses the **artifactoryIntegration** to connect to the Artifactory instance so that the built image is available to the DockerPush step.
2. **DockerPush**: Native JFrog Pipelines step that publishes the Docker image to an Artifactory local Docker repository. Uses the**artifactoryIntegration** to push the image to the Artifactory instance.
3. **HelmPublish**: Native JFrog Pipelines step that uses the Helm chart in the **githubIntegration**repo and modifies it with the desired Docker image and tag to deploy. Pushes the updated Helm Chart to the Artifactory local Helm repository.
4. **HelmDeploy**: Native JFrog Pipelines step that installs the published Helm chart to the Kubernetes cluster defined in the **k8sIntegration**. This step will also output the status of the deployed pods.
5. **AppUpCheck**: Using the JFrog Pipelines **Bash** step type, this step calls a custom bash script that checks whether the passed-in URL is reachable. It will try a few times with a delay between attempts and will return with 'exit 1' if the URL is not reachable.
6. **ConfigureDynatrace**: Using the JFrog Pipelines **Bash** step type, this step calls a custom bash script that will run a Docker image with the Dynatrace monitoring as code CLI. The **githubIntegration** repo is mounted as a volume so that the monitoring-as-code CLI can access the YAML and JSON configuration files that it will process. Dynatrace credentials are read from the **dynatraceIntegration.**
7. **ModifyHelmChartProperties**: Using the JFrog Pipelines **Bash** step type, this step calls a custom bash script that calls the JFrog API to add custom properties to Helm chart in the repository. This step uses data from the previous step and adds it to the chart file properties. Artifactory credentials are read from the**artifactoryIntegration.**
8. **PostDynatraceEvent**: Using the JFrog Pipelines **Bash** step type, this step calls a custom bash script that sends the custom deployment event to the Dynatrace instance using the Dynatrace API. Dynatrace credentials are read from the **dynatraceIntegration.**

## Pipelines Dynatrace - Fork GitHub Repo and Create Access Token

In preparation for setting up the pipelines and running them, you will first need to make a copy of the reference design GitHub code repository. This assumes you have a <Anchor label="GitHub account." href="https://github.com/join" target="_blank">GitHub account.</Anchor>

1. <Anchor label="Fork" href="https://docs.github.com/en/get-started/quickstart/fork-a-repo" target="_blank">Fork</Anchor> the sample <Anchor label="JFrog Pipeline-Dynatrace repository" href="https://github.com/jfrog/jfrog-pipelines-dynatrace-example" target="_blank">JFrog Pipeline-Dynatrace repository</Anchor> to your own repository.
2. Adjust the **values.yaml** file with values for your environment. You must adjust:

   1. **gitRepo.path**- replace **dt-demos** with your GitHub username or org name
   2. **image.ImageName**- replace **dynatracedemos** with your Artifactory account name
3. Create a GitHub Personal Access Token in the GitHub account for the GitHub pipeline repo according to the [GitHub Integration](https://docs.jfrog.com/integrations/docs/jfrog-and-github-integration-key-features) document. Copy the generated token to a safe location. This Token is needed in the upcoming section for the pipeline GitHub integration setup.

## Set up the Pipeline for Dynatrace

To complete the setup of the pipeline, JFrog integrations, repositories, and a pipeline source needs to be added.

<Callout icon="📘" theme="info">
**Important**

The reference pipeline within the repo, **pipelines.yml,** assumes the names for the integrations and repositories match names from the table in the Design Reference section and as described below are used. You are welcome to use different names, but you must adjust the **pipelines.yml** too else the pipeline will fail.
</Callout>

#### Configuration Overview

To set up the Pipeline for Dynatrace:

<Table>
  <thead>
    <tr>
      <th>
        #
      </th>
      <th>
        Task
      </th>
      <th>
        Description
      </th>
      <th>
        For more information, see...
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        1
      </td>
      <td>
        **Add integrations**
      </td>
      <td>
        Add a GitHub JFrog integration from the JFrog Administration panel
      </td>
      <td>
        [Set up the Pipeline for Dynatrace - Add Integrations](#set-up-the-pipeline-for-dynatrace-add-integrations)
      </td>
    </tr>
    <tr>
      <td>
        2
      </td>
      <td>
        **Add repositories**
      </td>
      <td>
        Add Docker repositories in the Artifactory Administration page.
      </td>
      <td>
        [Set up the Pipeline for Dynatrace - Add Repositories](#set-up-the-pipeline-for-dynatrace-add-repositories)
      </td>
    </tr>
    <tr>
      <td>
        3
      </td>
      <td>
        **Add a Pipeline Source**
      </td>
      <td>
        Create a new GitHub Pipeline source for the new repository.
      </td>
      <td>
        [Set up the Pipeline for Dynatrace - Add a Pipeline Source](#set-up-the-pipeline-for-dynatrace-add-a-pipeline-source)
      </td>
    </tr>
  </tbody>
</Table>

### Set up the Pipeline for Dynatrace - Add Integrations

1. Add a GitHub JFrog Integration from the JFrog Administration panel. From the Administration page, select **Integrations** and then click the **‘Add Integrations’** button. On the form, fill in with these values as shown below.

   * Name = **githubIntegration**
   * Type = pick **‘GitHub’** from the drop-down list
   * Token = **Your GitHub Personal Access Token**

     ![setuppipeline.png](https://files.readme.io/d2f74d8ade7f8f37d89107067c8c48ba320fa84d5e66ecf4b80122fcd8f757fb-uuid-133cea4f-f523-ca10-d3a5-84c0e27ee6d6.png)
2. Create the **Dynatrace Integration** using the generic integration available within JFrog Pipelines. From the Administration page, select **Integrations** and then click the **‘Add Integrations’** button. On the form, fill in with these values as shown below.

   * Name = **dynatraceIntegration**
   * Type = pick **‘Generic Integration’** from the drop-down list
   * Add the following as the customer environment variables:

     * **DT\_URL**- The URL of the Dynatrace instance. For example: <Anchor label="https://abc.live.dynatrace.com" href="https://abc.live.dynatrace.com" target="_blank"><https://abc.live.dynatrace.com></Anchor>
     * **DT\_API\_TOKEN**- The API token for the Dynatrace instance

       ![setuppipelines1.png](https://files.readme.io/a18bf8c89e6aec861b6a37f5f17137ca6b3414ee764f8c335ba22418db3b38cc-uuid-ec7a3e6c-fa95-b6f2-5bc0-b40863159a35.png)
3. Create the Kubernetes integration using the static `kubeconfig` file for their cloud provider generated in the previous setup section. From the Administration page, select **Integrations** and then click **Add Integrations** button.
4. In the form, fill in the values as shown below.

   * Name =**k8sIntegration**
   * Type = Select **‘Kubernetes’** from the drop-down list
   * KubeConfig = Paste the static `kubeconfig` contents for their cloud provider generated in the previous setup section

     ![setuppipelines2.png](https://files.readme.io/f57adffef0d8b5e97ae17eb93706589f059282098fe9341eb33b957db9dc6cc4-uuid-d63aa32b-fb02-5993-3e6d-af8de4e6b8c1.png)
5. Create the **Artifactory Integration**. From the Administration page, select **Integrations** and then click **Add Integrations**.
6. In the form, fill in the values as shown below.

   * Name = **artifactoryIntegration**
   * Type = select **‘Artifactory’** from the drop-down list
   * Artifactory URL = leave as default
   * Artifactory User = leave as default
   * API Key = Click the **‘Get API Key’** button

     ![setuppipelines3.png](https://files.readme.io/afc6dd75c7fad18dc176e6ea2faf12a1b0f07a0859d3a99b5d4fbbbb59de9f27-uuid-301c642e-6f4c-de08-ff5c-b8429de87dd7.png)

The new integrations should look like this:

![setuppipelines4.png](https://files.readme.io/cf6b6452baa898b4d1d2ebe64327297b9d3f76a55a5dc7179e5d275dd67ec824-uuid-4197f702-1bc0-47fc-02f5-d41ff04575ac.png)

### Set up the Pipeline for Dynatrace - Add Repositories

1. Create the **Docker** repository.

   1. From the Administration page, select **Repositories** and then click **Add Repository**.
   2. Select the ‘local repository’ option.
   3. In the popup window, select **Docker**.
   4. In the form, set the **‘Repository Key’** = art-docker-dynatrace.
   5. Leave the other fields with the default settings.
   6. Click the  **Save and Finish**.

2. Create the **Helm Chart** repository.

3. From the Administration page, select **Repositories** and then click **Add Repository**.

4. Select the ‘local repository’ option.

5. On the popup window, select **Helm**.

6. On the form, set the **‘Repository Key’** = art-helm-charts-dynatrace.

7. Leave the other fields with the default settings.

8. Click  **Save and Finish**.

The new repositories should look like this:

![setuppipelines5.png](https://files.readme.io/6df884a36ac3f7ffcdb370aaf510303f52ae56829f472909f2c7c84e43275aa2-uuid-0d68c1b0-9fe3-0846-303d-100d96fbcc8c.png)

### Set up the Pipeline for Dynatrace - Add a Pipeline Source

Create a new GitHub Pipeline source with your new repository using the GitHub integration created in the previous step.

1. From the Administration panel, select **Pipeline Sources** from the **Pipelines** drop-down menu.
2. Then click **Add Pipeline Source** and select **From YAML** from the drop-down menu.
3. In the form, fill in the values as shown below.

   * SCM Provider Integration = **githubIntegration**
   * Repository Full Name = From the dropdown, select the **forked repository**
   * Branch = **main**
   * Pipeline Config file Filter = **pipelines.yml**![pipelines\_source\_values.png](https://files.readme.io/410f229490b428c2c1794210e1ec123f3fe341badfe9b91a6ae437190e4e0e7a-uuid-c4020cc5-7dca-96b0-52d6-39d9c596cab5.png)

The new pipeline source should look like this.

![pipelinesetup6.png](https://files.readme.io/d7d59bf4785d6521e4b094084c654f042097a68ce410f1a04a1812f68dd29ccb-uuid-30ab7c41-f6ff-fe0e-f28e-0b0f7680e15d.png)

## Run the Pipeline for Dynatrace

Once the setup is complete, the pipeline can be run manually from within the JFrog console under the **My Pipelines** tab within the Applications panel. The pipeline will execute all the steps in a sequential manner and the completed pipeline will look like this.

![run-pipeline.png](https://files.readme.io/fd407cb0c62f26ffcaa7afabae1629174a4455507afb3511ddb0079a5893ca6f-uuid-5f11e9f5-6381-23ef-12ce-40adceca040f.png)

You can expand each step to review the details, but there are a number of other things you may want to review.

### Review the Published Helm Chart

Within JFrog, expand the Artifactory repository and review the updated charts and custom properties as shown below.

![ReviewpublishedHelmChart.png](https://files.readme.io/14a797da8fc71bf495a0170463194d9c1703f0c2baf26274748b4dd2823d45f4-uuid-78e3bac9-8efa-1ad5-6370-2cef69884ef9.png)

### Review the Published Docker Chart

Within JFrog, expand the Artifactory repository and review the published image.

![Published Docker Chart.png](https://files.readme.io/bb9f6fdb62911a1aa22c0af06567fdc1b9b77fe655c75c3ce02147081dc378e1-uuid-600846ac-d2e9-4d91-3f0b-cda0788d2002.png)

### Review the Sample Application

1. First, obtain the public IP address from the Kubernetes service using this command.

   ```
   kubectl -n dynatrace get service
   NAME      TYPE           CLUSTER-IP   EXTERNAL-IP      PORT(S)          AGE

   demoapp   LoadBalancer   10.84.2.18   34.133.103.200   8080:32602/TCP   5d
   ```
2. Using the example above, open the application on port 8080 at `http://34.133.103.200:8080`. The application will look like this:

   ![review-sample-app.png](https://files.readme.io/48603eebed6576baa403769910c198b25a57e057b5d2ce2d3840599a4d2c7757-uuid-6193bdf5-d87b-b245-6ed3-268b06fa746f.png)

### Send Traffic to the Sample Application

In order for Dynatrace to fully monitor services and applications, there need to be some transactions flowing through the application. To make this process easier, a simple script is provided in the repo that will send cURL requests to the various application URLs within a loop. To run this script, open up the Google web shell and run these commands.

```
~/jfrog-pipelines-dynatrace-example/scripts

./sendSomeTraffic.sh
```

The `sendSomeTraffic.sh` will determine the public IP for the application and output the loop status as shown below. To stop the script, simply use `ctrl-c`.

```
Calling http://111.111.111.111:8080...

loop 1

200

200

200

200

loop 2

200

200

200

200

loop 3

200

200

...

...
```

### Review the Dynatrace Deployment Event

Within Dynatrace, navigate to the **Releases** menu to open up the <Anchor label="release inventory dashboard" href="https://www.dynatrace.com/news/blog/transparent-and-confident-software-delivery-with-dynatrace-release-analysis/" target="_blank">release inventory dashboard</Anchor>. On this dashboard is the demo application, its auto-detected version and its deployment event. Below are the expanded details for an example deployment event with its associated meta-data including the URL back to the JFrog pipeline that performed the deployment.

![Review the Dynatrace Deployment Event.png](https://files.readme.io/d1b9577d6568a5cabcd03d1337835759b491a8678c5cd920e2036501478942c9-uuid-d201f46d-1ffd-a86b-b537-04e76bf71150.png)

### Review the Dynatrace Kubernetes Dashboard

Within Dynatrace, navigate to the **Kubernetes** menu and drill into the workload for the demo application. As shown below, the **demoapp** workload dashboard shows overall utilization metrics with links to drill into the specific process.

![Review the Dynatrace Kubernetes Dashboard.png](https://files.readme.io/c07884c0e82407365f6698d1a86eb8d5da06f9e16172c2c19abf7e8bb41cc20b-uuid-1634cb89-4319-80e7-c0f0-74a0c9defbbe.png)

### Review the Service in Dynatrace

Within Dynatrace, navigate to the **Services** menu and open up the **DemoNodeJsApp** as shown below. This dashboard shows everything you need to know about the service including the time series metrics for the requests coming from the **sendSomeTraffic.sh** script.

![reviewservice.png](https://files.readme.io/701e6282d7def7e2e921fd5064ba86c70f6101a821a8aa121a0c2119b077213a-uuid-fe7df92c-f7e4-26f9-fbe9-7d659a35ba85.png)

### Deploy Another Version of the Demo Application

The sample app comes with built-in "feature" behaviors - meaning - if you launch the app and tell it to run as feature 1, 2, or 3 to show slightly different behavior. A feature is set using a Docker build argument that sets an environment variable that the application code looks for. You can read more about this in the <Anchor label="demoapp README file" href="https://github.com/jfrog/jfrog-pipelines-dynatrace-example/tree/master/demoapp" target="_blank">demoapp README file</Anchor>.

To change feature numbers, adjust the environment variable FEATURE\_NUMBER to the value in the **pipeline.yml** file and commit the code change. JFrog will automatically re-run the pipeline after any code commit, so just monitor the progress of the pipeline and then go back to review the Dynatrace release inventory, events, and JFrog artifacts. Below is an example of what the change should look like:

![Deploy-another-version- demo-application.png](https://files.readme.io/61c5906f0937a3eb6a9139271678af2320d3d174eefdeae3c6610e19d0d724e0-uuid-f48566f4-7061-1528-24a7-80f0c6f8b0cd.png)

## Preparing the Kubernetes Cluster and Dynatrace

This section lists the steps needed to prepare the Cluster and Dynatrace when integrating Dynatrace into a Pipeline. Preparing the Kubernetes cluster for Dynatrace includes the following:

<Table>
  <thead>
    <tr>
      <th>
        #
      </th>
      <th>
        Task
      </th>
      <th>
        Description
      </th>
      <th>
        For more information, see...
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        1
      </td>
      <td>
        **Create and Connect to the Cluster**
      </td>
      <td>
        Prepare containerized application and uses Helm to create and connect to the cluster.
      </td>
      <td>
        [Create and Connect to Cluster](#create-and-connect-to-cluster "Create and Connect to Cluster")
      </td>
    </tr>
    <tr>
      <td>
        2
      </td>
      <td>
        **Create a JFrog Service Account**
      </td>
      <td>
        Create the service account needed for the Kubernetes pipeline integration.
      </td>
      <td>
        [Create a JFrog Service Account](#create-a-jfrog-service-account "Create a JFrog Service Account")
      </td>
    </tr>
    <tr>
      <td>
        3
      </td>
      <td>
        **Create a Dynatrace Viewer**
      </td>
      <td>
        Create the Kubernetes role needed by Dynatrace to call the Kubernetes API.
      </td>
      <td>
        [Create a Dynatrace Viewer Role](#create-a-dynatrace-viewer-role "Create a Dynatrace Viewer Role")
      </td>
    </tr>
    <tr>
      <td>
        4
      </td>
      <td>
        **Create a JFrog Docker Credentials Secret**
      </td>
      <td>
        Create the credentials as a Kubernetes secret needed by Helm for deployment.
      </td>
      <td>
        [Create a JFrog Docker Credentials Secret](#create-a-jfrog-docker-credentials-secret "Create a JFrog Docker Credentials Secret")
      </td>
    </tr>
    <tr>
      <td>
        5
      </td>
      <td>
        **Install the Dynatrace Operator**
      </td>
      <td>
        Setup the Dynatrace operator handle the Dynatrace OneAgent Kubernetes API monitoring.
      </td>
      <td>
        [Install Dynatrace Operator](#install-dynatrace-operator "Install Dynatrace Operator")
      </td>
    </tr>
    <tr>
      <td>
        6
      </td>
      <td>
        **Verify the Cluster within Dynatrace**
      </td>
      <td>
        Log into Dynatrace and review the required pages to verify monitoring.
      </td>
      <td>
        [Verify the Cluster within Dynatrace](#verify-the-cluster-within-dynatrace "Verify the Cluster within Dynatrace")
      </td>
    </tr>
    <tr>
      <td>
        7
      </td>
      <td>
        **Create an API Token**
      </td>
      <td>
        Create an API Token for the Dynatrace integration.
      </td>
      <td>
        [Create an API Token for Dynatrace](#create-an-api-token-for-dynatrace "Create an API Token for Dynatrace")
      </td>
    </tr>
  </tbody>
</Table>

### Create and Connect to Cluster

A Kubernetes cluster is not required for the integration; instead, the reference pipeline uses a containerized application and uses Helm for deployments.

This demo uses Google GKE using the default settings from the Google console.

* cluster-version 1.20.8
* 3 nodes (12GB 6 CPU) machine-type "e2-medium"

Once the cluster is provisioned, use the google console web console to run these commands to configure kubectl to connect and view the cluster nodes.

```
gcloud container clusters get-credentials <CLUSTER NAME> --zone <ZONE> --project <PROJECT>

kubectl get nodes
```

### Create a JFrog Service Account

This step creates the service account that is needed in the next section as part of the k8s pipeline integration setup.

1. From the cloud shell clone the demo repository. For example:

   ```
   git clone https://github.com/dt-demos/JFrog-pipelines-dynatrace-example.git
   ```
2. Navigate into the setup folder.

   ```
   cd JFrog-pipelines-dynatrace-example/setup
   ```
3. Run this script that creates the k8s service account, adds the namespace for where the sample application will be deployed, and generates a kubeconfig file for a GKE cluster.

   ```
   ./createKubernetesServiceAccounts.sh
   ```
4. Copy the contents from the **kubeconfig** file to a safe location.

### Create a Dynatrace Viewer Role

This step creates the Kubernetes role that is needed by Dynatrace to call the Kubernetes API.

1. Assuming you are still in the “`JFrog-pipelines-dynatrace-example/setup`” folder within the Google cloud shell, run this command to add the role.

   ```
    kubectl create -f dynatrace-oneagent-metadata-viewer.yaml
   ```
2. You can verify that the “dynatrace-oneagent-metadata-viewer” was created using this command.

   ```
   kubectl -n dev get role
   ```

See the <Anchor label="Dynatrace Documentation" href="https://www.dynatrace.com/support/help/shortlink/kubernetes-tagging#anchor_viewer" target="_blank">Dynatrace Documentation</Anchor> for more details and the ways this role can be configured.

### Create a JFrog Docker Credentials Secret

This step creates the Frog Docker repository credentials as a Kubernetes secret. This secret is needed by Helm as it pulls the docker image during Helm deployments.

1. From the Google cloud shell, run this command to log in to your Artifactory Docker repository.

   ```
   docker login YOUR-ACCOUNT.JFrog.io
   ```
2. To export the saved credentials into a Kubernetes secret, run this command.

   ```
   kubectl create secret docker-registry regcred \

     --docker-server=<YOUR-ACCOUNT.JFrog.io> \

     --docker-username=<username> \

     --docker-password=<Artifactory_API_key> \

     --docker-email=<email>
   ```

See the <Anchor label="Kubernetes Documentation" href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" target="_blank">Kubernetes Documentation</Anchor> for more details.

### Install Dynatrace Operator

One key Dynatrace advantage is the ease of activation and for Kubernetes the <Anchor label="Dynatrace Operator" href="https://www.dynatrace.com/news/blog/new-dynatrace-operator-elevates-cloud-native-observability-for-kubernetes/" target="_blank">Dynatrace Operator</Anchor> is designed specifically to handle the lifecycle of the <Anchor label="Dynatrace OneAgent" href="https://www.dynatrace.com/support/help/setup-and-configuration/dynatrace-oneagent/" target="_blank">Dynatrace OneAgent</Anchor>, Kubernetes API monitoring, OneAgent traffic routing, and all future containerized componentry such as the forthcoming extension framework.

Operator setup is typically a one-time activity as part of the Kubernetes cluster and the quickest way to deploy the Dynatrace operator is the deployment wizard within the Dynatrace UI.

1. Log in to Dynatrace
2. In the <Anchor label="Dynatrace menu" href="https://www.dynatrace.com/support/help/get-started/navigation/" target="_blank">Dynatrace menu</Anchor>, select Manage.
3. Go to**Deploy Dynatrace | Start Installation | Kubernetes**
4. On the Kubernetes page fill in the following.

   * Name = **same as your cluster name**. This name is used by various Dynatrace settings, including Kubernetes cluster name, Network Zone, ActiveGate Group, and Host Group
   * Choose **‘Create Token’**
   * Depending on your setup, choose **‘Skip SSL’**
5. Depending on your setup, ‘Enable volume storage’

   ![Enable volume storage.png](https://files.readme.io/bc7c3558abb162df4677d222992f8ef21ed9478bd6a581aadbcee8ce6c3e3ec4-uuid-7a634feb-0298-612d-fc53-e3d931b07847.png)
6. Use the Copy function to copy and paste the generated command from the Dynatrace wizard in the Google cloud shell and run it.
7. After processing, you can run this command from the Google cloud web shell. You want to see that all pods are running as shown below before moving to the next section.

   ```
   kubectl -n dynatrace get pods

   NAME                                 READY   STATUS    RESTARTS   AGE

   dynakube-classic-gkt9f               1/1     Running   0          4d3h

   dynakube-classic-rnndv               1/1     Running   0          4d3h

   dynakube-classic-s7v4l               1/1     Running   0          4d3h

   dynakube-kubemon-0                   1/1     Running   0          4d3h

   dynakube-routing-0                   1/1     Running   0          4d3h

   dynatrace-operator-8b89765d5-znzd6   1/1     Running   10         5d3
   ```

### Verify the Cluster within Dynatrace

Log in to Dynatrace and review each of these pages to verify that the Kubernetes cluster is being monitored.

1. In the <Anchor label="Dynatrace menu" href="https://www.dynatrace.com/support/help/get-started/navigation/" target="_blank">Dynatrace menu</Anchor>, select **Hosts**. You should see several hosts as shown below:

   ![hosts.png](https://files.readme.io/aa168a3cbd7c5c46815051d275f9955eda3fb7b1f58dc2715d317546f9f5f14a-uuid-b054db3e-c4eb-ee36-8071-71d40688b47e.png)
2. In the <Anchor label="Dynatrace menu" href="https://www.dynatrace.com/support/help/get-started/navigation/" target="_blank">Dynatrace menu</Anchor>, select **Kubernetes**. You should see the cluster as shown below:

   ![cluster.png](https://files.readme.io/de4f9885964f5420d800505681661c09470176d75336639220f9002ebe4ced76-uuid-ceb82128-c369-ca79-0b71-349c75efe399.png)

### Create an API Token for Dynatrace

Within Dynatrace, create an <Anchor label="API Token" href="https://www.dynatrace.com/support/help/get-started/access-tokens/" target="_blank">API Token</Anchor>.

1. Log in to Dynatrace.
2. In the <Anchor label="Dynatrace menu" href="https://www.dynatrace.com/support/help/get-started/navigation/" target="_blank">Dynatrace menu</Anchor>, select **Settings**.
3. Go to **Integration | Dynatrace API**.
4. Select **Generate token**.
5. Enter a name for your token such as **JFrog**.
6. Select the required permissions for the token as shown below.

   ![DynatraceAPI.png](https://files.readme.io/3ad28ebde2823dc4b959880df74236239526d7829b2929cabbb073be461d981c-uuid-47f41c67-6cab-998b-6102-df189e80b3be.png)
7. Click the **Generate** button.
8. Copy the generated token to a safe location. This token is required for the next section of the Dynatrace pipeline integration setup.