Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andskli committed Jan 16, 2025
2 parents 1823704 + a1b9070 commit 8b3529d
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 89 deletions.
22 changes: 14 additions & 8 deletions test/integ.karpenter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { KubectlV27Layer } from '@aws-cdk/lambda-layer-kubectl-v27';
import { KubectlV31Layer } from '@aws-cdk/lambda-layer-kubectl-v31';
import { App, CfnOutput, Stack, StackProps } from 'aws-cdk-lib';
import { Vpc } from 'aws-cdk-lib/aws-ec2';
import { Cluster, CoreDnsComputeType, KubernetesVersion } from 'aws-cdk-lib/aws-eks';
import { AuthenticationMode, Cluster, CoreDnsComputeType, KubernetesVersion } from 'aws-cdk-lib/aws-eks';
import { ManagedPolicy, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
import { Construct } from 'constructs';

Expand All @@ -26,10 +26,11 @@ class TestEKSStack extends Stack {
const cluster = new Cluster(this, 'testCluster', {
vpc: vpc,
role: clusterRole,
version: KubernetesVersion.V1_27, // OCI HELM repo only supported by new version.
version: KubernetesVersion.V1_31, // OCI HELM repo only supported by new version.
defaultCapacity: 0,
coreDnsComputeType: CoreDnsComputeType.FARGATE,
kubectlLayer: new KubectlV27Layer(this, 'KubectlLayer'), // new Kubectl lambda layer
kubectlLayer: new KubectlV31Layer(this, 'KubectlLayer'), // new Kubectl lambda layer
authenticationMode: AuthenticationMode.API_AND_CONFIG_MAP,
});

cluster.addFargateProfile('karpenter', {
Expand All @@ -48,11 +49,16 @@ class TestEKSStack extends Stack {

const karpenter = new Karpenter(this, 'Karpenter', {
cluster: cluster,
version: 'v0.32.0', // test the newest version
version: '1.1.1', // test a recent version
});

const nodeClass = karpenter.addEC2NodeClass('nodeclass', {
amiFamily: 'AL2',
amiFamily: 'Bottlerocket',
amiSelectorTerms: [
{
alias: 'bottlerocket@latest',
},
],
subnetSelectorTerms: [
{
tags: {
Expand All @@ -74,7 +80,7 @@ class TestEKSStack extends Stack {
template: {
spec: {
nodeClassRef: {
apiVersion: 'karpenter.k8s.aws/v1beta1',
group: 'karpenter.k8s.aws',
kind: 'EC2NodeClass',
name: nodeClass.name,
},
Expand Down Expand Up @@ -119,4 +125,4 @@ new TestEKSStack(app, 'test', {
},
});

app.synth();
app.synth();
156 changes: 75 additions & 81 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8b3529d

Please sign in to comment.