• Home
  • Setup and configuration
  • Set up Dynatrace on container platforms
  • Kubernetes
  • Other configuration options for Kubernetes/OpenShift
  • Store Dynatrace images in private registries in Kubernetes/OpenShift

Store Dynatrace images in private registries in Kubernetes/OpenShift

You can store Dynatrace containers in private registries in Kubernetes environments using either a lightweight or an immutable OneAgent container image.

  • The lightweight image consists of a OneAgent installer, which downloads necessary binaries from Dynatrace.
  • The immutable image includes the binaries themselves, allowing for more control and thorough security scanning.

Prerequisites

  • Dynatrace Operator version 0.3.0+
  • A working private registry
  • Log in to the Dynatrace container registry for your environment
To log in

Run the command below.

Note: 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.
sudo docker login -u <your-environment-ID> <your_environment_URL> -p <your-PaaS-token>

Immutable mode

The immutable image can only be used for classicFullSTack and hostMonitoring configurations. Any other deployment modes are currently not supported.

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:

ParameterValue 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.

1. Pull, tag, and push the Dynatrace Operator image

  1. Pull the image.

Example command:

bash
docker pull docker.io/dynatrace/dynatrace-operator:v<dynatrace_operator_version>
  1. Tag the image for your own registry.

Example command:

bash
docker tag docker.io/dynatrace/dynatrace-operator:v<dynatrace_operator_version> <your_private_registry>/dynatrace-operator:v<dynatrace_operator_version>
  1. Push the image to your own registry.

Example command:

bash
docker push <your_private_registry>/dynatrace-operator:v<dynatrace_operator_version>

2. Pull, tag, and push the OneAgent image

  1. Pull a specific immutable OneAgent image version.

Example command:

bash
docker pull <your_environment_domain_name>/linux/oneagent:<oneagent_version>
  1. Tag the image for your own registry.

Example command:

bash
docker tag <your_environment_domain_name>/linux/oneagent:<oneagent_version> <your_private_registry>/oneagent:<oneagent_version>
  1. Push the image to your own registry.

Example command:

bash
docker push <your_private_registry>/oneagent:<oneagent_version>

3. Pull, tag, and push the ActiveGate image

  1. Pull the image.

Example command:

bash
docker pull <your_environment_domain_name>/linux/activegate:<activegate_version>
  1. Tag the image for your own registry.

Example command:

bash
docker tag <your_environment_domain_name>/linux/activegate:<activegate_version> <your_private_registry>/activegate:<activegate_version>
  1. Push the image to your own registry.

Example command:

bash
docker push <your_private_registry>/activegate:<activegate_version>

4. Fetch, modify, and apply the Kubernetes/OpenShift YAML

  1. Download the latest Kubernetes/OpenShift YAML from the Dynatrace GitHub repository.
bash
curl -Lo kubernetes.yaml https://github.com/Dynatrace/dynatrace-operator/releases/download/latest/kubernetes.yaml
bash
curl -Lo openshift.yaml https://github.com/Dynatrace/dynatrace-operator/releases/download/latest/openshift.yaml
  1. Edit the Kubernetes/OpenShift YAML by replacing the default image location of Dynatrace Operator with your private registry address.

  2. 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.

  3. Depending on your platform, select one of the options below.

Create a Dynatrace namespace.

bash
kubectl create namespace dynatrace

Create a Dynatrace project.

bash
oc adm new-project --node-selector="" dynatrace
  1. Deploy Dynatrace Operator.
bash
kubectl apply -f kubernetes.yaml
bash
oc apply -f openshift.yaml

5. Fetch, modify, and apply the DynaKube custom resource

  1. Download one of the preconfigured DynaKube custom resource samples from GitHub, depending on your monitoring approach.

Example command:

bash
curl -Lo <sample>.yaml https://github.com/Dynatrace/dynatrace-operator/blob/master/config/samples/<sample>.yaml
  1. Edit the DynaKube custom resource as follows:
  • Replace the empty value of the image fields (image: "") with image: <your_private_registry>.
  • Adapt other values according to the parameters section of the Dynatrace Operator deployment page.

Note: When using the immutable image, fields such as proxy, trustedCAs, and skipCertCheck are ignored. Kubernetes attempts to pull images straight from your registry. These network settings must be configured directly on the node.

Example basic configuration:

