diff --git a/.gitignore b/.gitignore index 459ff0ba0a8b..a16f38e27138 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ go.work.sum # Project Specific *.csv + +# My stuff +/log* diff --git a/Makefile b/Makefile index f3e3a4879075..0406dc36e952 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/pkg/cloudprovider/cloudprovider.go b/pkg/cloudprovider/cloudprovider.go index c53136eed133..4c4a5289adfc 100644 --- a/pkg/cloudprovider/cloudprovider.go +++ b/pkg/cloudprovider/cloudprovider.go @@ -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 { diff --git a/pkg/providers/instance/instance.go b/pkg/providers/instance/instance.go index a6efb8762181..a9d038b5f02b 100644 --- a/pkg/providers/instance/instance.go +++ b/pkg/providers/instance/instance.go @@ -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 @@ -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 {