# RabbitMQ Cluster Operator
#
# Copyright 2020 VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Mozilla Public license, Version 2.0 (the "License").  You may not use this product except in compliance with the Mozilla Public License.
#
# This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
#

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: operator
  namespace: system
  labels:
    app.kubernetes.io/name: rabbitmq-cluster-operator
    app.kubernetes.io/component: rabbitmq-operator
    app.kubernetes.io/part-of: rabbitmq
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: rabbitmq-cluster-operator
  replicas: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: rabbitmq-cluster-operator
        app.kubernetes.io/component: rabbitmq-operator
        app.kubernetes.io/part-of: rabbitmq
    spec:
      serviceAccountName: rabbitmq-cluster-operator
      containers:
      - command:
        - /manager
        image: controller:latest
        name: operator
        resources:
          limits:
            cpu: 200m
            memory: 500Mi
          requests:
            cpu: 200m
            memory: 500Mi
        env:
          - name: OPERATOR_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        ports:
        - containerPort: 9782
          name: metrics
          protocol: TCP
      terminationGracePeriodSeconds: 10
