apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: enmasse
    name: address-space-controller
  name: address-space-controller
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: enmasse
      name: address-space-controller
  template:
    metadata:
      labels:
        app: enmasse
        name: address-space-controller
    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 1
              preference:
                matchExpressions:
                  - key: node-role.enmasse.io/operator-infra
                    operator: In
                    values:
                      - "true"
      containers:
      - env:
        - name: JAVA_OPTS
          value: -verbose:gc
        - name: ENABLE_EVENT_LOGGER
          value: "true"
        - name: EXPOSE_ENDPOINTS_BY_DEFAULT
          valueFrom:
            configMapKeyRef:
              key: exposeEndpointsByDefault
              name: address-space-controller-config
              optional: true
        - name: ENVIRONMENT
          valueFrom:
            configMapKeyRef:
              key: environment
              name: address-space-controller-config
              optional: true
        - name: TEMPLATE_DIR
          value: /opt/templates
        - name: RESOURCES_DIR
          value: /opt
        - name: STANDARD_AUTHSERVICE_CONFIG_NAME
          value: keycloak-config
        - name: STANDARD_AUTHSERVICE_CREDENTIALS_SECRET_NAME
          value: keycloak-credentials
        - name: STANDARD_AUTHSERVICE_CERT_SECRET_NAME
          value: standard-authservice-cert
        - name: WILDCARD_ENDPOINT_CERT_SECRET
          valueFrom:
            configMapKeyRef:
              key: wildcardEndpointCertSecret
              name: address-space-controller-config
              optional: true
        - name: RESYNC_INTERVAL
          valueFrom:
            configMapKeyRef:
              key: resyncInterval
              name: address-space-controller-config
              optional: true
        - name: RECHECK_INTERVAL
          valueFrom:
            configMapKeyRef:
              key: recheckInterval
              name: address-space-controller-config
              optional: true
        - name: IMAGE_PULL_POLICY
          value: Always
        - name: ROUTER_IMAGE
          value: registry.redhat.io/amq7/amq-interconnect:1.4
        - name: STANDARD_CONTROLLER_IMAGE
          value: registry.redhat.io/amq7/amq-online-1-standard-controller:dev
        - name: AGENT_IMAGE
          value: registry.redhat.io/amq7/amq-online-1-agent:dev
        - name: BROKER_IMAGE
          value: registry.redhat.io/amq-broker-7/amq-broker-73-openshift:latest
        - name: BROKER_PLUGIN_IMAGE
          value: registry.redhat.io/amq7/amq-online-1-broker-plugin:dev
        - name: TOPIC_FORWARDER_IMAGE
          value: registry.redhat.io/amq7/amq-online-1-topic-forwarder:dev
        - name: MQTT_GATEWAY_IMAGE
          value: registry.redhat.io/amq7/amq-online-1-mqtt-gateway:dev
        - name: MQTT_LWT_IMAGE
          value: registry.redhat.io/amq7/amq-online-1-mqtt-lwt:dev
        image: registry.redhat.io/amq7/amq-online-1-address-space-controller:dev
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /healthz
            port: http
            scheme: HTTP
        name: address-space-controller
        ports:
        - containerPort: 8080
          name: http
        readinessProbe:
          httpGet:
            path: /healthz
            port: http
            scheme: HTTP
        resources:
          limits:
            memory: 512Mi
          requests:
            memory: 256Mi
      serviceAccountName: address-space-controller
