apiVersion: v1
kind: Namespace
metadata:
  labels:
    control-plane: controller-manager
  name: system
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager
  namespace: system
  labels:
    control-plane: controller-manager
spec:
  selector:
    matchLabels:
      control-plane: controller-manager
      name: amq-broker-operator
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        control-plane: controller-manager
        name: amq-broker-operator
    spec:
      securityContext:
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      containers:
      - command:
        - /home/amq-broker-operator/bin/entrypoint
        args:
        # Explicitly set the logging level.
        # Valid values are debug, info, and error
        # from most to least.
        # If running entrypoint_debug then use '-- --zap-level debug'
        - --zap-log-level=info
        - --zap-encoder=console
        - --zap-time-encoding=iso8601
        - --leader-elect
        env:
        - name: OPERATOR_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.labels['name']
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
          # to watch all namespaces use '*' or empty ''
          # to watch multiple namespaces use comma separated list 'ns1,ns2'
          # default is to watch the operator's namespace (backward compatibility)
        - name: WATCH_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: ENABLE_WEBHOOKS
          value: "false"
        image: registry.redhat.io/amq7/amq-broker-rhel9-operator@sha256:8f4431d72e6fed9dc535f7db273ebc11b0c7809ea7ffa59ff687e74210b70144
        # imagePullPolicy: Always
        name: manager
        ports:
        - name: http-metrics
          containerPort: 8383
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8081
          initialDelaySeconds: 15
          periodSeconds: 20
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8081
          initialDelaySeconds: 5
          periodSeconds: 10
        resources:
          limits:
            cpu: 1000m
            memory: 384Mi
          requests:
            cpu: 200m
            memory: 128Mi
        terminationMessagePolicy: FallbackToLogsOnError
      serviceAccountName: controller-manager
      terminationGracePeriodSeconds: 10
