<p>I have kubernetes cluster set up of 1 master and 1 worker node.For testing purpose , I increased CPU Utlization and memory utilization upto 100%, but stilling Node is not getting status "NotReady".
I am testing Pressure Status .. How to change status flag of MemoryPressure to true or DiskPressure or PIDPressure to true</p>

<p>Here are my master node condtions :-</p>

<p>Conditions:</p>

<pre><code> Type                 Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----                 ------  -----------------                 ------------------                ------                       -------
  NetworkUnavailable   False   Wed, 27 Nov 2019 14:36:29 +0000   Wed, 27 Nov 2019 14:36:29 +0000   WeaveIsUp                    Weave pod has set this
  MemoryPressure       False   Thu, 28 Nov 2019 07:36:46 +0000   Fri, 22 Nov 2019 13:30:38 +0000   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure         False   Thu, 28 Nov 2019 07:36:46 +0000   Fri, 22 Nov 2019 13:30:38 +0000   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure          False   Thu, 28 Nov 2019 07:36:46 +0000   Fri, 22 Nov 2019 13:30:38 +0000   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready                True    Thu, 28 Nov 2019 07:36:46 +0000   Fri, 22 Nov 2019 13:30:48 +0000   KubeletReady                 kubelet is posting ready status
</code></pre>

<p>Here are pods info :-</p>

<pre><code>Non-terminated Pods:         (8 in total)
  Namespace                  Name                                                                   CPU Requests  CPU Limits  Memory Requests  Memory Limits  AGE
  ---------                  ----                                                                   ------------  ----------  ---------------  -------------  ---
  kube-system                coredns-5644d7b6d9-dm8v7                                               100m (5%)     0 (0%)      70Mi (0%)        170Mi (2%)     22d
  kube-system                coredns-5644d7b6d9-mz5rm                                               100m (5%)     0 (0%)      70Mi (0%)        170Mi (2%)     22d
  kube-system                etcd-ip-172-31-28-186.us-east-2.compute.internal                       0 (0%)        0 (0%)      0 (0%)           0 (0%)         22d
  kube-system                kube-apiserver-ip-172-31-28-186.us-east-2.compute.internal             250m (12%)    0 (0%)      0 (0%)           0 (0%)         22d
  kube-system                kube-controller-manager-ip-172-31-28-186.us-east-2.compute.internal    200m (10%)    0 (0%)      0 (0%)           0 (0%)         22d
  kube-system                kube-proxy-cw8vv                                                       0 (0%)        0 (0%)      0 (0%)           0 (0%)         22d
  kube-system                kube-scheduler-ip-172-31-28-186.us-east-2.compute.internal             100m (5%)     0 (0%)      0 (0%)           0 (0%)         22d
  kube-system                weave-net-ct9zb                                                        20m (1%)      0 (0%)      0 (0%)           0 (0%)         22d
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests    Limits
  --------           --------    ------
  cpu                770m (38%)  0 (0%)
  memory             140Mi (1%)  340Mi (4%)
  ephemeral-storage  0 (0%)      0 (0%)
</code></pre>

<p>Here for worker node :-</p>

<pre><code>Conditions:
  Type                 Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----                 ------  -----------------                 ------------------                ------                       -------
  NetworkUnavailable   False   Thu, 28 Nov 2019 07:00:08 +0000   Thu, 28 Nov 2019 07:00:08 +0000   WeaveIsUp                    Weave pod has set this
  MemoryPressure       False   Thu, 28 Nov 2019 07:39:03 +0000   Thu, 28 Nov 2019 07:00:00 +0000   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure         False   Thu, 28 Nov 2019 07:39:03 +0000   Thu, 28 Nov 2019 07:00:00 +0000   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure          False   Thu, 28 Nov 2019 07:39:03 +0000   Thu, 28 Nov 2019 07:00:00 +0000   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready                True    Thu, 28 Nov 2019 07:39:03 +0000   Thu, 28 Nov 2019 07:00:00 +0000   KubeletReady                 kubelet is posting ready status
</code></pre>

Dhanraj
<p>There are several ways of making a node to get into NotReady status, but not through Pods. When a Pod starts to consume too much memory kubelet will just kill that pod, to precisely protect the node.</p>

<p>I guess you want to test what happens when a node goes down, in that case you want to drain it. In other words, to simulate node issues, you should do:</p>

<p><code>kubectl drain NODE</code></p>

<p>Still, check on <code>kubectl drain --help</code> to see under what circumstances what happens.</p>

<p><strong>EDIT</strong></p>

<p>I tried, actually, accessing the node and running stress on the node directly, and this is what happened within 20 seconds:</p>

<pre><code>root@gke-klusta-lemmy-3ce02acd-djhm:/# stress --cpu 16 --io 8 --vm 8 --vm-bytes 2G
</code></pre>

<p>Checking on the node:</p>

<pre><code>$ kubectl get no -w | grep gke-klusta-lemmy-3ce02acd-djhm
gke-klusta-lemmy-3ce02acd-djhm   Ready    &lt;none&gt;   15d     v1.13.11-gke.14
gke-klusta-lemmy-3ce02acd-djhm   Ready   &lt;none&gt;   15d   v1.13.11-gke.14
gke-klusta-lemmy-3ce02acd-djhm   NotReady   &lt;none&gt;   15d   v1.13.11-gke.14
gke-klusta-lemmy-3ce02acd-djhm   NotReady   &lt;none&gt;   15d   v1.13.11-gke.14
gke-klusta-lemmy-3ce02acd-djhm   NotReady   &lt;none&gt;   15d   v1.13.11-gke.14
</code></pre>

<p>I am running pretty weak nodes. 1CPU@4GB RAM</p>
