<p>I have an application that ICMP Pings out to IP addresses from GCP K8s running on AutoPilot.</p>
<p>I tried setting the below first but it turns out GCP K8s on AutoPilot disable that permission if you add it.</p>
<pre><code> securityContext:
    capabilities:
      add: [&quot;NET_RAW&quot;]
</code></pre>
<p>Next I tried setting net.ipv4.ping_group_range like the below in my deployment file.</p>
<pre><code>  securityContext:
    runAsNonRoot: true 
    seccompProfile: 
      type: RuntimeDefault
    sysctls:
    - name: kernel.shm_rmid_forced
      value: &quot;1&quot;
    - name: net.ipv4.ping_group_range
      value: &quot;0           200000000&quot;
</code></pre>
<p>But the above gives me the error below when I try and deploy it.</p>
<pre><code>strict decoding error: unknown field &quot;spec.template.spec.containers[0].securityContext.sysctls&quot;
</code></pre>
<p>I've also tried</p>
<pre><code>  command: [&quot;/bin/sh&quot;]
  args:
    - -c
    - sysctl -w net.ipv4.ping_group_range=0 2000000
</code></pre>
<p>In my deployment file but that gives me an error of permission denied when the container tries to start.</p>
<p>Is it possible to ICMP Ping an IP address from a GCP K8 AutoPilot cluster or how do I apply sysctl -w net.ipv4.ping_group_range correctly?</p>

Mr J
<p>GKE Autopilot clusters always use <a href="https://cloud.google.com/container-optimized-os/docs/concepts/features-and-benefits#limitations" rel="nofollow noreferrer">Container-Optimized OS</a> with containerd as their node image. The Container-Optimized OS kernel is locked down in autopilot clusters so that you cannot perform write operations on it as it is constrained to only read-only mode.</p>
<p>Therefore the cluster is disabling permissions to set some values to the parameters in the kernel, as the kernel is locked-down.</p>
<p>In order to modify the attributes according to your need, you can use a <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-zonal-cluster" rel="nofollow noreferrer"><strong>GKE Standard Cluster</strong></a> which provides flexibility.</p>
