apiVersion: apps/v1
kind: Deployment
metadata:
  name: extraction-service
  namespace: bytelyst-platform
  labels:
    app: extraction-service
    tier: platform
spec:
  replicas: 1
  selector:
    matchLabels:
      app: extraction-service
  template:
    metadata:
      labels:
        app: extraction-service
        tier: platform
    spec:
      containers:
      - name: extraction-service
        image: bytelyst/extraction-service:latest
        imagePullPolicy: Never
        ports:
        - containerPort: 4005
          name: http
        env:
        - name: HOST
          value: "0.0.0.0"
        - name: PORT
          value: "4005"
        - name: NODE_ENV
          value: "production"
        envFrom:
        - configMapRef:
            name: bytelyst-config
        - secretRef:
            name: bytelyst-secrets
        resources:
          requests:
            cpu: "200m"
            memory: "384Mi"
          limits:
            cpu: "1000m"
            memory: "768Mi"
        readinessProbe:
          httpGet:
            path: /health
            port: 4005
          initialDelaySeconds: 15
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /health
            port: 4005
          initialDelaySeconds: 30
          periodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
  name: extraction-service
  namespace: bytelyst-platform
spec:
  selector:
    app: extraction-service
  ports:
  - name: http
    port: 4005
    targetPort: 4005
---
apiVersion: v1
kind: Service
metadata:
  name: extraction-service-external
  namespace: bytelyst-platform
spec:
  type: NodePort
  selector:
    app: extraction-service
  ports:
  - name: http
    port: 4005
    targetPort: 4005
    nodePort: 4005
