apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: datasentinel-agent
  namespace: default
spec:
  serviceName: datasentinel-agent-service
  selector:
    matchLabels:
      app: datasentinel-agent
  replicas: 1
  template:
    metadata:
      labels:
        app: datasentinel-agent
    spec:
      securityContext:
          fsGroup: 2000
          runAsNonRoot: true
          runAsUser: 1001
      containers:
      - name: datasentinel-agent
        image: datasentinel/datasentinel-agent:latest
        imagePullPolicy: Always
        env:
          - name: DATASENTINEL_AGENT_HOST
            value: LOADBALANCER_IP
          - name: DATASENTINEL_AGENT_PORT
            value: '8384'
        ports:
          - containerPort: 8384
        volumeMounts:
          - name: datasentinel-agent-config-volume
            mountPath: /agent/config
            readOnly: false
  volumeClaimTemplates:
    - metadata:
        name: datasentinel-agent-config-volume
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 1Gi
