diff --git a/Makefile b/Makefile index 1f0d4db27c2c..7ad86fb8f5d3 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,11 @@ codegen: ## Generate code. Must be run if changes are made to ./pkg/apis/... # CRDs don't currently jive with VolatileTime, which has an Any type. perl -pi -e 's/Any/string/g' charts/karpenter/templates/provisioning.karpenter.sh_provisioners.yaml hack/boilerplate.sh + gen-crd-api-reference-docs \ + -api-dir ./pkg/apis/provisioning/v1alpha2 \ + -config $(shell go env GOMODCACHE)/github.com/ahmetb/gen-crd-api-reference-docs@v0.2.0/example-config.json \ + -out-file docs/README.md \ + -template-dir $(shell go env GOMODCACHE)/github.com/ahmetb/gen-crd-api-reference-docs@v0.2.0/template publish: ## Generate release manifests and publish a versioned container image. @aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(RELEASE_REPO) @@ -73,14 +78,7 @@ publish: ## Generate release manifests and publish a versioned container image. helm: ## Generate Helm Chart cd charts;helm lint karpenter;helm package karpenter;helm repo index . -docs: ## Generate Docs - gen-crd-api-reference-docs \ - -api-dir ./pkg/apis/provisioning/v1alpha1 \ - -config $(shell go env GOMODCACHE)/github.com/ahmetb/gen-crd-api-reference-docs@v0.2.0/example-config.json \ - -out-file docs/README.md \ - -template-dir $(shell go env GOMODCACHE)/github.com/ahmetb/gen-crd-api-reference-docs@v0.2.0/template - toolchain: ## Install developer toolchain ./hack/toolchain.sh -.PHONY: help dev ci release test battletest verify codegen apply delete publish helm docs toolchain licenses +.PHONY: help dev ci release test battletest verify codegen apply delete publish helm toolchain licenses diff --git a/charts/karpenter/templates/provisioning.karpenter.sh_provisioners.yaml b/charts/karpenter/templates/provisioning.karpenter.sh_provisioners.yaml index 81283e158bca..cbab8c638aa2 100644 --- a/charts/karpenter/templates/provisioning.karpenter.sh_provisioners.yaml +++ b/charts/karpenter/templates/provisioning.karpenter.sh_provisioners.yaml @@ -16,7 +16,7 @@ spec: singular: provisioner scope: Namespaced versions: - - name: v1alpha1 + - name: v1alpha2 schema: openAPIV3Schema: description: Provisioner is the Schema for the Provisioners API @@ -36,7 +36,7 @@ spec: description: Architecture constrains the underlying node architecture type: string cluster: - description: ClusterSpec configures the cluster that the provisioner operates against. If not specified, it will default to using the controller's kube-config. + description: Cluster that launched nodes connect to. properties: caBundle: description: CABundle is required for nodes to verify API Server certificates. @@ -88,9 +88,13 @@ spec: - key type: object type: array - ttlSeconds: - description: TTLSeconds determines how long to wait before attempting to terminate a node. - format: int32 + ttlSecondsAfterEmpty: + description: "TTLSecondsAfterEmpty is the number of seconds the controller will wait before attempting to terminate a node, measured from when the node is detected to be empty. A Node is considered to be empty when it does not have pods scheduled to it, excluding daemonsets. \n Termination due to underutilization is disabled if this field is not set." + format: int64 + type: integer + ttlSecondsUntilExpired: + description: "TTLSecondsUntilExpired is the number of seconds the controller will wait before terminating a node, measured from when the node is created. This is useful to implement features like eventually consistent node upgrade, memory leak protection, and disruption testing. \n Termination due to expiration is disabled if this field is not set." + format: int64 type: integer zones: description: Zones constrains where nodes will be launched by the Provisioner. If unspecified, defaults to all zones in the region. Cannot be specified if label "topology.kubernetes.io/zone" is specified. diff --git a/charts/karpenter/templates/webhook/webhooks.yaml b/charts/karpenter/templates/webhook/webhooks.yaml index 94ee336e5796..84df3981474a 100644 --- a/charts/karpenter/templates/webhook/webhooks.yaml +++ b/charts/karpenter/templates/webhook/webhooks.yaml @@ -15,7 +15,7 @@ webhooks: - apiGroups: - provisioning.karpenter.sh apiVersions: - - v1alpha1 + - v1alpha2 resources: - provisioners provisioners/status @@ -42,7 +42,7 @@ webhooks: - apiGroups: - provisioning.karpenter.sh apiVersions: - - v1alpha1 + - v1alpha2 resources: - provisioners provisioners/status diff --git a/cmd/controller/main.go b/cmd/controller/main.go index 96dd77e8be4a..94e3ad1bc7f2 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -22,9 +22,9 @@ import ( "github.com/awslabs/karpenter/pkg/cloudprovider" "github.com/awslabs/karpenter/pkg/cloudprovider/registry" "github.com/awslabs/karpenter/pkg/controllers" - "github.com/awslabs/karpenter/pkg/controllers/provisioning/v1alpha1/allocation" - "github.com/awslabs/karpenter/pkg/controllers/provisioning/v1alpha1/reallocation" - termination "github.com/awslabs/karpenter/pkg/controllers/terminating/v1alpha1" + "github.com/awslabs/karpenter/pkg/controllers/allocation" + "github.com/awslabs/karpenter/pkg/controllers/reallocation" + "github.com/awslabs/karpenter/pkg/controllers/termination" "github.com/awslabs/karpenter/pkg/utils/log" "go.uber.org/zap/zapcore" diff --git a/docs/README.md b/docs/README.md index e9b767e0be55..f382e937cb84 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,23 +1,23 @@

