apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: thp-disable
spec:
  selector:
    matchLabels:
      name: thp-disable
  template:
    metadata:
      labels:
        name: thp-disable
    spec:
      restartPolicy: Always
      terminationGracePeriodSeconds: 1
      volumes:
      - name: host-sys
        hostPath:
          path: /sys
      initContainers:
      - name: disable-thp
        image: busybox
        volumeMounts:
        - name: host-sys
          mountPath: /host-sys
        command: ["sh", "-c", "echo never >/host-sys/kernel/mm/transparent_hugepage/enabled"]
      containers:
      - name: busybox
        image: busybox
        command: ["watch", "-n", "600", "cat", "/sys/kernel/mm/transparent_hugepage/enabled"]