apiVersion: v1
kind: Service
metadata:
  labels: {app: bexhoma, component: sut, configuration: default, experiment: default}
  name: bexhoma-service
spec:
  ports:
  - {port: 9091, protocol: TCP, name: port-dbms, targetPort: 5432}
  - {port: 9300, protocol: TCP, name: port-monitoring, targetPort: 9300}
  selector: {app: bexhoma, component: sut, configuration: default, experiment: default}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels: {app: bexhoma, component: sut, configuration: default, experiment: default}
  name: bexhoma-deployment-dummy
spec:
  replicas: 1
  selector:
    matchLabels: {app: bexhoma, component: sut, configuration: default, experiment: default}
  template:
    metadata:
      labels: {app: bexhoma, component: sut, configuration: default, experiment: default}
    spec:
      automountServiceAccountToken: false
      imagePullSecrets:
      - {name: dockerhub}
      nodeSelector:
      tolerations:
      #- key: "nvidia.com/gpu"
      #  effect: "NoSchedule"
      containers:
      - name: dbms
        image: busybox
        command:
          - sleep
          - "infinity"
        ports:
        - {containerPort: 5432}
        resources:
          limits: {cpu: 100m, memory: 100Mi}
          requests: {cpu: 100m, memory: 100Mi}
        volumeMounts:
        - {mountPath: /data, name: benchmark-data-volume}
      - name: cadvisor
        image: gcr.io/cadvisor/cadvisor:v0.47.0
        args: ["--port", "9300", "--storage_duration", "20m0s", "--docker_only", "true", "--disable_metrics", "disk,network,tcp,advtcp,udp,sched,process,hugetlb", "--application_metrics_count_limit", "30", "--housekeeping_interval", "5s"]
        ports:
        - containerPort: 9300
          #hostPort: 9300
          name: http
          protocol: TCP
        resources:
          requests:
            cpu: 150m
            memory: 200Mi
        volumeMounts:
        - name: rootfs
          mountPath: /rootfs
          readOnly: true
        - name: var-run
          mountPath: /var/run
          readOnly: true
        - name: sys
          mountPath: /sys
          readOnly: true
        - name: docker
          mountPath: /var/lib/docker
          readOnly: true
        - name: disk
          mountPath: /dev/disk
          readOnly: true
      volumes:
      - name: benchmark-data-volume
        persistentVolumeClaim: {claimName: bexhoma-data}
      - name: rootfs
        hostPath:
          path: /
      - name: var-run
        hostPath:
          path: /var/run
      - name: sys
        hostPath:
          path: /sys
      - name: docker
        hostPath:
          path: /var/lib/docker
      - name: disk
        hostPath:
          path: /dev/disk
      - name: dshm
        emptyDir:
          medium: Memory
