Skip to content

feat(compute): per-node instance type override for rolling resize (Part of #273, closes #465) - #466

Merged
bhumi46 merged 4 commits into
mosip:GH-issue-273-v2from
bhumi46:273-v2/29-node-instance-type
Oct 15, 2026
Merged

bhumi46 merged 4 commits into
mosip:GH-issue-273-v2from
bhumi46:273-v2/29-node-instance-type

Conversation

@bhumi46

@bhumi46 bhumi46 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Part of #273
Closes #465

Problem

k8s_instance_type is one type for every cluster node. Changing it updates all nodes in parallel (the AWS provider stops, modifies and starts each instance), so every control-plane/etcd member and worker is down at the same time. Nodes can't be resized one at a time, and roles can't get different sizes.

What

Optional k8s_node_instance_type in profiles/<profile>/aws/compute.tfvars — rarely needed:

k8s_node_instance_type = { "WORKER-NODE-5" = "m6a.2xlarge" }   # overrides k8s_instance_type for that node
  • Default {} → no change for any environment (no new resources in the plan except terraform_data.instance_type_check on the first run).
  • In-place update: same instance, private IP and disk; RKE2 restarts on boot — no configure needed.
  • Rolling resize: one node per PR / compute run; drain it first; control-plane nodes one at a time so etcd keeps its majority.
  • Validation: node-name pattern, series.type format; a name not in the current node counts fails the plan (terraform_data.instance_type_check).
  • Keep the CPU architecture (x86 AMI → x86 types such as t3a / m6a / m7a; Graviton types need an ARM AMI).

Also in this PR (commit 2)

  • Comments in compute.tfvars / vm.tfvars rewritten (all three profiles): one Optional settings section; for each feature — power state, per-node instance type, vm group state — the default (commented out), when to uncomment, what it does, and Back to default. Example node names exist in each profile.

  • mosip: test value removed — k8s_node_state = { "WORKER-NODE-5" = "running" } (test(aws): Terraform power state — stop WORKER-NODE-5 via compute.tfvars (Part of #273, #437) #463 / test(aws): Terraform power state — WORKER-NODE-5 back to running (Part of #273, #437) #464). Next compute plan: 1 to destroy aws_ec2_instance_state.k8s_desired["WORKER-NODE-5"] — a no-op in the AWS provider (only stops managing the state); the instance keeps running.

  • Instance-type notes above k8s_instance_type / nginx_instance_type (commit 3): in-place stop → resize → start; the cluster type resizes every node in one run (use k8s_node_instance_type for one at a time); while nginx is stopped its services are down (listed per profile: mosip ingress/NFS/PostgreSQL/ActiveMQ storage, esignet-standalone ingress/NFS, observ Rancher/Keycloak ingress + NFS) and its public IP changes (no Elastic IP) → run COMPONENT=dns right after. Same warning on the nginx_instance_state example.

  • Branch brought up to date with GH-issue-273-v2 (merge commit, signed off) — includes test(aws): resize all mosip cluster nodes t3a.2xlarge → m6a.2xlarge (Part of #273, #437) #467.

Tests

terraform test compute 20 passed (15 existing + 5 new: default type everywhere; override only the named node and nginx unchanged; bad node name; bad type; non-existent node). terraform validate (compute root), fmt -check.

🤖 Generated with Claude Code

…sip#465)

k8s_instance_type is one type for every cluster node, and changing it
updates all nodes in parallel (stop -> modify -> start), taking the
whole cluster down at once.

Add optional k8s_node_instance_type (compute.tfvars): node name ->
instance type, overriding k8s_instance_type for that node only. Default
{} changes nothing. In-place update (same instance, private IP and
disk), so nodes can be resized one per compute run. Validated: node-name
pattern and type format; a name not in the current node counts fails
the plan (terraform_data.instance_type_check). Commented example in
each profile's compute.tfvars.

Tests: compute 20 (15 existing + 5 new).

Part of mosip#273. Closes mosip#465.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: bhumi46 <thisisbn46@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 17
  • ^main$
  • ^master$
  • ^master-java21$
  • ^develop$
  • ^develop2$
  • ^develop/.*
  • ^release$
  • ^release/.*
  • ^release-.*
  • ^\d+.\d+.x$
  • ^\d+.\d+.\d+$
  • ^hotfix/.*
  • ^hotfix-.*
  • ^issue-.*
  • develop
  • release-*
  • MOSIP*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: fdeb87d6-1a5c-438c-b2bb-ae5130f5435e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

bhumi46 and others added 3 commits October 15, 2026 18:14
…state test value (mosip#465)

- compute.tfvars (mosip, esignet-standalone, observ): one "Optional
  settings" section. For each feature — power state, per-node instance
  type — the default (commented out), when to uncomment, what happens
  and how to get back to the default. Example node names exist in each
  profile (WORKER-NODE-1; observ: CONTROL-PLANE-NODE-1).
- vm.tfvars: same structure for the per-group state.
- mosip: remove the mosip#437 test value k8s_node_state
  { "WORKER-NODE-5" = "running" } (mosip#463/mosip#464) — back to default. The
  next compute plan shows 1 to destroy for aws_ec2_instance_state
  .k8s_desired["WORKER-NODE-5"], which only stops managing the state;
  the instance keeps running.

Part of mosip#273, part of mosip#465.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: bhumi46 <thisisbn46@gmail.com>
…9-node-instance-type

Signed-off-by: bhumi46 <thisisbn46@gmail.com>
…osip#465)

Above k8s_instance_type / nginx_instance_type in each profile's
compute.tfvars: a change is an in-place stop/resize/start; the cluster
type resizes every node in one run (k8s_node_instance_type for one at a
time); while nginx is stopped its services are down (listed per
profile) and its public IP changes (no Elastic IP), so COMPONENT=dns
must run right after. Same warning on the nginx_instance_state example.

Part of mosip#273, part of mosip#465.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: bhumi46 <thisisbn46@gmail.com>
@bhumi46
bhumi46 merged commit 75a3e54 into mosip:GH-issue-273-v2 Oct 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant