---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: classifier
  labels:
    name: classifier
    app: classifier
spec:
  revisionHistoryLimit: 3
  replicas: 1
  selector:
    matchLabels:
      app: classifier
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "7070"
      labels:
        app: classifier
    spec:
      terminationGracePeriodSeconds: 60
      containers:
      - name: classifier
        image: docker.io/saidsef/ml-classifier:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 7070
          protocol: TCP
          name: http
        resources:
          requests:
           memory: "512Mi"
           cpu: "50m"
          limits:
            memory: "1Gi"
            cpu: "100m"
        livenessProbe:
          tcpSocket:
            port: 7070
          initialDelaySeconds: 5
          periodSeconds: 5
          failureThreshold: 3
          successThreshold: 1
          timeoutSeconds: 3
        readinessProbe:
          httpGet:
            path: /metrics
            port: 7070
          initialDelaySeconds: 10
          periodSeconds: 5
          failureThreshold: 3
          successThreshold: 1
          timeoutSeconds: 3
        securityContext:
          allowPrivilegeEscalation: false
          privileged: false
          runAsGroup: 65534
          runAsUser: 65534
          runAsNonRoot: true
          readOnlyRootFilesystem: true
          capabilities:
            drop:
              - ALL
            add:
              - NET_BIND_SERVICE
              - SYS_TIME
