apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  name: fedmsg
  labels:
    app: fedmsg
spec:
  replicas: 1
  selector:
    app: fedmsg
  template:
    metadata:
      labels:
        app: fedmsg
    spec:
      containers:
      - image: image-registry.openshift-image-registry.svc:5000/mote/mote
        name: fedmsg
        command:
        - python
        - -m
        - mote.consume
        env:
        - name: REDIS_URL
          value: "redis://redis.{{ app }}.svc.cluster.local"
        - name: REDIS_PASSWORD
          valueFrom:
            secretKeyRef:
              name: redis-password
              key: password
        - name: FLASK_CACHE_TYPE
          value: RedisCache
        imagePullPolicy: IfNotPresent
        volumeMounts:
        - mountPath: /etc/fedora-messaging/config.py
          name: fedmsg-config
          readOnly: true
          subPath: config.toml
        resources:
          limits:
            cpu: 100m
            memory: 100Mi
          requests:
            cpu: '0'
            memory: 50Mi
      volumes:
      - configMap:
          defaultMode: 420
          name: fedora-messaging
        name: fedmsg-config
      restartPolicy: Always
  triggers:
  - type: ConfigChange
  - type: ImageChange
    imageChangeParams:
      automatic: true
      from:
        kind: ImageStreamTag
        name: mote:latest
      containerNames:
      - "fedmsg"
