# a simple daemonset to tune sysctls
# intended to be used in a prow build cluster
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: tune-sysctls
  namespace: kube-system
  labels:
    app: tune-sysctls
spec:
  selector:
    matchLabels:
      name: tune-sysctls
  template:
    metadata:
      labels:
        name: tune-sysctls
    spec:
      hostNetwork: true
      hostPID: true
      hostIPC: true
      tolerations:
      - operator: Exists
        effect: NoSchedule
      containers:
      - name: setsysctls
        command:
        - sh
        - -c
        - |
          while true; do
            sysctl -w fs.inotify.max_user_watches=1048576
            sysctl -w fs.inotify.max_user_instances=8192
            sleep 10
          done
        image: gcr.io/k8s-staging-test-infra/alpine:latest
        imagePullPolicy: IfNotPresent
        resources: {}
        securityContext:
          privileged: true
        volumeMounts:
        - name: sys
          mountPath: /sys
      volumes:
      - name: sys
        hostPath:
          path: /sys
