Skip to content

Commit

Permalink
fixing IRSA issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpaws committed Sep 11, 2024
1 parent d0d6615 commit b18f5e7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export class CrossplaneHelmProviderAddon implements blueprints.ClusterAddOn {
metadata: { name: "helm-provider" },
spec: {
package: 'xpkg.upbound.io/crossplane-contrib/provider-helm:'+this.helmProviderVersion,

runtimeConfigRef: {
name: "helm-runtime-config"
}
Expand All @@ -80,6 +79,6 @@ export class CrossplaneHelmProviderAddon implements blueprints.ClusterAddOn {
});

awsHelmProvider.node.addDependency(runtimeHelmConfig);
return Promise.resolve(runtimeHelmConfig);
return Promise.resolve(awsHelmProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ export class CrossplaneK8sProviderAddon implements blueprints.ClusterAddOn {
manifest: [roleBinding, runtimeConfig]
});

const awsK8sProvider1 = new eks.KubernetesManifest(clusterInfo.cluster.stack, "awsK8sProvider1", {
const awsK8sProvider = new eks.KubernetesManifest(clusterInfo.cluster.stack, "awsK8sProvider", {
cluster: cluster,
manifest: [providerK8sResource]
});

awsK8sProvider1.node.addDependency(runtimeK8sConfig);
awsK8sProvider.node.addDependency(runtimeK8sConfig);

return Promise.resolve(runtimeK8sConfig);
return Promise.resolve(awsK8sProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export class UpboundCrossplaneAddOn extends blueprints.HelmAddOn {
const sa = cluster.addServiceAccount(serviceAccountName, {
name: serviceAccountName,
namespace: this.options.namespace!,

});
sa.node.addDependency(ns);
sa.role.attachInlinePolicy(new Policy(cluster.stack, 'eks-connect-policy', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class UpboundCrossplaneEKSProviderAddOn implements blueprints.ClusterAddO
deploy(clusterInfo: blueprints.ClusterInfo): void | Promise<Construct> {
const cluster = clusterInfo.cluster;

// Create the CrossPlane AWS Provider IRSA.
// Create the CrossPlane EKS Provider IRSA.
const serviceAccountName = "provider-aws-eks";
const upboundNamespace = "upbound-system";
const sa = cluster.addServiceAccount(serviceAccountName, {
Expand All @@ -39,7 +39,11 @@ export class UpboundCrossplaneEKSProviderAddOn implements blueprints.ClusterAddO
}
]
})}));


clusterInfo.addAddOnContext(UpboundCrossplaneEKSProviderAddOn.name, {
arn: sa.role.roleArn
});

const runtimeConfig = new eks.KubernetesManifest(clusterInfo.cluster.stack, "runtimeConfig", {
cluster: cluster,
manifest: [
Expand Down Expand Up @@ -84,7 +88,8 @@ export class UpboundCrossplaneEKSProviderAddOn implements blueprints.ClusterAddO
],
});

runtimeConfig.node.addDependency(sa);
awsEksProvider.node.addDependency(runtimeConfig);
return Promise.resolve(runtimeConfig);
return Promise.resolve(awsEksProvider);
}
}

0 comments on commit b18f5e7

Please sign in to comment.