Skip to content

Commit

Permalink
Merge pull request #204 from keenangraham/working
Browse files Browse the repository at this point in the history
fix: failing build
  • Loading branch information
andskli authored Dec 10, 2024
2 parents 11896bc + c7f220d commit 40baccc
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 581 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml

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

6 changes: 3 additions & 3 deletions .github/workflows/release.yml

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

16 changes: 16 additions & 0 deletions .projen/deps.json

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

6 changes: 5 additions & 1 deletion .projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const project = new awscdk.AwsCdkConstructLibrary({
'@aws-cdk/lambda-layer-kubectl-v25',
'@aws-cdk/lambda-layer-kubectl-v26',
'@aws-cdk/lambda-layer-kubectl-v27',
'@aws-cdk/lambda-layer-kubectl-v28',
'@aws-cdk/lambda-layer-kubectl-v29',
'@aws-cdk/lambda-layer-kubectl-v30',
'@aws-cdk/lambda-layer-kubectl-v31',
],
bundledDeps: [
'semver',
Expand Down Expand Up @@ -59,4 +63,4 @@ project.addTask('test:synth', {
exec: 'npx cdk synth -a "npx ts-node -P tsconfig.dev.json --prefer-ts-exts test/integ.karpenter.ts"',
});

project.synth();
project.synth();
6 changes: 5 additions & 1 deletion package.json

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

12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class Karpenter extends Construct {
name: this.serviceAccountName,
namespace: this.namespace,
});


// Setup the controller IAM Policy statements
this.addControllerPolicyIAMPolicyStatements();
Expand Down Expand Up @@ -191,7 +191,7 @@ export class Karpenter extends Construct {
// will override the dynamic values.
values: { ...this.helmExtraValues, ...this.helmChartValues },
});


// If we are not installing it in the `kube-system` namespace:
// Note: We should be installing it in kube-system, please see: https://github.com/aws/karpenter-provider-aws/blob/fd2b60759f81dc0c868810cc44443103067c4880/website/content/en/v0.36/upgrading/upgrade-guide.md?plain=1#L91
Expand All @@ -204,7 +204,7 @@ export class Karpenter extends Construct {
name: this.namespace,
},
});
// If we are creating a namespace, we need to link it to the service account and the chart, so they are deployed in the correct order.
// If we are creating a namespace, we need to link it to the service account and the chart, so they are deployed in the correct order.
this.serviceAccount.node.addDependency(namespace);
this.chart.node.addDependency(namespace);
}
Expand All @@ -230,7 +230,7 @@ export class Karpenter extends Construct {
]);

return this.addManifest(id, {
apiVersion: 'karpenter.k8s.aws/v1beta1',
apiVersion: 'karpenter.k8s.aws/v1',
kind: 'EC2NodeClass',
metadata: {
name: id,
Expand Down Expand Up @@ -258,7 +258,7 @@ export class Karpenter extends Construct {
Utils.hasRequiredKeys(nodePoolSpec.template.spec, ['nodeClassRef', 'requirements']);

return this.addManifest(id, {
apiVersion: 'karpenter.sh/v1beta1',
apiVersion: 'karpenter.sh/v1',
kind: 'NodePool',
metadata: {
name: id,
Expand Down Expand Up @@ -698,4 +698,4 @@ export class Karpenter extends Construct {
actions: ['eks:DescribeCluster'],
}));
}
}
}
10 changes: 5 additions & 5 deletions test/versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('Karpenter Versions', () => {
).toThrowError();
});

it('should allow for creation of v1beta1 APIs', () => {
it('should allow for creation of v1 APIs', () => {
const app = new cdk.App();
const stack = new cdk.Stack(app, 'test-stack');

Expand All @@ -139,7 +139,7 @@ describe('Karpenter Versions', () => {
template: {
spec: {
nodeClassRef: {
apiVersion: 'karpenter.k8s.aws/v1beta1',
apiVersion: 'karpenter.k8s.aws/v1',
kind: 'EC2NodeClass',
name: nodeClass.name,
},
Expand All @@ -162,15 +162,15 @@ describe('Karpenter Versions', () => {
'Fn::Join': [
'',
Match.arrayWith([
Match.stringLikeRegexp('\"apiVersion\":\"karpenter.k8s.aws\/v1beta1\",\"kind\":\"EC2NodeClass\",\"metadata\":{\"name\":\"ec2nodeclass\",\"namespace\":\"karpenter\"'),
Match.stringLikeRegexp('\"apiVersion\":\"karpenter.k8s.aws\/v1\",\"kind\":\"EC2NodeClass\",\"metadata\":{\"name\":\"ec2nodeclass\",\"namespace\":\"karpenter\"'),
]),
],
}),
}));

// NodePool manifest
t.hasResourceProperties('Custom::AWSCDK-EKS-KubernetesResource', Match.objectLike({
Manifest: Match.stringLikeRegexp('\"apiVersion\":\"karpenter.sh\/v1beta1\",\"kind\":\"NodePool\",\"metadata\":{\"name\":\"nodepool\",\"namespace\":\"karpenter\"'),
Manifest: Match.stringLikeRegexp('\"apiVersion\":\"karpenter.sh\/v1\",\"kind\":\"NodePool\",\"metadata\":{\"name\":\"nodepool\",\"namespace\":\"karpenter\"'),
}));
});

Expand Down Expand Up @@ -202,4 +202,4 @@ describe('Karpenter Versions', () => {
}),
);
});
});
});
Loading

0 comments on commit 40baccc

Please sign in to comment.