<p>I have an OKE k8s cluster in oracle cloud. It has a node pool <code>pool2</code> with only one worker node. This pool was created using terraform.</p>
<p>Now I'm trying to update the memory and cpu for each worker node in the nodepool.
This is the terraform script that I'm using to create the node pool:</p>
<pre><code>resource &quot;oci_containerengine_node_pool&quot; &quot;oke-node-pool&quot; {

    # Required variables
    compartment_id = var.compartment_ocid
    cluster_id = var.oke_cluster_ocid
    kubernetes_version = var.node_pool_kubernetes_version
    name = var.node_pool_name
    node_shape = var.node_pool_node_shape
    # subnet_ids = var.node_pool_subnet_ids

    # Specify the source to use to launch nodes in the node pool. Currently, image is the only supported source.
    node_source_details {
         image_id = var.node_image_ocid[var.region]
         source_type = &quot;IMAGE&quot;
    }

    # The configuration of nodes in the node pool.
    node_config_details {
        placement_configs {
            availability_domain = var.node_pool_availability_domain
            subnet_id = var.node_pool_subnet_id
        }
        size = var.node_pool_size
    }


    # The shape configuration of the nodes.
    node_shape_config {
        memory_in_gbs = var.node_shape_config_memory
        ocpus = var.node_shape_config_ocpus
    }

}
</code></pre>
<p>I updated the values for <code>var.node_shape_config_memory</code> and <code>var.node_shape_config_ocpus</code> ( which modifies the shape configuration of the nodes) in <code>terraform.tfvars</code> file and performed <code>terraform apply</code>.</p>
<p>The apply operation works without any error and it says:
Terraform will perform the following actions:</p>
<pre><code>  # oci_containerengine_node_pool.oke-node-pool will be updated in-place
  ~ resource &quot;oci_containerengine_node_pool&quot; &quot;oke-node-pool&quot; {
        id                  = &quot;ocid1.nodepool.oc1.***.aaaaaaaakc67a&quot;
        name                = &quot;pool2&quot;
        # (11 unchanged attributes hidden)



      ~ node_shape_config {
          ~ memory_in_gbs = 8 -&gt; 16
          ~ ocpus         = 1 -&gt; 2
        }

        # (4 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
</code></pre>
<p>The section in this output says that node configs are updated, and that's true, I can see it in node pool details in OCI console.:</p>
<pre><code>  ~ node_shape_config {
      ~ memory_in_gbs = 8 -&gt; 16
      ~ ocpus         = 1 -&gt; 2
    }
</code></pre>
<p>But the problem is, when I check the individual node configurations ( via Instances page of OCI console) it is clear that <strong>existing nodes have the old <code>ocpu</code> and <code>memory</code> configurations. They are not updated.</strong></p>
<p>Is there a case that updates to the node pool will reflect only on the nodes that are created after the update? They are not applicable to existing nodes?</p>
<p>Is there any fix to this problem?</p>

AnjK
<p>The <a href="https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengmodifyingnodepool.htm" rel="nofollow noreferrer">Oracle docs</a> says that:</p>
<blockquote>
<p>You can use Container Engine for Kubernetes to modify the properties
of node pools and worker nodes in existing Kubernetes clusters.</p>
<p>You can change:</p>
<ul>
<li>the version of Kubernetes to run on new worker nodes</li>
<li>the image to use for new worker nodes</li>
<li>the shape to use for <strong>new worker nodes</strong></li>
<li>the boot volume size to use for new worker nodes</li>
</ul>
<p>Also note the following:</p>
<p><strong>Any changes you make to worker node properties will only apply to new
worker nodes. You cannot change the properties of existing worker
nodes.</strong></p>
</blockquote>
<p>That means, the changes are applied to only new worker nodes in the node pool.</p>
<p>In situations, when we want to update properties of all the worker nodes in a node pool simultaneously (like, upgrading all worker nodes to a new version of Oracle Linux), then we should create a new node pool with worker nodes that have the required properties, and shift work from the original node pool to the new node pool using the kubectl drain command and pod disruption budgets.</p>
