Skip to content

Commit

Permalink
Update API definitions and responses to reflect cluster_autoscaler_co…
Browse files Browse the repository at this point in the history
…nfiguration support (#960)

* Update API definitions and responses to reflect cluster_autoscaler_configuration support

* Fix type float

* Undo linter

* Fix casing

---------

Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>
  • Loading branch information
kperath and andrewsomething authored Jan 28, 2025
1 parent fb3c013 commit 8fa63db
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 14 deletions.
31 changes: 17 additions & 14 deletions specification/resources/kubernetes/models/cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ properties:
items:
type: string
example:
- k8s
- k8s:bd5f5959-5e1e-4205-a714-a914373942af
- production
- web-team
- k8s
- k8s:bd5f5959-5e1e-4205-a714-a914373942af
- production
- web-team
description: An array of tags applied to the Kubernetes cluster. All
clusters are automatically tagged `k8s` and `k8s:$K8S_CLUSTER_ID`.

Expand All @@ -79,10 +79,10 @@ properties:
description: An object specifying the details of the worker nodes available
to the Kubernetes cluster.
items:
$ref: 'node_pool.yml#/kubernetes_node_pool'
$ref: "node_pool.yml#/kubernetes_node_pool"

maintenance_policy:
$ref: 'maintenance_policy.yml'
$ref: "maintenance_policy.yml"

auto_upgrade:
type: boolean
Expand All @@ -100,13 +100,13 @@ properties:
state:
type: string
enum:
- running
- provisioning
- degraded
- error
- deleted
- upgrading
- deleting
- running
- provisioning
- degraded
- error
- deleted
- upgrading
- deleting
example: provisioning
description: A string indicating the current status of the cluster.
message:
Expand Down Expand Up @@ -156,7 +156,10 @@ properties:
integrated with the cluster.

control_plane_firewall:
$ref: 'control_plane_firewall.yml'
$ref: "control_plane_firewall.yml"

cluster_autoscaler_configuration:
$ref: "cluster_autoscaler_configuration.yml"

required:
- name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type: object
nullable: true
description: An object specifying custom cluster autoscaler configuration.
properties:
scale_down_utilization_threshold:
type: number
description: Used to customize when cluster autoscaler scales down non-empty nodes by setting the node utilization threshold.
example: 0.65

scale_down_unneeded_time:
type: string
description: Used to customize how long a node is unneeded before being scaled down.
example: "1m0s"
3 changes: 3 additions & 0 deletions specification/resources/kubernetes/models/cluster_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@ properties:
control_plane_firewall:
$ref: 'control_plane_firewall.yml'

cluster_autoscaler_configuration:
$ref: 'cluster_autoscaler_configuration.yml'

required:
- name
15 changes: 15 additions & 0 deletions specification/resources/kubernetes/responses/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ kubernetes_clusters_all:
allowed_addresses:
- "1.2.3.4/32"
- "1.1.0.0/16"
cluster_autoscaler_configuration:
scale_down_utilization_threshold: 0.65
scale_down_unneeded_time: "1m"
meta:
total: 1

Expand Down Expand Up @@ -210,6 +213,9 @@ kubernetes_single:
allowed_addresses:
- "1.2.3.4/32"
- "1.1.0.0/16"
cluster_autoscaler_configuration:
scale_down_utilization_threshold: 0.65
scale_down_unneeded_time: "1m"

kubernetes_updated:
value:
Expand Down Expand Up @@ -315,6 +321,9 @@ kubernetes_updated:
allowed_addresses:
- "1.2.3.4/32"
- "1.1.0.0/16"
cluster_autoscaler_configuration:
scale_down_utilization_threshold: 0.65
scale_down_unneeded_time: "1m"

kubernetes_clusters_create_basic_response:
value:
Expand Down Expand Up @@ -385,6 +394,9 @@ kubernetes_clusters_create_basic_response:
allowed_addresses:
- "1.2.3.4/32"
- "1.1.0.0/16"
cluster_autoscaler_configuration:
scale_down_utilization_threshold: 0.65
scale_down_unneeded_time: "1m"

kubernetes_clusters_multi_pool_response:
value:
Expand Down Expand Up @@ -492,6 +504,9 @@ kubernetes_clusters_multi_pool_response:
allowed_addresses:
- "1.2.3.4/32"
- "1.1.0.0/16"
cluster_autoscaler_configuration:
scale_down_utilization_threshold: 0.65
scale_down_unneeded_time: "1m"

kubernetes_options:
value:
Expand Down

0 comments on commit 8fa63db

Please sign in to comment.