Skip to content

Commit

Permalink
fix comments from reviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Howlla committed Mar 21, 2024
1 parent 6f858b4 commit a7d2847
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 44 deletions.
6 changes: 3 additions & 3 deletions lib/single-new-eks-cost-monitoring-pattern/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Construct } from 'constructs';
import * as cdk from "aws-cdk-lib";
import * as blueprints from '@aws-quickstart/eks-blueprints';
import { GlobalResources, LookupHostedZoneProvider, ObservabilityBuilder } from '@aws-quickstart/eks-blueprints';
import { GrafanaOperatorSecretAddon } from './grafanaoperatorsecretaddon';
import { KubecostServiceAccountsAddon } from './kubecostserviceaccountsaddon';
import { KubecostAddOn, KubecostAddOnProps } from '@kubecost/kubecost-eks-blueprints-addon';
import * as amp from 'aws-cdk-lib/aws-aps';
import * as eks from 'aws-cdk-lib/aws-eks';
Expand Down Expand Up @@ -148,7 +148,7 @@ export default class SingleNewEksCostMonitoringPattern extends cdk.Stack {
new KubeCostExtensionAddon({
namespace:"kubecost",
version:"1.108.1",
kubecostToken: "Z2dvZDk5OUBnbWFpbC5jb20=xm343yadf98",
kubecostToken: blueprints.utils.valueFromContext(scope, "dev.subzone.name", "get token from kubecost.com/install"),
values: {
global: {
amp: {
Expand Down Expand Up @@ -215,7 +215,7 @@ export default class SingleNewEksCostMonitoringPattern extends cdk.Stack {
},
adminPasswordSecretName: SECRET_ARGO_ADMIN_PWD,
}),
new GrafanaOperatorSecretAddon()
new KubecostServiceAccountsAddon()
];

const mngProps: blueprints.MngClusterProviderProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import * as blueprints from '@aws-quickstart/eks-blueprints';
import * as eks from "aws-cdk-lib/aws-eks";
import { ManagedPolicy } from "aws-cdk-lib/aws-iam";
import { Construct } from 'constructs';
import { createNamespace, dependable } from '@aws-quickstart/eks-blueprints/dist/utils';

export class GrafanaOperatorSecretAddon implements blueprints.ClusterAddOn {

export class KubecostServiceAccountsAddon implements blueprints.ClusterAddOn {
id?: string | undefined;
@dependable(blueprints.addons.ExternalsSecretsAddOn.name)
@blueprints.utils.dependable(blueprints.addons.ExternalsSecretsAddOn.name)
deploy(clusterInfo: blueprints.ClusterInfo): void | Promise<Construct> {
const cluster = clusterInfo.cluster;

Expand All @@ -31,7 +31,7 @@ export class GrafanaOperatorSecretAddon implements blueprints.ClusterAddOn {
serviceAccount2.role.addManagedPolicy(policyRead);
serviceAccount2.role.addManagedPolicy(policyWrite);

const namespace = createNamespace("kubecost",cluster);
const namespace = blueprints.utils.createNamespace("kubecost",cluster);

serviceAccount1.node.addDependency(namespace);
serviceAccount2.node.addDependency(namespace);
Expand Down Expand Up @@ -66,37 +66,7 @@ export class GrafanaOperatorSecretAddon implements blueprints.ClusterAddOn {
],
});

// const externalSecret = new eks.KubernetesManifest(clusterInfo.cluster.stack, "ExternalSecret", {
// cluster: cluster,
// manifest: [
// {
// apiVersion: "external-secrets.io/v1beta1",
// kind: "ExternalSecret",
// metadata: {
// name: "external-grafana-admin-credentials",
// namespace: "grafana-operator"
// },
// spec: {
// secretStoreRef: {
// name: "ssm-parameter-store",
// kind: "ClusterSecretStore",
// },
// target: {
// name: "grafana-admin-credentials"
// },
// data: [
// {
// secretKey: "GF_SECURITY_ADMIN_APIKEY",
// remoteRef: {
// key: "/cdk-accelerator/grafana-api-key"
// },
// },
// ],
// },
// },
// ],
// });
// externalSecret.node.addDependency(secretStore);

return Promise.resolve(secretStore);
}
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx"
},
"devDependencies": {
"@aws-quickstart/eks-blueprints": "^1.13.1",
"@aws-quickstart/eks-blueprints": "^1.14.0",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"aws-cdk": "2.114.1",
"aws-cdk": "2.132.0",
"copyfiles": "^2.4.1",
"eslint": "^8.55.0",
"jest": "^29.7.0",
Expand All @@ -24,17 +24,17 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@aws-quickstart/eks-blueprints": "^1.13.1",
"@aws-quickstart/eks-blueprints": "^1.14.0",
"@kubecost/kubecost-eks-blueprints-addon": "^0.1.8",
"aws-cdk": "2.114.1",
"aws-cdk": "2.132.0",
"aws-sdk": "^2.1455.0",
"constructs": "^10.3.0",
"eks-blueprints-cdk-kubeflow-ext": "0.1.9",
"source-map-support": "^0.5.21"
},
"overrides": {
"@aws-quickstart/eks-blueprints": "^1.13.1",
"aws-cdk": "2.114.1",
"@aws-quickstart/eks-blueprints": "^1.14.0",
"aws-cdk": "2.132.0",
"xml2js": "0.5.0"
}
}

0 comments on commit a7d2847

Please sign in to comment.