apiVersion: apps/v1 kind: DaemonSet metadata: name: hyperthreading-off namespace: kube-system labels: app.kubernetes.io/name: "hyperthreading-off" spec: selector: matchLabels: app.kubernetes.io/name: "hyperthreading-off" template: metadata: labels: app.kubernetes.io/name: "hyperthreading-off" name: "hyperthreading-off" spec: hostPID: true hostNetwork: true #nodeSelector: #beta.kubernetes.io/instance-type: "p4d.24xlarge" #processor: gpu initContainers: - name: "installer" image: "ubuntu:20.04" #command: ["bash", "-c", "while true; do date; sleep 10; done"] command: ["nsenter", "--target", "1", "--mount", "--uts", "--ipc", "--net", "--pid", "--","bash", "-c", "echo off > /sys/devices/system/cpu/smt/control"] securityContext: privileged: true runAsNonRoot: false runAsUser: 0 containers: - name: "heartbeat" image: "ubuntu:20.04" command: ["bash", "-c", "while true; do echo Hyperthreading is OFF at $(date); sleep 60; done"]