Skip to content

CON-14753: add MaxPodsPerNode to Kubernetes cluster create and get - #1205

Open
pyadagiri-do wants to merge 4 commits into
digitalocean:mainfrom
pyadagiri-do:pyadagiri/con-14753/max-pods-per-node
Open

pyadagiri-do wants to merge 4 commits into
digitalocean:mainfrom
pyadagiri-do:pyadagiri/con-14753/max-pods-per-node

Conversation

@pyadagiri-do

@pyadagiri-do pyadagiri-do commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

DO NOT MERGE

Summary

Adds MaxPodsPerNode to Kubernetes clusters for CON-14753.

  • KubernetesClusterCreateRequest.MaxPodsPerNode sets the maximum pods per worker node. Supported values are 110, 220 and 450. It's omitted when 0, so the API applies the default of 110.
  • KubernetesCluster.MaxPodsPerNode returns the value on reads.
  • The value can only be set at creation time, so it isn't added to KubernetesClusterUpdateRequest.

API spec: digitalocean/openapi#1330. Consumers: digitalocean/doctl#2097, digitalocean/terraform-provider-digitalocean#1629.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified for the new pod-limit configuration and response fields.

No open issues 🎉

What changed in this PR

Adds MaxPodsPerNode support to the Kubernetes client, allowing callers to configure pod limits at cluster creation and read the value from cluster responses.

Changes:

  • Adds the create-only option with documented supported values of 110, 220, and 450; zero is omitted so the API applies its default.
  • Exposes MaxPodsPerNode on the cluster response model without adding it to update requests.
  • Tests JSON omission, explicit serialization, and create request/response handling.
File Description
kubernetes.go Adds MaxPodsPerNode to cluster creation and response models.
kubernetes_test.go Adds serialization and create request/response tests for the new field.

Review effort: Balanced

Comment thread kubernetes.go Outdated
IsolatedWorkers bool `json:"isolated_workers,omitempty"`
// MaxPodsPerNode sets the maximum number of pods per worker node. Supported
// values are 110, 220 and 450. When omitted, the default is 110. This can only
// be set at creation time.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small one on the comment. godo doesn't enforce the default or supported values, it just sends the integer and the API decides, and godo gets released separately from API. Can we describe only what client does? Something like
// MaxPodsPerNode sets the maximum number of pods per worker node. Zero leaves
// it unset and the API applies its default. See the API reference for
// supported values. This can only be set at creation time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9f72f9f, used your wording.

Comment thread kubernetes_test.go Outdated
Name: want.Name,
RegionSlug: want.RegionSlug,
VersionSlug: want.VersionSlug,
MaxPodsPerNode: 450,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every other field here is copied from want, but this 450 is written out again. So changing this to 220 would still pass. Use want.MaxPodsPerNode instead.

Suggested change
MaxPodsPerNode: 450,
MaxPodsPerNode: want.MaxPodsPerNode,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, switched to want.MaxPodsPerNode in 9f72f9f.

@skumarc-do skumarc-do left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants