apiVersion: apps/v1
kind: Deployment
metadata:
  name: dynatrace-oneagent-operator
  namespace: dynatrace
  labels:
    dynatrace: operator
    operator: oneagent
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      name: dynatrace-oneagent-operator
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        name: dynatrace-oneagent-operator
        dynatrace: operator
        operator: oneagent
    spec:
      containers:
        - name: dynatrace-oneagent-operator
          image: docker.io/dynatrace/dynatrace-oneagent-operator:snapshot
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: RELATED_IMAGE_DYNATRACE_ONEAGENT
              value: registry.connect.redhat.com/dynatrace/oneagent
          ports:
            - containerPort: 60000
              name: metrics
          resources:
            requests:
              cpu: 10m
              memory: 64Mi
            limits:
              cpu: 100m
              memory: 256Mi
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: beta.kubernetes.io/arch
                    operator: In
                    values:
                      - amd64
                      - arm64
                  - key: beta.kubernetes.io/os
                    operator: In
                    values:
                      - linux
              - matchExpressions:
                  - key: kubernetes.io/arch
                    operator: In
                    values:
                      - amd64
                      - arm64
                  - key: kubernetes.io/os
                    operator: In
                    values:
                      - linux
      serviceAccountName: dynatrace-oneagent-operator
