kind: Deployment
apiVersion: apps/v1
metadata:
  name: etlflow-test
  namespace: dev
  labels:
    app: etlflow-test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: etlflow-test
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/path: /etlflow/metrics
        prometheus.io/port: "8080"
        git_commit_hash: gsha_abc1234
      labels:
        app: etlflow-test
    spec:
      volumes:
        - name: etlflow-test
          secret:
            secretName: etlflow-test
      containers:
        - name: etlflow-test
          image: etlflow-examples
          imagePullPolicy: Always
          env:
            - name: LOG_DB_URL
              value: 'jdbc:postgresql://postgres:5432/etlflow'
            - name: LOG_DB_USER
              value: etlflow
            - name: LOG_DB_PWD
              value: etlflow
            - name: LOG_DB_DRIVER
              value: org.postgresql.Driver
            - name: JAVA_TOOL_OPTIONS
              value: -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
            - name: JAVA_OPTS
              value: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.rmi.port=9010 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.local.only=false -Datsso.log.level=SEVERE -Djava.awt.headless=true -Xmx1g -Xms500m
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: /opt/docker/conf/cred.json
          resources:
            limits:
              cpu: "2"
              memory: "3Gi"
            requests:
              cpu: "1"
              memory: "1Gi"
          ports:
            - containerPort: 8080
              name: http
            - containerPort: 8000
              name: debug
            - containerPort: 9010
              name: monitor
          volumeMounts:
            - name: etlflow-test
              mountPath: /opt/docker/conf/cred.json
              subPath: cred.json