I'm trying to execute on the node kubelet --allowed-unsafe-sysctls 'net.core.somaxconn'
but return Flag --allowed-unsafe-sysctls has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
I also tried using PodSecurityPolicy, but it still doesn't work
apiVersion: v1
kind: PodSecurityPolicy
metadata:
name: sysctl-psp
spec:
sysctls:
- net.*
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
runAsUser:
rule: RunAsAny
fsGroup:
rule: RunAsAny
I received the following error:
forbidden sysctl: "net.core.somaxconn" not whitelisted
yaml detailed:
apiVersion: v1
kind: Pod
metadata:
name: sysctl-example
spec:
securityContext:
sysctls:
- name: net.core.somaxconn
value: "65535"
unsafe: true
containers:
- image: tomcat
name: tomcat