apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: tibco-ems-operator
  name: tibco-ems-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tibco-ems-operator
  template:
    metadata:
      labels:
        app: tibco-ems-operator
    spec:
      serviceAccountName: tibco-ems-operator-account
      containers:
      - name: tibco-ems-operator
        image: gcr.io/apimeister/tibco-ems-operator:latest
        imagePullPolicy: Always
        resources:
          requests:
            memory: "20Mi"
            cpu: "50m"
          limits:
            memory: "50Mi"
            cpu: "1000m"
        ports:
          - containerPort: 8080
        env:
          - name: KUBERNETES_SERVICE_HOST
            value: kubernetes.default.svc.cluster.local
          - name: RUST_LOG
            value: tibco_ems=info,tibco_ems_operator=trace,info
          - name: STATUS_REFRESH_IN_MS
            value: "10000"
          - name: ENABLE_SCALING
            value: "TRUE"
          - name: KUBERNETES_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: SERVER_URL
            valueFrom:
              secretKeyRef:
                name: tibco-ems-operator-secret
                key: serverUrl
          - name: USERNAME
            valueFrom:
              secretKeyRef:
                name: tibco-ems-operator-secret
                key: username
          - name: PASSWORD
            valueFrom:
              secretKeyRef:
                name: tibco-ems-operator-secret
                key: password
