apiVersion: apps/v1
kind: Deployment
metadata:
  name: audit-log
  namespace: oih-dev-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: audit-log
  template:
    metadata:
      labels:
        app: audit-log
    spec:
      containers:
      - name: audit-log
        image: openintegrationhub/audit-log:latest
        ports:
        - containerPort: 3007
        env:
        - name: MONGODB_URL
          valueFrom:
            secretKeyRef:
              name: shared-secret
              key: "auditLogMongourl"
        - name: IAM_TOKEN
          valueFrom:
            secretKeyRef:
              name: shared-secret
              key: "iamtoken"
        - name: "INTROSPECT_TYPE"
          value: "basic"
        - name: "INTROSPECT_ENDPOINT_BASIC"
          value: "http://iam.oih-dev-ns.svc.cluster.local:3099/api/v1/tokens/introspect"
        - name: "QUEUE_URL"
          value: "amqp://guest:guest@rabbitmq-service.oih-dev-ns.svc.cluster.local:5672"
        - name: "EXCHANGE_NAME"
          value: "audit-logs"
        - name: "EXCHANGE_TOPIC"
          value: "logs"
        resources:
          limits:
            cpu: "0.1"
            memory: 1000Mi
        livenessProbe:
          httpGet:
            port: 3007
            path: /healthcheck
          initialDelaySeconds: 120
          timeoutSeconds: 1
        readinessProbe:
          httpGet:
            port: 3007
            path: /healthcheck
          initialDelaySeconds: 10
          timeoutSeconds: 1
        imagePullPolicy: Always
