Repository navigation
CON-14753: add MaxPodsPerNode to Kubernetes cluster create and get - #1205
pyadagiri-do wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟢 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
MaxPodsPerNodeon 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
| 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. |
There was a problem hiding this comment.
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.
| Name: want.Name, | ||
| RegionSlug: want.RegionSlug, | ||
| VersionSlug: want.VersionSlug, | ||
| MaxPodsPerNode: 450, |
There was a problem hiding this comment.
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.
| MaxPodsPerNode: 450, | |
| MaxPodsPerNode: want.MaxPodsPerNode, |
There was a problem hiding this comment.
Good catch, switched to want.MaxPodsPerNode in 9f72f9f.
…/max-pods-per-node # Conflicts: # kubernetes_test.go
DO NOT MERGE
Summary
Adds
MaxPodsPerNodeto Kubernetes clusters for CON-14753.KubernetesClusterCreateRequest.MaxPodsPerNodesets 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.MaxPodsPerNodereturns the value on reads.KubernetesClusterUpdateRequest.API spec: digitalocean/openapi#1330. Consumers: digitalocean/doctl#2097, digitalocean/terraform-provider-digitalocean#1629.