Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

kubernetes 修改内核参数

Code Block
使用 pod 的 initContainers:
      initContainers:
      - command:
        - sysctl
        - -w
        - net.ipv4.tcp_timestamps=0
        image: busybox
        name: init-sysctl
        securityContext:
          privileged: true
Code Block
       initContainers:
      - command:
        - /bin/sh
        - -c
        - |
          ulimit -n 65536
          mount -o remount rw /sys
          echo never > /sys/kernel/mm/transparent_hugepage/enabled
          mount -o remount rw /proc/sys
          echo 2000 > /proc/sys/net/core/somaxconn
          echo 1 > /proc/sys/vm/overcommit_memory
        image: registry.cn-beijing.aliyuncs.com/acs/busybox:v1.29.2
        imagePullPolicy: IfNotPresent
        name: init-redis
        resources: {}
        securityContext:
          privileged: true
          procMount: Default