apiVersion: apps/v1
kind: Deployment
metadata:
  name: cluster-agent
  namespace: cluster-agent-e2e
  labels:
    app: cluster-agent
    app.kubernetes.io/name: cluster-agent
    app.kubernetes.io/part-of: cluster-agent
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cluster-agent
  template:
    metadata:
      labels:
        app: cluster-agent
    spec:
      serviceAccountName: cluster-agent
      containers:
        - name: cluster-agent
          image: cluster-agent:e2e
          imagePullPolicy: Never
          command:
            - /cluster-agent
          args:
            - "-provider"
            - "kind"
            - "-addr"
            - ":8080"
            - "-internal-grpc-addr"
            - "127.0.0.1:8081"
            - "-audit-enabled"
            - "-audit-file-path"
            - "/tmp/audit.log"
            - "-audit-max-body-size"
            - "1024"
            - "-audit-include-get-requests"
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 10
            timeoutSeconds: 3
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 3
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 6
          resources:
            requests:
              memory: "64Mi"
              cpu: "20m"
            limits:
              memory: "256Mi"
              cpu: "200m"
          securityContext:
            allowPrivilegeEscalation: false
