Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobValdemar committed Sep 25, 2023
1 parent c24a14a commit be9aeaf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ go.work.sum

# Project Specific
*.csv

# My stuff
/log*
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export K8S_VERSION ?= 1.27.x
CLUSTER_NAME ?= $(shell ../kubectl config view --minify -o jsonpath='{.clusters[].name}' | rev | cut -d"/" -f1 | rev | cut -d"." -f1)

AWS_DEFAULT_REGION ?= eu-west-1
## Inject the app version into project.Version
ifdef SNAPSHOT_TAG
LDFLAGS ?= -ldflags=-X=github.com/aws/karpenter/pkg/utils/project.Version=$(SNAPSHOT_TAG)
Expand Down
1 change: 1 addition & 0 deletions pkg/cloudprovider/cloudprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ func (c *CloudProvider) resolveNodeTemplate(ctx context.Context, raw []byte, obj
return nodeTemplate, nil
}

// JANOTE: calls into karpenter-core scheduling
func (c *CloudProvider) resolveInstanceTypes(ctx context.Context, nodeClaim *corev1beta1.NodeClaim, nodeClass *v1beta1.EC2NodeClass) ([]*cloudprovider.InstanceType, error) {
instanceTypes, err := c.instanceTypeProvider.List(ctx, nodeClaim.Spec.Kubelet, nodeClass)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/providers/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (p *Provider) Create(ctx context.Context, nodeClass *v1beta1.EC2NodeClass,
instanceTypes = instanceTypes[0:MaxInstanceTypes]
}
tags := getTags(ctx, nodeClass, nodeClaim)
fleetInstance, err := p.launchInstance(ctx, nodeClass, nodeClaim, instanceTypes, tags)
fleetInstance, err := p.launchInstance(ctx, nodeClass, nodeClaim, instanceTypes, tags) // JANOTE
if awserrors.IsLaunchTemplateNotFound(err) {
// retry once if launch template is not found. This allows karpenter to generate a new LT if the
// cache was out-of-sync on the first try
Expand Down Expand Up @@ -219,6 +219,7 @@ func (p *Provider) launchInstance(ctx context.Context, nodeClass *v1beta1.EC2Nod
{ResourceType: aws.String(ec2.ResourceTypeFleet), Tags: utils.MergeTags(tags)},
},
}
// JANOTE: here fleet is created. Use prioritized instead?
if capacityType == corev1beta1.CapacityTypeSpot {
createFleetInput.SpotOptions = &ec2.SpotOptionsRequest{AllocationStrategy: aws.String(ec2.SpotAllocationStrategyPriceCapacityOptimized)}
} else {
Expand Down

0 comments on commit be9aeaf

Please sign in to comment.