# Deploy OneAgent on OpenShift for application-only monitoring

**URL:** <https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151>\
**Category:** Container platforms\
**Tags:** openshift, kubernetes, docker\
**Created:** [June 27, 2019, 10:41am UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151 "2019-06-27T10:41:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![refka\_hachani](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@refka\_hachani](https://community.dynatrace.com/u/refka_hachani)\
**Post date:** [June 27, 2019, 10:41am UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/1 "2019-06-27T10:41:03Z")

</div>

Hello,

I’m trying to follow these instructions from [https://www.dynatrace.com/support/help/technology-support/cloud-platforms/openshift/installation-and-operation/application-only/deploy-oneagent-on-openshift-for-application-only-monitoring/](https://www.dynatrace.com/support/help/technology-support/cloud-platforms/openshift/installation-and-operation/application-only/deploy-oneagent-on-openshift-for-application-only-monitoring/) to deploy a OneAgent to monitor a Spring Boot application deployed under OpenShift Online 3.

First, I created a Docker file and inserted these instructions into it, replacing the environment ID, the token, the one agent option, and the command with the right variables.

ARG DT\_API\_URL=“https://\<environmentID\>.live.dynatrace.com/api” ARG DT\_API\_TOKEN=“\<token\>” ARG DT\_ONEAGENT\_OPTIONS=“flavor=default&include=\<technology1\>&include=\<technology2\>” ENV DT\_HOME=“/opt/dynatrace/oneagent” RUN mkdir -p “$DT\_HOME” && \ wget -O “$DT\_HOME/oneagent.zip” “$DT\_API\_URL/v1/deployment/installer/agent/unix/paas/latest?Api-Token=$DT\_API\_TOKEN&$DT\_ONEAGENT\_OPTIONS” && \ unzip -d “$DT\_HOME” “$DT\_HOME/oneagent.zip” && \ rm “$DT\_HOME/oneagent.zip” ENTRYPOINT [“/opt/dynatrace/oneagent/dynatrace-agent64.sh”] CMD [“executable”, “param1”, “param2”] # the command of your application, e.g. java

After that, I built the application image by executing the next command

oc new-build --binary --strategy=docker --allow-missing-images yourapp

However, it seems that isn’t working for me, as I’m getting the following error :

[root@CHBSLADT01TST LambdaAir]# oc new-build --binary --strategy=docker --allow-missing-images zuuloo

W0627 05:53:42.764249 1035 newapp.go:317] I Could not find an image stream match for “zuuloo.” Make sure that a Docker image with that tag is available on the node for the build to succeed.

\* A Docker build using binary input will be created

\* The resulting image will be pushed to the image stream “zuuloo: latest”

\* A binary build was created; use ‘start-build --from-dir’ to trigger a new build

--\> Creating resources with label build=zuuloo …

imagestream “zuuloo” created

error: buildconfigs “zuuloo” is forbidden: build strategy Docker is not allowed

--\> Failed

Has anyone experienced similar issues, and if you solved them, how did you do it?

Best,

[@Zbyszek C](https://answers.dynatrace.com/users/12707/view.html), @Daniela R. , I think that you are exposed to this issue. Could you help me, please?

Many thanks,

Refka

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [June 27, 2019, 11:05am UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/2 "2019-06-27T11:05:21Z")

</div>

Why didn’t you add agent in runtime like here?

[https://www.dynatrace.com/support/help/technology-support/cloud-platforms/openshift/installation-and-operation/application-only/deploy-oneagent-on-openshift-for-application-only-monitoring/](https://www.dynatrace.com/support/help/technology-support/cloud-platforms/openshift/installation-and-operation/application-only/deploy-oneagent-on-openshift-for-application-only-monitoring/)

It’s easier way and better because you will not need building image everytime.

Sebastian

---

<div class="post-metadata">

**Author:** ![refka\_hachani](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@refka\_hachani](https://community.dynatrace.com/u/refka_hachani)\
**Post date:** [June 27, 2019, 11:20am UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/3 "2019-06-27T11:20:47Z")

</div>

I didn’t understand the different instructions, especially what I needed to do first.

In fact, I couldn’t understand the meaning of the following instructions

1. Extend your deployment template with `initContainer`, which will download OneAgent, and make it available as a volume. See the `# initcontainer to download OneAgent` and `# Make OneAgent available as a volume` sections of the example below.  
Possible values for the `DT_ONEAGENT_OPTIONS`:
  - `<FLAVOR>`: The flavor of your image. Use either `default` or `musl`.
  - `<TECHNOLOGY>`: The OneAgent code module required for your application. Valid options are `all`, `java`, `apache`, `nginx`, `nodejs`, `dotnet`, `php`, and `go`. You can specify several code modules, use the `&include=<technology1>&include=<technology2>` syntax for that.

2. Add the newly created volume to the container of your application. See the `# your application containers` section of the example below.

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [June 27, 2019, 11:41am UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/4 "2019-06-27T11:41:42Z")

</div>

You should have yaml script responsible for container startup. There you should paste extra configuration according to documentation. This is all you need to do, than you will have no need for building images each time. This is old way of instrumatation.

Sebastian

---

<div class="post-metadata">

**Author:** ![refka\_hachani](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@refka\_hachani](https://community.dynatrace.com/u/refka_hachani)\
**Post date:** [June 27, 2019, 1:20pm UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/5 "2019-06-27T13:20:25Z")

</div>

thanks but where can i find the yaml script .

you find below the screenshot for the application deployed on openshift online with the different service.

 ![21111-1561641593628.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/0368d79244433baad841652b2e7762903813916c.png)

best regards,

refka

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [June 27, 2019, 1:24pm UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/6 "2019-06-27T13:24:55Z")

</div>

Here you have some details about deployment templates:

[https://docs.openshift.com/container-platform/3.5/dev\_guide/templates.html](https://docs.openshift.com/container-platform/3.5/dev_guide/templates.html)

---

<div class="post-metadata">

**Author:** ![refka\_hachani](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@refka\_hachani](https://community.dynatrace.com/u/refka_hachani)\
**Post date:** [June 27, 2019, 2:16pm UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/7 "2019-06-27T14:16:47Z")

</div>

thanks a lot

In fact, when i acceded to the interface of the openshift where the application id deployed , i consult the different services

firstly, i consult the airports service and i found the yaml file below

 ![21116-1561644815075.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/0/a05ca71e2dd5a7894637e5fc107299bb542b01d4.png)  
my questions are:

the modification in the documentations should be inserted in this file

knowing that the application contains services, should i modify the yaml file for each service

best regards,

Refka

---

<div class="post-metadata">

**Author:** ![refka\_hachani](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@refka\_hachani](https://community.dynatrace.com/u/refka_hachani)\
**Post date:** [June 27, 2019, 3:27pm UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/8 "2019-06-27T15:27:18Z")

</div>

Hello sebastian,

I created a file yaml in the project and i inserted into it the template below with replacing

the value, the tocken ,environement id , the option par the right values.

After that, i consult the interface dynatrace , i didn’t see the application.

 ![21117-1561649095616.png](https://global.discourse-cdn.com/dynatrace/original/2X/b/b534666bbda70f91a2ad729aa8680a3b9f776710.png)

it’s right that i did?

many thanks,

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [June 27, 2019, 4:23pm UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/9 "2019-06-27T16:23:24Z")

</div>

I’m not open shift admin actually, we are sending configuration to client andinistrators and they are making all changes, so sorry but I will not help here anymore 😞 but maybe somebody else has some extra knowledge about this. This is rather question to open shot community I think.

Sebastian

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [June 27, 2019, 5:45pm UTC](https://community.dynatrace.com/t/deploy-oneagent-on-openshift-for-application-only-monitoring/21151/10 "2019-06-27T17:45:36Z")

</div>

Seems ok but you have to add proper

Parameters like API url, PaaS token and API key. Without this your script os not able to download OneAgent, install it and instrument process.

All details are in documentation I’ve pasted.

I don’t have access to computer for checking but in tank important are indents in row. If you will have any errors be sure that everything has right indent 🙂
