Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yonilevy1 committed Jan 11, 2022
1 parent e2e7695 commit c0418f1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 38 deletions.
6 changes: 3 additions & 3 deletions bin/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { App } from '@aws-cdk/core';
import * as ssp from '@aws-quickstart/ssp-amazon-eks';
//import * as wego from '@weaveworksoss/weavegitops-ssp-addon';
import { RezilionAddOn } from '../lib';

const app = new App();

ssp.EksBlueprint.builder()
.addOns(new RezilionAddOn({
cloudWatchRegion: 'us-east-1',
values: {api_key: 'dynamic_test_api_key'}
apiKey: 'dynamic_test_api_key'
}))
.build(app, 'ssp-addon-myextension-rezilion-test');
.build(app, 'ssp-rezilion-addon');
6 changes: 3 additions & 3 deletions helm/charts/rezilion-charts/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ entries:
rezilion:
- apiVersion: v2
appVersion: 0.0.1
created: "2022-01-10T16:15:13.77713346+02:00"
created: "2022-01-11T10:58:01.143879214+02:00"
description: Rezilion AddOn
digest: f8ca5fd9c30046cf4b209463a75b205562b1dc473f440f608d13d15196467431
digest: d4aae9a690c91a4f0385bae1c31ba6584fafe87cd3d6f5dc7b577c2a0fffad29
name: rezilion
type: application
urls:
- https://lzl-ssp-helm-test.s3.eu-west-1.amazonaws.com/rezilion-0.0.1.tgz
version: 0.0.1
generated: "2022-01-10T16:15:13.774745124+02:00"
generated: "2022-01-11T10:58:01.140872183+02:00"
Binary file modified helm/charts/rezilion-charts/rezilion-0.0.1.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions helm/charts/rezilion/templates/rezilion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
- name: rezilioncreds
containers:
- name: rezilion-hermes
image: public.ecr.aws/n1j6b8j1/632012995384.dkr.ecr.eu-west-1.amazonaws.com/rezilion-hermes:c76d5660
image: public.ecr.aws/n1j6b8j1/632012995384.dkr.ecr.eu-west-1.amazonaws.com/rezilion-hermes:latest
resources:
requests:
memory: "500M"
Expand All @@ -75,7 +75,7 @@ spec:
command:
- /bin/sh
- -c
- ps -ef | grep maia | grep -v grep || echo "FIXME"
- ps -ef | grep maia | grep -v grep
imagePullPolicy: Always
securityContext:
privileged: true
Expand Down
36 changes: 6 additions & 30 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ import merge from "ts-deepmerge";
import { HelmAddOn, HelmAddOnProps, HelmAddOnUserProps } from '@aws-quickstart/ssp-amazon-eks/dist/addons/helm-addon';

export interface RezilionAddOnProps extends HelmAddOnUserProps {
cloudWatchRegion: string
apiKey: string
}


export const defaultProps: HelmAddOnProps & RezilionAddOnProps = {
chart: 'rezilion',
cloudWatchRegion: 'us-east-1',
name: 'rezilion',
namespace: 'kube-system',
release: 'rezilion',
version: '0.0.1',
repository: 'https://lzl-ssp-helm-test.s3.eu-west-1.amazonaws.com',
values: {}
apiKey: 'placeholder'
}

export class RezilionAddOn extends HelmAddOn {
Expand All @@ -30,34 +29,11 @@ export class RezilionAddOn extends HelmAddOn {
}

deploy(clusterInfo: ssp.ClusterInfo): void | Promise<Construct> {
const serviceAccountName = 'aws-for-rezilion-sa';
const sa = clusterInfo.cluster.addServiceAccount('my-aws-for-rezilion-sa', {
name: serviceAccountName,
namespace: this.props.namespace
});
const values = this.options.values ?? {};
values['apiKey'] = this.options.apiKey

// Cloud Map Full Access policy.
const cloudWatchAgentPolicy = ManagedPolicy.fromAwsManagedPolicyName("CloudWatchAgentServerPolicy");
sa.role.addManagedPolicy(cloudWatchAgentPolicy);

const values = this.options.values ?? {api_key: 'no_api_key'};
const defaultValues = {
apiKey: values.api_key
};

const merged = merge(defaultValues, values);

const chart = this.addHelmChart(clusterInfo, {
serviceAccount: {
create: false,
name: serviceAccountName
},
cloudWatch: {
region: this.options.cloudWatchRegion
},
values: values
});
chart.node.addDependency(sa);
const chart = this.addHelmChart(clusterInfo,
values);

return Promise.resolve(chart);
}
Expand Down

0 comments on commit c0418f1

Please sign in to comment.