apiVersion: apps/v1
kind: Deployment
metadata:
  name: dynatrace-operator
  namespace: dynatrace
  labels:
    dynatrace: operator
    operator: dynakube
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      name: dynatrace-operator
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        name: dynatrace-operator
        dynatrace: operator
        operator: dynakube
    spec:
      containers:
        - name: dynatrace-operator
          args:
            - operator
          image: quay.io/dynatrace/dynatrace-operator:snapshot
          imagePullPolicy: Always
          env:
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
          ports:
            - containerPort: 8080
              name: metrics
            - containerPort: 10080
              name: server-port
          resources:
            requests:
              cpu: 50m
              memory: 64Mi
            limits:
              cpu: 100m
              memory: 256Mi
          readinessProbe:
            httpGet:
              path: /healthz
              port: server-port
              scheme: HTTP
            initialDelaySeconds: 15
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /healthz
              port: server-port
              scheme: HTTP
            initialDelaySeconds: 15
            periodSeconds: 10
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/arch
                    operator: In
                    values:
                      - amd64
                      - arm64
                  - key: kubernetes.io/os
                    operator: In
                    values:
                      - linux
      serviceAccountName: dynatrace-operator
