27 Jun 2019 11:41 AM - last edited on 14 Dec 2021 02:22 PM by MaciejNeumann
Hello ,
I'm trying to follow these instructions from https://www.dynatrace.com/support/help/technology-support/cloud-platforms/openshift/installation-and... to deploy a OneAgent to monitor a spring boot application deployed under OpenShift Online 3.
firstly,i created a dockerfile and i insert these instructions into it with replacing environement id , the tocken , the one agent option and the command by 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
and after that i did the build the application image by execute 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] 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 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, @Daniela R. , i think that you exposed to this issue , could you help me please.
Many thanks,
Refka
27 Jun 2019 12:05 PM
Why didn't you add agent in runtime like here?
It's easier way and better because you will not need building image everytime.
Sebastian
27 Jun 2019 12:20 PM
i didn't undrestand the different instructions especially what i need to do firstly ?
In fact,i couldn't undrestand what the meaning of the followings instructions
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.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.# your application containers
section of the example below.27 Jun 2019 12:41 PM
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
27 Jun 2019 04:27 PM
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.
it's right that i did?
many thanks,
27 Jun 2019 06:45 PM
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 🙂
27 Jun 2019 02:20 PM
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.
best regards,
refka
27 Jun 2019 02:24 PM
Here you have some details about deployment templates:
https://docs.openshift.com/container-platform/3.5/dev_guide/templates.html
27 Jun 2019 03:16 PM
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 belowmy 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
27 Jun 2019 05:23 PM
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