Deploy ActiveGate in OpenShift

Starting with ActiveGate version 1.207, activating Kubernetes API monitoring for OpenShift is available inside an OpenShift cluster, which provides consistent, cloud-native deployment strategies for all Dynatrace components.

Prerequisites

Deploy ActiveGate

To deploy an ActiveGate in your Kubernetes cluster

  1. Create a dedicated namespace.
oc adm new-project --node-selector="" dynatrace
  1. Create a secret holding the environment URL and login credentials for this registry.

Example command:

oc -n dynatrace create secret docker-registry dynatrace-docker-registry --docker-server=<YOUR_ENVIRONMENT_URL> --docker-username=<YOUR_ENVIRONMENTID> --docker-password=<YOUR_PAAS_TOKEN> -n dynatrace

where you need to replace

  • <YOUR_ENVIRONMENT_URL> with your environment URL (without 'http'). Example: environment.live.dynatrace.com.
  • <YOUR_ENVIRONMENTID> with the Docker account username (same as the ID in your environment URL above)
  • <YOUR_PAAS_TOKEN> with the PaaS token you created in Prerequisites.
  1. Create a file named ag.yaml with the following content, making sure to replace
  • <YOUR_ENVIRONMENT_URL> with your own value as described above
  • <ANY_UNIQUE_ID> with any unique value. This ID will be used by the ActiveGate to generate a unique name in the UI.
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: dynatrace-activegate-kubernetes-monitoring
  namespace: dynatrace
  labels:
    activegate: kubernetes-monitoring
spec:
  serviceName: ""
  selector:
    matchLabels:
      activegate: kubernetes-monitoring
  template:
    metadata:
      labels:
        activegate: kubernetes-monitoring
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: beta.kubernetes.io/arch
                operator: In
                values:
                - amd64
              - key: beta.kubernetes.io/os
                operator: In
                values:
                - linux
            - matchExpressions:
              - key: kubernetes.io/arch
                operator: In
                values:
                - amd64
              - key: kubernetes.io/os
                operator: In
                values:
                - linux
      containers:
      - name: activegate
        image: <YOUR_ENVIRONMENT_URL>/linux/activegate
        imagePullPolicy: Always
        env:
        - name: DT_ID_SEED_NAMESPACE
          value: dynatrace
        - name: DT_ID_SEED_K8S_CLUSTER_ID
          value: <ANY_UNIQUE_ID>
        args:
        - --enable=kubernetes_monitoring
        livenessProbe:
          failureThreshold: 2
          httpGet:
            path: /rest/state
            port: 9999
            scheme: HTTPS
          initialDelaySeconds: 30
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 1
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /rest/health
            port: 9999
            scheme: HTTPS
          initialDelaySeconds: 30
          periodSeconds: 15
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          limits:
            cpu: 300m
            memory: 1G
          requests:
            cpu: 150m
            memory: 250M
      imagePullSecrets:
      - name: dynatrace-docker-registry
  updateStrategy:
    type: RollingUpdate
  1. Deploy ActiveGate.
oc apply -f ag.yaml
  1. Set up Kubernetes integration.