The dynatrace-bootstrapper is a small CLI binary built into a Dynatrace CodeModule (after version <to-be-determined-codemodule-version>) so that it can be used in conjunction with the dynatrace-operator to optimize the download and configuration of a CodeModule in Kubernetes.
- Copy a Dynatrace CodeModule to a target directory
- Configure the Dynatrace CodeModule according to the configuration options provided
Example: --source="/opt/dynatrace/oneagent"
⚠️ This is a required arg⚠️ - The
--sourcearg defines the base path where to copy the CodeModule FROM.
Example: --target="example/bins/1.2.3"
⚠️ This is a required arg⚠️ - The
--targetarg defines the base path where to copy the CodeModule TO.
Example: --work="/example/work"
- This is an optional arg
- The
--workarg defines the base path for a tmp folder, this is where the command will do its work, to make sure the operations are atomic. It must be on the same disk as the target folder.
Example: --technology="python,java"
- This is an optional arg
- The
--technologyarg defines the paths associated to the given technology in the<source>/manifest.jsonfile. Only those files will be copied that match the technology. It is a comma-separated list.
Example: --config-directory="/example/config/dir"
- This is an optional arg
- The
--config-directoryarg defines the path whereenrichmentandconfigfiles will be created in.
Example: --input-directory="/example/input"
- This is an optional arg
- The
--input-directoryarg defines the base path where configuration files are provided.- Intended use is to mount a k8s
Secretwith the correct content in the provided path.- So when we are talking about "files", it is just the fields of the
Secret's data
- So when we are talking about "files", it is just the fields of the
- Config files:
-
ruxitagentproc.json: A json file containing a response from the/deployment/installer/agent/processmoduleconfigendpoint of the Dynatrace Environment(v1) API.- This file is required if
--input-directoryis defined. - Used to create the
<config-directory>/<container-name>/oneagent/agent/config/ruxitagentproc.conffile
- This file is required if
-
initial-connect-retry: A file containing a single number value. Defines the delay before the initial connection attempt. (Useful in case ofistio-proxyis used.)- Used to create/update the
<config-directory>/<container-name>/oneagent/agent/customkeys/curl_options.conffile.
- Used to create/update the
-
trusted.pem: A file containing the certificates used by the CodeModule for all its communication (proxy communication's not included).- Used to create the
<config-directory>/<container-name>/oneagent/agent/customkeys/custom.pemand<config-directory>/<container-name>/oneagent/agent/customkeys/custom_proxy.pemfile.
- Used to create the
-
activegate.pem: A file containing the certificates used by the CodeModule for all its communication with the ActiveGate (proxy communication's NOT included).- Used to create the
<config-directory>/<container-name>/oneagent/agent/customkeys/custom.pem. - Is concatenated with the
trusted.pemif both is present.
- Used to create the
-
endpoint.properties: A file containing the necessary info so the metadata-enrichment metrics can be ingested properly- Used to create the
<config-directory>/<container-name>/enrichment/endpoint/endpoint.properties. - Example:
DT_METRICS_INGEST_URL=http://test-activegate.dynatrace/e/tenant/api/v2/metrics/ingest DT_METRICS_INGEST_API_TOKEN=<data-ingest-token> - Used to create the
-
- Intended use is to mount a k8s
Example: --input-directory="/opt/dynatrace/oneagent"
- This is an optional arg
- Defaults to
/opt/dynatrace/oneagent
- Defaults to
- The
--install-patharg defines the base path where the agent binary will be put. This is only necessary to properly configure theld.so.preloadfile.- The
ld.so.preloadis put under<config-directory>/oneagent/ld.so.preload
- The
Example: --fullstack
- This is an optional arg
- Defaults to
false
- Defaults to
- The
--fullstackarg will make sure that the CodeModule is configured to be in fullstack mode.- Adds additional values to the
<config-directory>/<container-name>/oneagent/agent/config/container.conf.
- Adds additional values to the
Example: --tenant="my-tenant"
- This is an optional arg, but mandatory incase of
--fullstack. - Only used incase of
--fullstack, provides additional info needed to properly configure<config-directory>/<container-name>/oneagent/agent/config/container.conf.
Example: --attribute="k8s.pod.name=test"
- This is an optional arg
- The
--attributearg defines the passed in Pod attributes that will be used to configure the metadata-enrichment and injected CodeModule. It is a key value pair.
Example: --attribute-container="{k8s.container.name=app, container_image.registry=gcr.io, container_image.repository=test}"
- This is an optional arg
- The
--attribute-containerarg defines the passed in Container attributes that will be used to configure the metadata-enrichment and injected CodeModule. It is a JSON formatted string.
Example: --suppress-error
- This is an optional arg
- Defaults to
false
- Defaults to
- The
--suppress-errorarg will silence any errors, causing the executable to return with an exit code 0 even if an error occurred. Intended purpose is to not block the application container from starting, if used as init-container.
Example: --debug
- This is an optional arg
- Defaults to
false
- Defaults to
- The
--debugarg will enabled the debug logs.
- To run tests:
make test - To run linting:
make lint - To build a testing image:
make build
- The flag
--debugenables debug logs. - Create new debug logs via
log.V(1).Info(...)- The logging levels between
zapandlogris different, so we had to get creative.
- The logging levels between
A a Helm chart for a small PHP sample app, with the bootsrapper as it's initContainer, as it is expected to be used.
To deploy it in your cluster (where your KUBECONFIG is pointing) with the image of the current branch (considering that the image was built via make build):
make deploy
To remove it from your cluster:
make undeploy
You can use the make deploy/custom
- This will use the
hack/testing/helm-sample/_values.yamlas the values.- This file is ignored by git, so you can safely put whatever you want into it.
- The
imagewill still be set according to whatmake buildwould create.
The bootstrapper is mainly used by installing it via go install, so the release is very simple:
- Go to the release page.
- Press Draft new release
- Set the tag you want to release, you don't need to push the tag beforehand. Example format: v1.2.3
- Press
Generate release notes - Cleanup generated output to only have the interesting commits. (business logic relevant or bugfixes)
- Publish release