How to Allow Unsafe Sysctls on a PMK Cluster

Problem

How to Allow Unsafe Sysctls on a PMK Cluster?

Environment

  • Platform9 Managed Kubernetes - All Versions

  • Kubelet

Procedure

  • Depending on whether the change is needed to be done on a single node or all nodes part of the cluster, refer to

How To Change Configuration for Kubelet Service on a Single Worker or Master Node in a PMK Clusterarrow-up-right

OR

How To Change Configuration for Kubelet Service on All Worker or Master Nodes in a PMK Clusterarrow-up-right

  • Stop the pf9-hostagent & pf9-nodeletd services on ALL the worker/master nodes depending on which configmap is being edited.

sudo systemctl stop pf9-{hostagent,nodeletd}
  • Edit the ConfigMap as needed and save it. Here as an example, we are editing it master-default-kubelet-config ConfigMap for the single master node cluster.

# kubectl get configmap master-default-kubelet-config  -n kube-system -o yaml
...
    allowedUnsafeSysctls:
    - "kernel.msg*"
    - "net.core.somaxconn"
  • Start the pf9-hostagent service ALL the worker/master nodes where it was initially stopped.

  • Deployed a pod with security context.

  • Pod has been created and is in running state.

  • If we deploy the same pod on a different cluster which does not have the Kubelet setting for allowedUnsafeSysctls added.

Additional Information

Using sysctls in a Kubernetes Clusterarrow-up-right

Last updated