---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: resource-service
  namespace: keptn
  labels:
    app.kubernetes.io/name: resource-service
    app.kubernetes.io/instance: keptn
    app.kubernetes.io/part-of: keptn-keptn
    app.kubernetes.io/component: control-plane
    app.kubernetes.io/version: develop
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: resource-service
      app.kubernetes.io/instance: keptn
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: resource-service
        app.kubernetes.io/instance: keptn
        app.kubernetes.io/part-of: keptn-keptn
        app.kubernetes.io/component: control-plane
        app.kubernetes.io/version: develop
    spec:
      serviceAccountName: keptn-configuration-service
      containers:
        - name: resource-service
        # livenessProbe:
        #   httpGet:
        #     path: /health
        #     port: 8080
        #   initialDelaySeconds: 10
        #   periodSeconds: 5
        # readinessProbe:
        #   httpGet:
        #     path: /health
        #     port: 8080
        #   initialDelaySeconds: 10
        #   periodSeconds: 5
          image: keptndev/resource-service:latest
          env:
            - name: EVENTBROKER
              value: 'http://localhost:8081/event'
            - name: PREFIX_PATH
              value: ""
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: DATASTORE_URI
              value: mongodb-datastore:8080
            - name: LOG_LEVEL
              value: "debug"
          ports:
          - containerPort: 8080
          resources:
            requests:
              memory: "32Mi"
              cpu: "25m"
            limits:
              # limits is high on purpose to enable Debugging using skaffold
              # you can monitor memory usage using "kubectl -n keptn top pods"
              memory: "512Mi"
              cpu: "100m"
          volumeMounts:
          - mountPath: /data/config
            name: resource-volume
      volumes:
      - name: resource-volume
        emptyDir: {}
