Skip to content

Commit

Permalink
karpneter 1.0.6 upgrade for 1.30 and 1.31
Browse files Browse the repository at this point in the history
  • Loading branch information
shapirov103 committed Oct 23, 2024
1 parent 1c697ef commit ea56963
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/blueprint-construct/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ export default class BlueprintConstruct {
serviceName: blueprints.AckServiceName.S3
}),
new blueprints.addons.KarpenterAddOn({
version: "0.37.5",
nodePoolSpec: this.nodePoolSpec,
ec2NodeClassSpec: this.nodeClassSpec,
interruptionHandling: true,
installCRDs: false
}),
new blueprints.addons.AwsNodeTerminationHandlerAddOn(),
new blueprints.addons.KubeviousAddOn(),
Expand Down
4 changes: 2 additions & 2 deletions lib/addons/apache-airflow/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function setUpLoadBalancer(clusterInfo: ClusterInfo, values: Values, albAddOnChe
/**
* Helper function to set up Logging with S3 Bucket
*/
function setUpLogging(clusterInfo: ClusterInfo, values: Values, ns: KubernetesManifest, namespace: string, bucket: IBucket): Values {
function setUpLogging(clusterInfo: ClusterInfo, values: Values, ns: Construct, namespace: string, bucket: IBucket): Values {

// Assert check to ensure you provide an S3 Bucket
assert(bucket, "Please provide the name of S3 bucket for Logging.");
Expand Down Expand Up @@ -275,7 +275,7 @@ function setUpLogging(clusterInfo: ClusterInfo, values: Values, ns: KubernetesMa
/**
*
*/
function setUpEFS(clusterInfo: ClusterInfo, values: Values, ns: KubernetesManifest, namespace: string, efsResourceName: string): [Values, KubernetesManifest] {
function setUpEFS(clusterInfo: ClusterInfo, values: Values, ns: Construct, namespace: string, efsResourceName: string): [Values, KubernetesManifest] {
// Check
const efsAddOnCheck = clusterInfo.getScheduledAddOn(EfsCsiDriverAddOn.name);
assert(efsAddOnCheck, `Missing a dependency: ${EfsCsiDriverAddOn.name}. Please add it to your list of addons.`);
Expand Down
8 changes: 4 additions & 4 deletions lib/addons/karpenter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ const RELEASE = 'blueprints-addon-karpenter';
*/
const defaultProps: HelmAddOnProps = {
name: KARPENTER,
namespace: KARPENTER,
version: '0.37.5',
namespace: "kube-system",
version: '1.0.6',
chart: KARPENTER,
release: KARPENTER,
repository: 'oci://public.ecr.aws/karpenter/karpenter',
Expand Down Expand Up @@ -360,7 +360,7 @@ export class KarpenterAddOn extends HelmAddOn {
const amiFamily = this.options.ec2NodeClassSpec?.amiFamily;
const amiSelector = this.options.ec2NodeClassSpec?.amiSelector || {};
const amiSelectorTerms = this.options.ec2NodeClassSpec?.amiSelectorTerms;
const instanceStorePolicy = this.options.ec2NodeClassSpec?.instanceStorePolicy || null;
const instanceStorePolicy = this.options.ec2NodeClassSpec?.instanceStorePolicy || undefined;
const userData = this.options.ec2NodeClassSpec?.userData || "";
const instanceProf = this.options.ec2NodeClassSpec?.instanceProfile;
const tags = this.options.ec2NodeClassSpec?.tags || {};
Expand Down Expand Up @@ -631,7 +631,7 @@ export class KarpenterAddOn extends HelmAddOn {
}

// Instance Store Policy added for v0.34.0 and up
if (semver.gte(version, '0.34.0')){
if (semver.gte(version, '0.34.0') && instanceStorePolicy){
ec2Node = merge(ec2Node, { spec: { instanceStorePolicy: instanceStorePolicy }});
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/addons/velero/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class VeleroAddOn extends HelmAddOn {
* @param namespace
* @returns the namespace created or existed.
*/
protected createNamespaceIfNeeded(clusterInfo: ClusterInfo, defaultName: string, namespace: string, create: boolean): {name: string, manifest?: KubernetesManifest} {
protected createNamespaceIfNeeded(clusterInfo: ClusterInfo, defaultName: string, namespace: string, create: boolean): {name: string, manifest?: Construct} {
// Create Namespace if namespace is not explicied defined.
if (namespace){
// Create Namespace if the "create" option is true
Expand Down
3 changes: 3 additions & 0 deletions lib/utils/namespace-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { Values } from "../spi";
* @returns KubernetesManifest
*/
export function createNamespace(name: string, cluster: eks.ICluster, overwrite?: boolean, prune?: boolean, annotations?: Values, labels? : Values) {
if(name === "kube-system") {
return cluster.clusterSecurityGroup; // a construct that is populated for the cluster l
}
return new KubernetesManifest(cluster.stack, `${name}-namespace-struct`, {
cluster: cluster,
manifest: [{
Expand Down

0 comments on commit ea56963

Please sign in to comment.