apiVersion: apps/v1
kind: Deployment

metadata:
  labels:
    app: analyzer
  name: analyzer

spec:
  replicas: 1
  selector:
    matchLabels:
      app: analyzer
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: analyzer
    spec:
      containers:
        - name: presidio
          image: mcr.microsoft.com/presidio-analyzer:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 3001
              protocol: TCP
              name: grpc
          envFrom:
            - configMapRef:
                name: analyzer
            - configMapRef:
                name: common
            - secretRef:
                name: analyzer
          env:
            - name: PRESIDIO_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: GRPC_PORT
              value: "3001"
          resources:
            limits:
              cpu: "2"
              memory: 3000Mi
            requests:
              cpu: 1500m
              memory: 1500Mi
      restartPolicy: Always
