From 92aadb853ae5aefdd9696ca33a2434ab4d2c6556 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 27 Feb 2024 17:26:36 +0900 Subject: [PATCH 01/21] chore: use custom image --- .gitignore | 1 + go.mod | 2 ++ go.sum | 4 ++-- pkg/apis/crds/karpenter.sh_nodepools.yaml | 9 +++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 459ff0ba0a8b..942c8493754a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ coverage.html *.test *.cpuprofile *.heapprofile +*.swp go.work go.work.sum diff --git a/go.mod b/go.mod index 7fe773ec3362..b6bb4451bb4c 100644 --- a/go.mod +++ b/go.mod @@ -116,3 +116,5 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) + +replace sigs.k8s.io/karpenter v0.33.1-0.20240202175636-0e77b7842c28 => github.com/smartnews/karpenter v0.34.0-sn-1 diff --git a/go.sum b/go.sum index 4af2e0a43f3b..edd2456d21bc 100644 --- a/go.sum +++ b/go.sum @@ -338,6 +338,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartnews/karpenter v0.34.0-sn-1 h1:MSCikAnW1SX3Ks+orPkaUWgH/L9m2+bPj/LdPqSPgd4= +github.com/smartnews/karpenter v0.34.0-sn-1/go.mod h1:eKP/h1VehbwZmlJhnFL1eMn+ZgcfNy0GxTcoG8+r6p4= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -762,8 +764,6 @@ sigs.k8s.io/controller-runtime v0.17.0 h1:fjJQf8Ukya+VjogLO6/bNX9HE6Y2xpsO5+fyS2 sigs.k8s.io/controller-runtime v0.17.0/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/karpenter v0.33.1-0.20240202175636-0e77b7842c28 h1:xdyaljnj4ehDZ8W2vicvbanamijcOkVzt/oRZM6780I= -sigs.k8s.io/karpenter v0.33.1-0.20240202175636-0e77b7842c28/go.mod h1:V5s2Bq+41ybF38Bd75k+v+416PWpPU9xz7UBG+sXtCk= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= diff --git a/pkg/apis/crds/karpenter.sh_nodepools.yaml b/pkg/apis/crds/karpenter.sh_nodepools.yaml index 247ffef5145e..598aa162520d 100644 --- a/pkg/apis/crds/karpenter.sh_nodepools.yaml +++ b/pkg/apis/crds/karpenter.sh_nodepools.yaml @@ -135,10 +135,15 @@ spec: memory leak protection, and disruption testing. pattern: ^(([0-9]+(s|m|h))+)|(Never)$ type: string + utilizationThreshold: + description: |- + UtilizationThreshold is defined as sum of requested resources divided by capacity + below which a node can be considered for disruption. + maximum: 100 + minimum: 1 + type: integer type: object x-kubernetes-validations: - - message: consolidateAfter cannot be combined with consolidationPolicy=WhenUnderutilized - rule: 'has(self.consolidateAfter) ? self.consolidationPolicy != ''WhenUnderutilized'' || self.consolidateAfter == ''Never'' : true' - message: consolidateAfter must be specified with consolidationPolicy=WhenEmpty rule: 'self.consolidationPolicy == ''WhenEmpty'' ? has(self.consolidateAfter) : true' limits: From e4faadc9b54bb47e837cc0f30d49a15bf306901d Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 13 Mar 2024 17:25:01 +0900 Subject: [PATCH 02/21] chore: increase aws qps frequency --- pkg/cache/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go index 7f0ba1d97510..b138e31be640 100644 --- a/pkg/cache/cache.go +++ b/pkg/cache/cache.go @@ -23,7 +23,7 @@ const ( // resources. Cache hits enable faster provisioning and reduced API load on // AWS APIs, which can have a serious impact on performance and scalability. // DO NOT CHANGE THIS VALUE WITHOUT DUE CONSIDERATION - DefaultTTL = time.Minute + DefaultTTL = 5 * time.Minute // UnavailableOfferingsTTL is the time before offerings that were marked as unavailable // are removed from the cache and are available for launch again UnavailableOfferingsTTL = 3 * time.Minute From cd97dd014595f1932affcbf11b4f7869d8c8c15a Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 9 Apr 2024 14:04:44 +0900 Subject: [PATCH 03/21] feat: improve spot interruption handling --- pkg/controllers/interruption/controller.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pkg/controllers/interruption/controller.go b/pkg/controllers/interruption/controller.go index e2f3cfc4798e..4f1d685add1d 100644 --- a/pkg/controllers/interruption/controller.go +++ b/pkg/controllers/interruption/controller.go @@ -24,6 +24,7 @@ import ( "github.com/samber/lo" "go.uber.org/multierr" v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/workqueue" "k8s.io/utils/clock" "knative.dev/pkg/logging" @@ -199,11 +200,29 @@ func (c *Controller) handleNodeClaim(ctx context.Context, msg messages.Message, } } if action != NoAction { + // try to create a new nodeclaim immediately but ignore error if it fails + if err := c.createNodeClaim(ctx, nodeClaim); err != nil { + logging.FromContext(ctx).Errorf("[interruption handling]failed to create a new nodeclaim, %v", err) + } return c.deleteNodeClaim(ctx, nodeClaim, node) } return nil } +// createNodeClaim creates a new NodeClaim with the same spec of the interrupted one +func (c *Controller) createNodeClaim(ctx context.Context, oldNodeClaim *v1beta1.NodeClaim) error { + newNodeClaim := &v1beta1.NodeClaim{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: oldNodeClaim.ObjectMeta.GenerateName, + Annotations: oldNodeClaim.ObjectMeta.Annotations, + Labels: oldNodeClaim.ObjectMeta.Labels, + OwnerReferences: oldNodeClaim.ObjectMeta.OwnerReferences, + }, + Spec: oldNodeClaim.Spec, + } + return c.kubeClient.Create(ctx, newNodeClaim) +} + // deleteNodeClaim removes the NodeClaim from the api-server func (c *Controller) deleteNodeClaim(ctx context.Context, nodeClaim *v1beta1.NodeClaim, node *v1.Node) error { if !nodeClaim.DeletionTimestamp.IsZero() { From 444a12d66724a9719973ec3cdd5020b58c1b457e Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 11 Apr 2024 13:47:18 +0900 Subject: [PATCH 04/21] fix: only handle spot int message --- pkg/controllers/interruption/controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/interruption/controller.go b/pkg/controllers/interruption/controller.go index 4f1d685add1d..768cb1c76c19 100644 --- a/pkg/controllers/interruption/controller.go +++ b/pkg/controllers/interruption/controller.go @@ -198,12 +198,12 @@ func (c *Controller) handleNodeClaim(ctx context.Context, msg messages.Message, if zone != "" && instanceType != "" { c.unavailableOfferingsCache.MarkUnavailable(ctx, string(msg.Kind()), instanceType, zone, v1beta1.CapacityTypeSpot) } - } - if action != NoAction { // try to create a new nodeclaim immediately but ignore error if it fails if err := c.createNodeClaim(ctx, nodeClaim); err != nil { logging.FromContext(ctx).Errorf("[interruption handling]failed to create a new nodeclaim, %v", err) } + } + if action != NoAction { return c.deleteNodeClaim(ctx, nodeClaim, node) } return nil From 49cc68fefbcbe7e0a7a9e6cd5f750135968bc9d9 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 12 Apr 2024 11:52:07 +0900 Subject: [PATCH 05/21] chore: add component tag to ec2 node --- pkg/providers/instance/instance.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/providers/instance/instance.go b/pkg/providers/instance/instance.go index 5d44e19503d0..ca1a2c6f41dc 100644 --- a/pkg/providers/instance/instance.go +++ b/pkg/providers/instance/instance.go @@ -251,6 +251,7 @@ func getTags(ctx context.Context, nodeClass *v1beta1.EC2NodeClass, nodeClaim *co corev1beta1.NodePoolLabelKey: nodeClaim.Labels[corev1beta1.NodePoolLabelKey], corev1beta1.ManagedByAnnotationKey: options.FromContext(ctx).ClusterName, v1beta1.LabelNodeClass: nodeClass.Name, + "Componenet": nodeClaim.Labels[corev1beta1.NodePoolLabelKey], // used for aws explore } return lo.Assign(nodeClass.Spec.Tags, staticTags) } From bae44087272215730369efad652b5bec97b090b3 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 13 Apr 2024 11:30:21 +0900 Subject: [PATCH 06/21] chore: use our own image --- go.mod | 2 +- go.sum | 4 ++-- pkg/providers/instance/instance.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index a0f875b14ba5..02720649fb4f 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.33.1-0.20240202175636-0e77b7842c28 => github.com/smartnews/karpenter v0.34.0-sn-1 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-sn-1 diff --git a/go.sum b/go.sum index 8f6f3b5951e8..7a1720cf039b 100644 --- a/go.sum +++ b/go.sum @@ -335,6 +335,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartnews/karpenter v0.36.0-sn-1 h1:fjpHAcN1O5Ovm+VpsYVsw3rY2RzU0JPkNP1D0DiUcUw= +github.com/smartnews/karpenter v0.36.0-sn-1/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -759,8 +761,6 @@ sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeG sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/karpenter v0.36.0 h1:i82fOsFWKwnChedKsj0Hep2yrTkAjCek/aZPSMX2dW8= -sigs.k8s.io/karpenter v0.36.0/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= diff --git a/pkg/providers/instance/instance.go b/pkg/providers/instance/instance.go index 495eb1830c91..f7117495e440 100644 --- a/pkg/providers/instance/instance.go +++ b/pkg/providers/instance/instance.go @@ -257,7 +257,7 @@ func getTags(ctx context.Context, nodeClass *v1beta1.EC2NodeClass, nodeClaim *co corev1beta1.NodePoolLabelKey: nodeClaim.Labels[corev1beta1.NodePoolLabelKey], corev1beta1.ManagedByAnnotationKey: options.FromContext(ctx).ClusterName, v1beta1.LabelNodeClass: nodeClass.Name, - "Componenet": nodeClaim.Labels[corev1beta1.NodePoolLabelKey], // used for aws explore + "Component": nodeClaim.Labels[corev1beta1.NodePoolLabelKey], // used for aws explore } return lo.Assign(nodeClass.Spec.Tags, staticTags) } From 266685fea513c9270a1fcd98bc2a18fa66f9b2e9 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 13 Apr 2024 12:01:05 +0900 Subject: [PATCH 07/21] chore: build amd image --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1aa29f5e69c4..bd3bce1914bf 100644 --- a/Makefile +++ b/Makefile @@ -123,7 +123,7 @@ licenses: download ## Verifies dependency licenses ! go-licenses csv ./... | grep -v -e 'MIT' -e 'Apache-2.0' -e 'BSD-3-Clause' -e 'BSD-2-Clause' -e 'ISC' -e 'MPL-2.0' -e 'github.com/awslabs/amazon-eks-ami/nodeadm' image: ## Build the Karpenter controller images using ko build - $(eval CONTROLLER_IMG=$(shell $(WITH_GOFLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO="$(KO_DOCKER_REPO)" ko build --bare github.com/aws/karpenter-provider-aws/cmd/controller)) + $(eval CONTROLLER_IMG=$(shell $(WITH_GOFLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO="$(KO_DOCKER_REPO)" ko build --platform linux/amd64 --bare github.com/aws/karpenter-provider-aws/cmd/controller)) $(eval IMG_REPOSITORY=$(shell echo $(CONTROLLER_IMG) | cut -d "@" -f 1 | cut -d ":" -f 1)) $(eval IMG_TAG=$(shell echo $(CONTROLLER_IMG) | cut -d "@" -f 1 | cut -d ":" -f 2 -s)) $(eval IMG_DIGEST=$(shell echo $(CONTROLLER_IMG) | cut -d "@" -f 2)) From 8d9c08ae8e13b44acc16f7e66811868da6fa007e Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 20 Apr 2024 12:48:13 +0900 Subject: [PATCH 08/21] chore: improve spot interruption handling --- pkg/controllers/interruption/controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controllers/interruption/controller.go b/pkg/controllers/interruption/controller.go index bf14eec6e853..c8874e9d520a 100644 --- a/pkg/controllers/interruption/controller.go +++ b/pkg/controllers/interruption/controller.go @@ -201,6 +201,10 @@ func (c *Controller) handleNodeClaim(ctx context.Context, msg messages.Message, // try to create a new nodeclaim immediately but ignore error if it fails if err := c.createNodeClaim(ctx, nodeClaim); err != nil { logging.FromContext(ctx).Errorf("[interruption handling]failed to create a new nodeclaim, %v", err) + } else { + logging.FromContext(ctx).Infof("Created new nodeclaim due to spot interruption") + // wait for the node provisioning before draining + time.Sleep(60 * time.Second) } } if action != NoAction { From 8f905244a43cb152ea180e303e2789fc83382c96 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 6 May 2024 11:24:10 +0900 Subject: [PATCH 09/21] chore: add spot interruption metrics with zone and instance type --- pkg/controllers/interruption/controller.go | 1 + pkg/controllers/interruption/metrics.go | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/pkg/controllers/interruption/controller.go b/pkg/controllers/interruption/controller.go index c8874e9d520a..c08612b2c847 100644 --- a/pkg/controllers/interruption/controller.go +++ b/pkg/controllers/interruption/controller.go @@ -198,6 +198,7 @@ func (c *Controller) handleNodeClaim(ctx context.Context, msg messages.Message, if zone != "" && instanceType != "" { c.unavailableOfferingsCache.MarkUnavailable(ctx, string(msg.Kind()), instanceType, zone, v1beta1.CapacityTypeSpot) } + spotTotal.WithLabelValues(instanceType, zone).Inc() // try to create a new nodeclaim immediately but ignore error if it fails if err := c.createNodeClaim(ctx, nodeClaim); err != nil { logging.FromContext(ctx).Errorf("[interruption handling]failed to create a new nodeclaim, %v", err) diff --git a/pkg/controllers/interruption/metrics.go b/pkg/controllers/interruption/metrics.go index 7fd01ca241d2..44d0992cc8f2 100644 --- a/pkg/controllers/interruption/metrics.go +++ b/pkg/controllers/interruption/metrics.go @@ -26,6 +26,8 @@ const ( messageTypeLabel = "message_type" actionTypeLabel = "action_type" terminationReasonLabel = "interruption" + instanceTypeLabel = "instance_type" + zoneLabel = "zone" ) var ( @@ -64,6 +66,15 @@ var ( }, []string{actionTypeLabel}, ) + spotTotal = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Namespace: metrics.Namespace, + Subsystem: interruptionSubsystem, + Name: "spot_total", + Help: "Number of the spot interruption. Labeled by AZ, instance type", + }, + []string{instanceTypeLabel, zoneLabel}, + ) ) func init() { From 00269704cf88321d7879999f6af9893edd228488 Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 8 May 2024 12:21:29 +0900 Subject: [PATCH 10/21] fix: register missing metrics --- pkg/controllers/interruption/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/interruption/metrics.go b/pkg/controllers/interruption/metrics.go index 44d0992cc8f2..5ba2dda465c6 100644 --- a/pkg/controllers/interruption/metrics.go +++ b/pkg/controllers/interruption/metrics.go @@ -78,5 +78,5 @@ var ( ) func init() { - crmetrics.Registry.MustRegister(receivedMessages, deletedMessages, messageLatency, actionsPerformed) + crmetrics.Registry.MustRegister(receivedMessages, deletedMessages, messageLatency, actionsPerformed, spotTotal) } From a7afc031563330ed18badd55e05f2a5d2d1d2062 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 10 May 2024 15:07:12 +0900 Subject: [PATCH 11/21] chore: add hostname to spot int metrics --- pkg/controllers/interruption/controller.go | 2 +- pkg/controllers/interruption/metrics.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/interruption/controller.go b/pkg/controllers/interruption/controller.go index c08612b2c847..5cd75edaa8bf 100644 --- a/pkg/controllers/interruption/controller.go +++ b/pkg/controllers/interruption/controller.go @@ -198,7 +198,7 @@ func (c *Controller) handleNodeClaim(ctx context.Context, msg messages.Message, if zone != "" && instanceType != "" { c.unavailableOfferingsCache.MarkUnavailable(ctx, string(msg.Kind()), instanceType, zone, v1beta1.CapacityTypeSpot) } - spotTotal.WithLabelValues(instanceType, zone).Inc() + spotTotal.WithLabelValues(instanceType, zone, nodeClaim.Status.NodeName, nodeClaim.Labels["karpenter.sh/nodepool"]).Inc() // try to create a new nodeclaim immediately but ignore error if it fails if err := c.createNodeClaim(ctx, nodeClaim); err != nil { logging.FromContext(ctx).Errorf("[interruption handling]failed to create a new nodeclaim, %v", err) diff --git a/pkg/controllers/interruption/metrics.go b/pkg/controllers/interruption/metrics.go index 5ba2dda465c6..e414dbab5022 100644 --- a/pkg/controllers/interruption/metrics.go +++ b/pkg/controllers/interruption/metrics.go @@ -28,6 +28,8 @@ const ( terminationReasonLabel = "interruption" instanceTypeLabel = "instance_type" zoneLabel = "zone" + hostLabel = "node_name" + poolLabel = "node_pool" ) var ( @@ -73,7 +75,7 @@ var ( Name: "spot_total", Help: "Number of the spot interruption. Labeled by AZ, instance type", }, - []string{instanceTypeLabel, zoneLabel}, + []string{instanceTypeLabel, zoneLabel, hostLabel, poolLabel}, ) ) From eab0048b3c2af004586a595a8e25acb9301ae869 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 13 May 2024 13:19:16 +0900 Subject: [PATCH 12/21] chore: fix extra node creation --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 02720649fb4f..ad642258325e 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-sn-1 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-1 diff --git a/go.sum b/go.sum index 7a1720cf039b..950567a52c0f 100644 --- a/go.sum +++ b/go.sum @@ -335,8 +335,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartnews/karpenter v0.36.0-sn-1 h1:fjpHAcN1O5Ovm+VpsYVsw3rY2RzU0JPkNP1D0DiUcUw= -github.com/smartnews/karpenter v0.36.0-sn-1/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= +github.com/smartnews/karpenter v0.36.0-sn-test h1:dzNAEC04iK9H9caj27UeU7g3YS255YCw8tqvid0Q1So= +github.com/smartnews/karpenter v0.36.0-sn-test/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= From 3410cd92695ba7df8d9b88d468ee7eef8c7bde84 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 13 May 2024 13:46:08 +0900 Subject: [PATCH 13/21] bump version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ad642258325e..368cbd94e324 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-1 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-2 diff --git a/go.sum b/go.sum index 950567a52c0f..1d0875d87285 100644 --- a/go.sum +++ b/go.sum @@ -335,8 +335,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartnews/karpenter v0.36.0-sn-test h1:dzNAEC04iK9H9caj27UeU7g3YS255YCw8tqvid0Q1So= -github.com/smartnews/karpenter v0.36.0-sn-test/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-2 h1:mtAyipQ1ZWVHUohQXtZ+Z0vXZQhZ5mZwCHAAXIzhyng= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-2/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= From 76ffd9009c61a97a0a34e7b7d0ee5cf7e28b9f40 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 13 May 2024 15:46:07 +0900 Subject: [PATCH 14/21] bump up version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 368cbd94e324..e510edcb28bd 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-2 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-3 From a2dd67e68b3f11b0fae63f2085bf5cba766a2d76 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 13 May 2024 15:47:01 +0900 Subject: [PATCH 15/21] bump up version --- go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index 1d0875d87285..7a348dd905bd 100644 --- a/go.sum +++ b/go.sum @@ -335,8 +335,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-2 h1:mtAyipQ1ZWVHUohQXtZ+Z0vXZQhZ5mZwCHAAXIzhyng= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-2/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-3 h1:m3BFZ+5PwLDsY9IURu29KPaPeZWpTMVqjiYcyrqzfhE= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-3/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= From eea287519a3c8db4810d382edd436746be1794d3 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 16 May 2024 12:42:11 +0900 Subject: [PATCH 16/21] bump up version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e510edcb28bd..48f9a8b2c344 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-3 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-4 diff --git a/go.sum b/go.sum index 7a348dd905bd..3f7d513e74f7 100644 --- a/go.sum +++ b/go.sum @@ -335,8 +335,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-3 h1:m3BFZ+5PwLDsY9IURu29KPaPeZWpTMVqjiYcyrqzfhE= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-3/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-4 h1:Mw8M3oimRrzgUAEHzKIWEXPvS4F6Gi3tXBjFWJb+40E= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-4/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= From daa584dc8bb3667f97a688c36c1bd459426dfb06 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 16 May 2024 13:49:26 +0900 Subject: [PATCH 17/21] debug --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 48f9a8b2c344..ea33d14234b2 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-4 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-5 diff --git a/go.sum b/go.sum index 3f7d513e74f7..412cffc6bf50 100644 --- a/go.sum +++ b/go.sum @@ -335,8 +335,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-4 h1:Mw8M3oimRrzgUAEHzKIWEXPvS4F6Gi3tXBjFWJb+40E= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-4/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-5 h1:IFJ8V6VC5dHcYsUBpwTx6p4OWKdJo0fFYgXtSLThdBg= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-5/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= From 2b6b498308af6b00425092c79458c16da5e4b284 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 20 May 2024 13:44:19 +0900 Subject: [PATCH 18/21] add debug log --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ea33d14234b2..2f66ad7975ca 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-5 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-6 From 1abaab8b5396a45866d053ad9be3036df35d9a51 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 20 May 2024 14:17:34 +0900 Subject: [PATCH 19/21] fix event list --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2f66ad7975ca..43074eb40819 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-6 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-7 diff --git a/go.sum b/go.sum index 412cffc6bf50..bc6b3c6eac62 100644 --- a/go.sum +++ b/go.sum @@ -335,8 +335,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-5 h1:IFJ8V6VC5dHcYsUBpwTx6p4OWKdJo0fFYgXtSLThdBg= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-5/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-7 h1:ceHK9nUa/VJhonuJdSQEdSmoJG+5iuMY/Qt3TMZDCYY= +github.com/smartnews/karpenter v0.36.0-fix-extra-node-7/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= From 91053d48581b97546abd7e236ed33621b8ea322d Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 23 May 2024 10:45:42 +0900 Subject: [PATCH 20/21] chore: fix extra node issue --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 43074eb40819..d1beb8f96b5d 100644 --- a/go.mod +++ b/go.mod @@ -116,4 +116,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-fix-extra-node-7 +replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-sn-2 diff --git a/go.sum b/go.sum index bc6b3c6eac62..25e235ecc666 100644 --- a/go.sum +++ b/go.sum @@ -335,8 +335,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-7 h1:ceHK9nUa/VJhonuJdSQEdSmoJG+5iuMY/Qt3TMZDCYY= -github.com/smartnews/karpenter v0.36.0-fix-extra-node-7/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= +github.com/smartnews/karpenter v0.36.0-sn-2 h1:OxCO1zuLbG3M18RdeQ7JWO9Lt3hxKDTCN853/qQYiLQ= +github.com/smartnews/karpenter v0.36.0-sn-2/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= From 0aea29f869d957b3118ec3d252b713fd8ca2ae9a Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 29 May 2024 11:40:04 +0900 Subject: [PATCH 21/21] bump up version --- go.mod | 2 +- go.sum | 6 ++---- pkg/controllers/interruption/controller.go | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index f108ed0595ef..c5b63252abb2 100644 --- a/go.mod +++ b/go.mod @@ -117,4 +117,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace sigs.k8s.io/karpenter v0.36.0 => github.com/smartnews/karpenter v0.36.0-sn-2 +replace sigs.k8s.io/karpenter v0.37.0 => github.com/smartnews/karpenter v0.37.0-sn-1 diff --git a/go.sum b/go.sum index a48b91325d88..425a561a8905 100644 --- a/go.sum +++ b/go.sum @@ -337,8 +337,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartnews/karpenter v0.36.0-sn-2 h1:OxCO1zuLbG3M18RdeQ7JWO9Lt3hxKDTCN853/qQYiLQ= -github.com/smartnews/karpenter v0.36.0-sn-2/go.mod h1:fieFojxOec/l0tDmFT7R+g/Y+SGQbL9VlcYO8xb3sLo= +github.com/smartnews/karpenter v0.37.0-sn-1 h1:thaABSIfSnrPhqaYHAMfNIcvIc6ihtyYwuVrQ1Q6DVk= +github.com/smartnews/karpenter v0.37.0-sn-1/go.mod h1:5XYrIz9Bi7HgQyaUsx7O08ft+TJjrH+htlnPq8Sz9J8= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -763,8 +763,6 @@ sigs.k8s.io/controller-runtime v0.18.2 h1:RqVW6Kpeaji67CY5nPEfRz6ZfFMk0lWQlNrLql sigs.k8s.io/controller-runtime v0.18.2/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/karpenter v0.37.0 h1:eUFD9hJ2mpZrw31OUYhpbxLWEDmbXT05wX27dZB2E5o= -sigs.k8s.io/karpenter v0.37.0/go.mod h1:5XYrIz9Bi7HgQyaUsx7O08ft+TJjrH+htlnPq8Sz9J8= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= diff --git a/pkg/controllers/interruption/controller.go b/pkg/controllers/interruption/controller.go index a4448d8b4c40..ea649add9904 100644 --- a/pkg/controllers/interruption/controller.go +++ b/pkg/controllers/interruption/controller.go @@ -205,9 +205,9 @@ func (c *Controller) handleNodeClaim(ctx context.Context, msg messages.Message, spotTotal.WithLabelValues(instanceType, zone, nodeClaim.Status.NodeName, nodeClaim.Labels["karpenter.sh/nodepool"]).Inc() // try to create a new nodeclaim immediately but ignore error if it fails if err := c.createNodeClaim(ctx, nodeClaim); err != nil { - logging.FromContext(ctx).Errorf("[interruption handling]failed to create a new nodeclaim, %v", err) + log.FromContext(ctx).Error(err, "[interruption handling]failed to create a new nodeclaim") } else { - logging.FromContext(ctx).Infof("Created new nodeclaim due to spot interruption") + log.FromContext(ctx).Info("Created new nodeclaim due to spot interruption") // wait for the node provisioning before draining time.Sleep(60 * time.Second) }