Packages:

-

provisioning.karpenter.sh/v1alpha1

+

provisioning.karpenter.sh/v1alpha2

-

Package v1alpha1 contains API Schema definitions for the v1alpha1 API group

+

Package v1alpha2 contains API Schema definitions for the v1alpha2 API group

Resource Types: -

ClusterSpec +

Cluster

(Appears on: -ProvisionerSpec) +ProvisionerSpec)

-

ClusterSpec configures the cluster that the provisioner operates against. If +

Cluster configures the cluster that the provisioner operates against. If not specified, it will default to using the controller’s kube-config.

@@ -63,11 +63,11 @@ string
-

Constraints +

Constraints

(Appears on: -ProvisionerSpec) +ProvisionerSpec)

Constraints are applied to all nodes created by the provisioner. They can be @@ -165,7 +165,7 @@ string -

Provisioner +

Provisioner

Provisioner is the Schema for the Provisioners API

@@ -196,7 +196,7 @@ Refer to the Kubernetes API documentation for the fields of the spec
- + ProvisionerSpec @@ -209,20 +209,21 @@ ProvisionerSpec cluster
- -ClusterSpec + +Cluster (Optional) +

Cluster that launched nodes connect to.

Constraints
- + Constraints @@ -231,19 +232,40 @@ Constraints

(Members of Constraints are embedded into this type.)

-

Constraints applied to nodes created by the provisioner

+(Optional) +

Constraints are applied to all nodes launched by this provisioner.

+ + + + +ttlSecondsAfterEmpty
+ +int64 + + + +(Optional) +

TTLSecondsAfterEmpty is the number of seconds the controller will wait +before attempting to terminate a node, measured from when the node is +detected to be empty. A Node is considered to be empty when it does not +have pods scheduled to it, excluding daemonsets.

+

Termination due to underutilization is disabled if this field is not set.

-ttlSeconds
+ttlSecondsUntilExpired
-int32 +int64 (Optional) -

TTLSeconds determines how long to wait before attempting to terminate a node.

+

TTLSecondsUntilExpired is the number of seconds the controller will wait +before terminating a node, measured from when the node is created. This +is useful to implement features like eventually consistent node upgrade, +memory leak protection, and disruption testing.

+

Termination due to expiration is disabled if this field is not set.

@@ -253,7 +275,7 @@ int32 status
- + ProvisionerStatus @@ -263,11 +285,11 @@ ProvisionerStatus -

ProvisionerSpec +

ProvisionerSpec

(Appears on: -Provisioner) +Provisioner)

ProvisionerSpec is the top level provisioner specification. Provisioners @@ -293,20 +315,21 @@ pod.spec.nodeSelector[“provisioning.karpenter.sh/name”]=$PROVISIONER cluster
- -ClusterSpec + +Cluster (Optional) +

Cluster that launched nodes connect to.

Constraints
- + Constraints @@ -315,28 +338,49 @@ Constraints

(Members of Constraints are embedded into this type.)

-

Constraints applied to nodes created by the provisioner

+(Optional) +

Constraints are applied to all nodes launched by this provisioner.

+ + + + +ttlSecondsAfterEmpty
+ +int64 + + + +(Optional) +

TTLSecondsAfterEmpty is the number of seconds the controller will wait +before attempting to terminate a node, measured from when the node is +detected to be empty. A Node is considered to be empty when it does not +have pods scheduled to it, excluding daemonsets.

+

Termination due to underutilization is disabled if this field is not set.

-ttlSeconds
+ttlSecondsUntilExpired
-int32 +int64 (Optional) -

TTLSeconds determines how long to wait before attempting to terminate a node.

+

TTLSecondsUntilExpired is the number of seconds the controller will wait +before terminating a node, measured from when the node is created. This +is useful to implement features like eventually consistent node upgrade, +memory leak protection, and disruption testing.

+

Termination due to expiration is disabled if this field is not set.

-

ProvisionerStatus +

ProvisionerStatus

(Appears on: -Provisioner) +Provisioner)

ProvisionerStatus defines the observed state of Provisioner

@@ -380,5 +424,5 @@ its target, and indicates whether or not those conditions are met.


Generated with gen-crd-api-reference-docs -on git commit 08b78c7. +on git commit faec484.

diff --git a/docs/aws/README.md b/docs/aws/README.md index a9be1e501a33..6a9d7dce3bbb 100644 --- a/docs/aws/README.md +++ b/docs/aws/README.md @@ -92,16 +92,16 @@ kubectl patch deployment karpenter-controller \ Create a default Provisioner that launches nodes configured with cluster name, endpoint, and caBundle. ```bash cat <