I am trying to modify the kernel.core_pattern but I am unable to modify it as it is Read-Only.
I have tried:
> echo 'kernel.core_pattern=/tmp/core-%e.%p.%h.%t' >> /etc/sysctl.conf
> Reload sysctl: sysctl --system
Applying /etc/sysctl.conf ... sysctl: setting key "kernel.core_pattern": Read-only file system cat /proc/sys/kernel/core_pattern
I am no able to add it to the pod yaml either:
spec:
securityContext:
sysctls:
- name: kernel.core_pattern
value: "/tmp/core-%e.%p.%h.%t"
I keep getting this: SysctlForbidden
I created a PodSecurityPolicy as well:
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: sysctl-psp
spec:
privileged: false # Don't allow privileged pods!
# The rest fills in some required fields.
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
runAsUser:
rule: RunAsAny
fsGroup:
rule: RunAsAny
allowedUnsafeSysctls:
- kernel.*
Still no luck.
Any suggestions?
I was able to edit the kernel.core_pattern on the nodes in the cluster and that was reflected in the pods as well. But is a temporary work around as the core files generated are of zero size.