kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: xfs-host-configurer
spec:
  selector:
    matchLabels:
      app: xfs-host-configurer
  template:
    metadata:
      labels:
        app: xfs-host-configurer
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: custom.kubernetes.io/fs-type
                operator: In
                values:
                - "xfs"
      hostPID: true
      containers:
      - name: configurer
        image: gcr.io/google-containers/startup-script:v1
        imagePullPolicy: Always
        securityContext:
          privileged: true
        env:
        - name: STARTUP_SCRIPT
          value: |
            #! /bin/bash
            set -o errexit
            set -o pipefail
            set -o nounset

            echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled
            echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag
        resources:
          requests:
            cpu: 10m
            memory: 30Mi