yaml
apiVersion: dynatrace.com/v1beta1 kind: DynaKube metadata: name: dynakube namespace: dynatrace spec: apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api oneAgent: classicFullStack: image: <your_private_registry>/oneagent:<oneagent_version> tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master operator: Exists activeGate: capabilities: - routing - kubernetes-monitoring image: <your_private_registry>/activegate:<activegate_version>
  1. Deploy the DynaKube custom resource.

Example command:

bash
kubectl apply -f <sample>.yaml
bash
oc apply -f <sample>.yaml

Lightweight mode

Note: This method isn't supported by Dynatrace Operator.

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:

ParameterValue 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.

1. Pull, tag, and push the Dynatrace Operator image

  1. Pull the image.

Example command:

bash
docker pull docker.io/dynatrace/dynatrace-operator:v<dynatrace_operator_version>
  1. Tag the image for your own registry.

Example command:

bash
docker tag docker.io/dynatrace/dynatrace-operator:v<dynatrace_operator_version> <your_private_registry>/dynatrace-operator:v<dynatrace_operator_version>
  1. Push the image to your own registry.

Example command:

bash
docker push <your_private_registry>/dynatrace-operator:v<dynatrace_operator_version>

2. Pull, tag, and push the OneAgent image

  1. Pull the image.
bash
docker pull docker.io/dynatrace/oneagent
  1. Tag the image for your own registry.

Example command:

bash
docker tag docker.io/dynatrace/oneagent:latest <your_private_registry>/oneagent:latest
  1. Push the image to your own registry.

Example command:

bash
docker push <your_private_registry>/oneagent:latest

3. Pull, tag, and push the ActiveGate image

  1. Pull the image.

Example command:

bash
docker pull <your_environment_domain_name>/linux/activegate:<activegate_version>
  1. Tag the image for your own registry.

Example command:

bash
docker tag <your_environment_domain_name>/linux/activegate:<activegate_version> <your_private_registry>/activegate:<activegate_version>
  1. Push the image to your own registry.

Example command:

bash
docker push <your_private_registry>/activegate:<activegate_version>

4. Fetch, modify, and apply the Kubernetes/OpenShift YAML

  1. Download the latest Kubernetes/OpenShift YAML from the Dynatrace GitHub repository.
bash
curl -Lo kubernetes.yaml https://github.com/Dynatrace/dynatrace-operator/releases/download/latest/kubernetes.yaml
bash
curl -Lo openshift.yaml https://github.com/Dynatrace/dynatrace-operator/releases/download/latest/openshift.yaml
  1. Edit the Kubernetes/OpenShift YAML by replacing the default image location of Dynatrace Operator with your private registry address.

  2. 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.

  3. Depending on your platform, select one of the options below.

Create a Dynatrace namespace.

bash
kubectl create namespace dynatrace

Create a Dynatrace project.

bash
oc adm new-project --node-selector="" dynatrace
  1. Deploy Dynatrace Operator.
bash
kubectl apply -f kubernetes.yaml
bash
oc apply -f openshift.yaml

5. Fetch, modify, and apply the DynaKube custom resource

  1. Download one of the preconfigured DynaKube custom resource samples from GitHub, depending on your monitoring approach.

Example command:

bash
curl -Lo <sample>.yaml https://github.com/Dynatrace/dynatrace-operator/blob/master/config/samples/<sample>.yaml
  1. Edit the DynaKube custom resource as follows:
  • Replace the empty value of the image fields (image: "") with image: <your_private_registry>.
  • Adapt other values according to the parameters section of the Dynatrace Operator deployment page.

Note: When using the immutable image, fields such as proxy, trustedCAs, and skipCertCheck are ignored. Kubernetes attempts to pull images straight from your registry. These network settings must be configured directly on the node.

Example basic configuration:

yaml
apiVersion: dynatrace.com/v1beta1 kind: DynaKube metadata: name: dynakube namespace: dynatrace spec: apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api oneAgent: classicFullStack: image: <your_private_registry>/oneagent:<oneagent_version> tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master operator: Exists activeGate: capabilities: - routing - kubernetes-monitoring image: <your_private_registry>/activegate:<activegate_version>
  1. Deploy the DynaKube custom resource.

Example command:

bash
kubectl apply -f <sample>.yaml
bash
oc apply -f <sample>.yaml
Related topics
  • Kubernetes/OpenShift monitoring

    Monitor Kubernetes/OpenShift with Dynatrace.