apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: vm-max-map-count
  namespace: kube-system
  labels:
    app: vm-max-map-count
spec:
  selector:
    matchLabels:
      app: vm-max-map-count
  template:
    metadata:
      labels:
        app: vm-max-map-count
    spec:
      hostPID: true
      initContainers:
      - name: vm-max-map-count
        image: ubuntu:20.04
        imagePullPolicy: Always
        securityContext:
          privileged: true
        command: ["/bin/bash", "-c"]
        args: ["sysctl -w vm.max_map_count=262144"]
      containers:
      - name: pause
        image: gcr.io/google_containers/pause:3.2