<p>I'm trying to get my kubernetes cluster to trigger a MemoryPressure state, for the purpose of testing, and I can't seem to get it to happen.  Even when I'm getting the Warning "Out of Memory", running
  kubectl describe pod
still shows MemoryPressure == false.</p>

<p>I did this by creating a deployment that is running containers that do:
   stress-ng -m 4 --vm-bytes 800M --vm-keep</p>

<p>And I keep scaling until I see Out of Memory -- but still no MemoryPressure flag!</p>

<p>I have tried this on KIND and Minikube with no success.  Any ideas?</p>

<p><code>MemoryPressure</code> is a node metrics. You could run the <code>stress</code> command on the node directly to create an artificial memory pressure on the node. Kubelet will notice this(with a caveat) and should report that the node is under <code>MemoryPressure</code>.</p>

<p>The caveat as per the <a href="https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/#kubelet-may-not-observe-memory-pressure-right-away" rel="nofollow noreferrer">doc</a> is</p>

<blockquote>
  <p>The kubelet currently polls cAdvisor to collect memory usage stats at
  a regular interval. If memory usage increases within that window
  rapidly, <strong>the kubelet may not observe MemoryPressure fast enough, and
  the OOMKiller will still be invoked</strong>. We intend to integrate with the
  memcg notification API in a future release to reduce this latency, and
  instead have the kernel tell us when a threshold has been crossed
  immediately</p>
</blockquote>
