Store Dynatrace images in private registries
You have the following options for storing Dynatrace images in private registries in Kubernetes environments.
- Store Dynatrace containers in private registries in Kubernetes environments using either an immutable or a lightweight OneAgent container image.
The immutable image includes the binaries themselves, allowing for more control and thorough security scanning.
The lightweight image consists of a OneAgent installer, which downloads necessary binaries from Dynatrace.
- Build and store your code-module image for
applicationMonitoring
andcloudNativeFullstack
deployments.
Immutable mode
Prerequisites
A working private registry
Log in to the Dynatrace container registry for your environment
Run the command below. Be sure to replace the placeholders with your own values.
- To determine
<your-environment-ID>
, see environment ID. - To determine
<your-PaaS-token>
, see PaaS token.
1docker login -u <your-environment-ID> -p <your-PaaS-token> <your_environment_URL>
Placeholders
To store Dynatrace containers in private registries using an immutable OneAgent image, follow the steps below, making sure to replace the placeholders (<...>
) in all the example commands or example configurations with your own values as shown in the following table.
Parameter | Value description |
---|---|
<dynatrace_operator_version> | The latest Dynatrace Operator version. |
<oneagent_version> | The semantic versioning form (<major>.<minor>.<patch> ) of your desired OneAgent version. |
<activegate_version> | The semantic versioning form (<major>.<minor>.<patch> ) of your desired ActiveGate version. |
<your_private_registry> | The address from your private registry |
<your_environment_domain_name> | Your own environment domain name (the URL without https:// ) |
<your_environment_ID> | Your environment ID |
<sample> | The name of your selected DynaKube custom resource sample. |
Pull, tag, and push the Dynatrace Operator image
Pull, tag, and push the OneAgent image
Pull, tag, and push the ActiveGate image
Fetch, modify, and apply the Kubernetes/OpenShift YAML
Fetch, modify, and apply the DynaKube custom resource
Pull, tag, and push the Dynatrace Operator image
-
Pull the image.
Example command:
1docker pull docker.io/dynatrace/dynatrace-operator:v<dynatrace_operator_version> -
Tag the image for your own registry.
Example command:
1docker tag docker.io/dynatrace/dynatrace-operator:v<dynatrace_operator_version> <your_private_registry>/dynatrace-operator:v<dynatrace_operator_version> -
Push the image to your own registry.
Example command:
1docker push <your_private_registry>/dynatrace-operator:v<dynatrace_operator_version>
Pull, tag, and push the OneAgent image
Each OneAgent image from your environment registry has connection information for that environment, so make sure you use the corresponding image.
-
Pull a specific immutable OneAgent image version.
Example command:
1docker pull <your_environment_domain_name>/linux/oneagent:<oneagent_version> -
Tag the image for your own registry.
Example command:
1docker tag <your_environment_domain_name>/linux/oneagent:<oneagent_version> <your_private_registry>/oneagent:<oneagent_version> -
Push the image to your own registry.
Example command:
1docker push <your_private_registry>/oneagent:<oneagent_version>
Pull, tag, and push the ActiveGate image
-
Pull the image.
Example command:
1docker pull <your_environment_domain_name>/linux/activegate:<activegate_version> -
Tag the image for your own registry.
Example command:
1docker tag <your_environment_domain_name>/linux/activegate:<activegate_version> <your_private_registry>/activegate:<activegate_version> -
Push the image to your own registry.
Example command:
1docker push <your_private_registry>/activegate:<activegate_version>
Fetch, modify, and apply the Kubernetes/OpenShift YAML
-
Download the latest Kubernetes/OpenShift YAML from the Dynatrace GitHub repository.
1curl -Lo kubernetes.yaml https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.14.0/kubernetes.yaml -
Edit the Kubernetes/OpenShift YAML by replacing the default image location of Dynatrace Operator with your private registry address.
-
If your registries need authentication, update
imagePullSecrets
on different service accounts.
For more information on how Kubernetes handles security for pods, see Configure service accounts for pods. -
Depending on your platform, select one of the options below.
Create a Dynatrace namespace.
1kubectl create namespace dynatrace -
Deploy Dynatrace Operator.
1kubectl apply -f kubernetes.yaml
Fetch, modify, and apply the DynaKube custom resource
-
Download one of the preconfigured DynaKube custom resource samples from GitHub, depending on your monitoring approach.
-
Edit the DynaKube custom resource as follows:
- Replace the empty value of the image fields (
image: ""
) withimage: <your_private_registry>
. - Adapt other values according to the parameters section of the Dynatrace Operator deployment page.
When using the immutable image, fields such as
proxy
,trustedCAs
, andskipCertCheck
are ignored. Kubernetes attempts to pull images straight from your registry. These network settings must be configured directly on the node.Example basic configuration:
1apiVersion: dynatrace.com/v1beta12kind: DynaKube3metadata:4 name: dynakube5 namespace: dynatrace6spec:7 apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api8 oneAgent:9 classicFullStack:10 image: <your_private_registry>/oneagent:<oneagent_version>11 tolerations:12 - effect: NoSchedule13 key: node-role.kubernetes.io/master14 operator: Exists15 activeGate:16 capabilities:17 - routing18 - kubernetes-monitoring19 image: <your_private_registry>/activegate:<activegate_version> - Replace the empty value of the image fields (
-
Deploy the DynaKube custom resource.
1kubectl apply -f <sample>.yaml
Lightweight mode
This method isn't supported by Dynatrace Operator.
Prerequisites
A working private registry
Log in to the Dynatrace container registry for your environment
Run the command below.
- To determine
<your-environment-ID>
, see environment ID. - To determine
<your-dynatrace-operator-token>
, see Dynatrace Operator token.
1docker login -u <your-environment-ID> -p <your-dynatrace-operator-token> <your_environment_URL>
Placeholders
To store Dynatrace containers in private registries using a lightweight OneAgent image follow the steps below, making sure to replace the placeholders (<...>
) in all the example commands or example configurations with your own values, as shown in the following table:
Parameter | Value description |
---|---|
<dynatrace_operator_version> | The latest Dynatrace Operator version. |
<activegate_version> | The semantic versioning form (<major>.<minor>.<patch> ) of your desired ActiveGate version. |
<your_private_registry> | The address from your private registry |
<your_environment_domain_name> | Your own environment domain name (the URL without https:// ) |
<your_environment_ID> | Your environment ID |
<sample> | The name of your selected Dynakube custom resource sample. |
Pull, tag, and push the Dynatrace Operator image
Pull, tag, and push the OneAgent image
Pull, tag, and push the ActiveGate image
Fetch, modify, and apply the Kubernetes/OpenShift YAML
Fetch, modify, and apply the DynaKube custom resource
Pull, tag, and push the Dynatrace Operator image
-
Pull the image.
Example command:
1docker pull docker.io/dynatrace/dynatrace-operator:v<dynatrace_operator_version> -
Tag the image for your own registry.
Example command:
1docker tag docker.io/dynatrace/dynatrace-operator:v<dynatrace_operator_version> <your_private_registry>/dynatrace-operator:v<dynatrace_operator_version> -
Push the image to your own registry.
Example command:
1docker push <your_private_registry>/dynatrace-operator:v<dynatrace_operator_version>
Pull, tag, and push the OneAgent image
-
Pull the image.
1docker pull docker.io/dynatrace/oneagent -
Tag the image for your own registry.
Example command:
1docker tag docker.io/dynatrace/oneagent:latest <your_private_registry>/oneagent:latest -
Push the image to your own registry.
Example command:
1docker push <your_private_registry>/oneagent:latest
Pull, tag, and push the ActiveGate image
-
Pull the image.
Example command:
1docker pull <your_environment_domain_name>/linux/activegate:<activegate_version> -
Tag the image for your own registry.
Example command:
1docker tag <your_environment_domain_name>/linux/activegate:<activegate_version> <your_private_registry>/activegate:<activegate_version> -
Push the image to your own registry.
Example command:
1docker push <your_private_registry>/activegate:<activegate_version>
Fetch, modify, and apply the Kubernetes/OpenShift YAML
-
Download the latest Kubernetes/OpenShift YAML from the Dynatrace GitHub repository.
1curl -Lo kubernetes.yaml https://github.com/Dynatrace/dynatrace-operator/releases/download/v0.14.0/kubernetes.yaml -
Edit the Kubernetes/OpenShift YAML by replacing the default image location of Dynatrace Operator with your private registry address.
-
If your registries need authentication, update
imagePullSecrets
on different service accounts.
For more information on how Kubernetes handles security for pods, see Configure service accounts for pods. -
Depending on your platform, select one of the options below.
Create a Dynatrace namespace.
1kubectl create namespace dynatrace -
Deploy Dynatrace Operator.
1kubectl apply -f kubernetes.yaml
Fetch, modify, and apply the DynaKube custom resource
-
Download one of the preconfigured DynaKube custom resource samples from GitHub, depending on your monitoring approach.
-
Edit the DynaKube custom resource as follows:
- Replace the empty value of the image fields (
image: ""
) withimage: <your_private_registry>
. - Adapt other values according to the parameters section of the Dynatrace Operator deployment page.
When using the immutable image, fields such as
proxy
,trustedCAs
, andskipCertCheck
are ignored. Kubernetes attempts to pull images straight from your registry. These network settings must be configured directly on the node.Example basic configuration:
1apiVersion: dynatrace.com/v1beta12kind: DynaKube3metadata:4 name: dynakube5 namespace: dynatrace6spec:7 apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api8 oneAgent:9 classicFullStack:10 image: <your_private_registry>/oneagent:<oneagent_version>11 tolerations:12 - effect: NoSchedule13 key: node-role.kubernetes.io/master14 operator: Exists15 activeGate:16 capabilities:17 - routing18 - kubernetes-monitoring19 image: <your_private_registry>/activegate:<activegate_version> - Replace the empty value of the image fields (
-
Deploy the DynaKube custom resource.
1kubectl apply -f <sample>.yaml
Code modules as an image
applicationMonitoring with CSI driver
cloudNativeFullstack
To build and store your code-module image for applicationMonitoring
and cloudNativeFullstack
deployments, follow the instructions below.
Prerequisites
-
A working private registry
-
Make sure your access token has the PaaS integration - Installer download permission enabled.
-
Determine what architecture you want to use.
- For x86 architecture, you need to download the
multidistro
flavor. - For ARM architecture, you need to download the
default
flavor.
- For x86 architecture, you need to download the
-
Determine which OneAgent version you want to use. Example format:
1.239.14.20220325-164521
.Run the command below, replacing the placeholders with the values obtained in the prerequisites above.
1curl -X GET "<your-API-URL>/api/v1/deployment/installer/agent/versions/unix/paas?flavor=<your-flavor>&arch=all" \2-H "Authorization: Api-Token <your-API-token-with-PaaS-permissions>"
Build the image
-
Create a Dockerfile, which will download, unpack, and place the necessary binaries (ZIP package) to the right location. For examples of Dockerfiles, consult our GitHub repository.
-
Build the image from the Dockerfile you created above.
Run the command below, making sure to provide the necessary arguments.
1docker build \2--build-arg APIURL=<your-API-URL>/api\3--build-arg APITOKEN=<your-Dynatrace-Operator-token> \4--build-arg AGENTVERSION=<your-desired-OneAgent-version> \5--tag <your-registry>/<your-code-modules-repository>:<your-OneAgent-version> \6-f <path-to-your-Dockerfile> . -
Push the image to your private repository.
1docker push <your-registry>/<your-code-modules-repository>:<your-OneAgent-version>After you're done, you can use the image in the custom resource YAML and download the OneAgent binaries from your private image repository.
-
For Dynatrace Operator to authenticate to the private registry, you need to define the
customPullSecret
parameter in the DynaKube custom resource. For details, see Create a Secret based on existing credentials. -
For
cloudNativeFullStack
andapplicationMonitoring
deployments when using CSI driver, you need to set thecodeModulesImage
parameter in DynaKube. -
Example:
1...2cloudNativeFullStack:3 codeModulesImage: <your-registry>/<your-code-modules-repository>:<your-OneAgent-version>
-