apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: aistarget
spec:
  selector:
    matchLabels:
      app: aistarget-app
  serviceName: "aistarget-app"
  replicas: 1
  template:
    metadata:
      labels:
        app: aistarget-app
    spec:
      containers:
      - name: aistarget
        image: ${DOCKER_HOST_IP}:5000/ais:v1
        env:
         - name: ROLE
           value: "target"
        volumeMounts:
         - name: ais-config
           mountPath: /aisconfig/ais.json
           subPath: ais.json
         - name: collectd-config
           mountPath: /etc/collectd/collectd.conf
           subPath: collectd.conf
         - name: statsd-config
           mountPath: /opt/statsd/statsd.conf
           subPath: statsd.conf
         - name: aws-credentials
           mountPath: /root/.aws/
         - name: ais-fs
           mountPath: /usr/nvidia/data
         - name: ais-log
           mountPath: /tmp/
        ports:
          - containerPort: 8080
      nodeSelector:
          nodename: ais-target
      volumes:
        - name: ais-config
          configMap:
            name: ais-config
        - name: collectd-config
          configMap:
            name: collectd-config
        - name: statsd-config
          configMap:
            name: statsd-config
        - name: aws-credentials
          secret:
            secretName: aws-credentials
        - name: ais-fs
          hostPath:
            path: /ais
            type: Directory
        - name: ais-log
          hostPath:
            path: /tmp
            type: Directory
