apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: modprobe-daemonset
spec:
  selector:
    matchLabels:
      name: modprobe-daemonset 
  template:
    metadata:
      labels:
        name: modprobe-daemonset 
    spec:
      containers:
      - name: modprobe
        image: centos:centos7
        command:
        - /bin/sh
        - -c
        - modprobe iptable_nat && lsmod | grep nat && sleep infinity
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /lib/modules
          name: lib-modules
          readOnly: true
      volumes:
      - name: lib-modules
        hostPath:
          path: /lib/modules
      serviceAccount: default
