0%

k8s修改POD内核参数【sysctl】

有时候需要在启动POD前,修改POD内核相关参数,除了使用initContainer还可以使用sysctl
参考链接Using sysctls in a Kubernetes Cluster

apiVersion: v1
kind: Pod
metadata:
  name: sysctl-example
spec:
  securityContext:
    sysctls:
    - name: kernel.shm_rmid_forced
      value: "0"
    - name: net.core.somaxconn
      value: "1024"
    - name: kernel.msgmax
      value: "65536"
  ...