diff --git a/bin/main.ts b/bin/main.ts index 5c61add..49fd5f0 100644 --- a/bin/main.ts +++ b/bin/main.ts @@ -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'); diff --git a/helm/charts/rezilion-charts/index.yaml b/helm/charts/rezilion-charts/index.yaml index 02a7816..e29405a 100644 --- a/helm/charts/rezilion-charts/index.yaml +++ b/helm/charts/rezilion-charts/index.yaml @@ -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" diff --git a/helm/charts/rezilion-charts/rezilion-0.0.1.tgz b/helm/charts/rezilion-charts/rezilion-0.0.1.tgz index d687496..dc911fa 100644 Binary files a/helm/charts/rezilion-charts/rezilion-0.0.1.tgz and b/helm/charts/rezilion-charts/rezilion-0.0.1.tgz differ diff --git a/helm/charts/rezilion/templates/rezilion.yaml b/helm/charts/rezilion/templates/rezilion.yaml index 4f23795..edf157d 100644 --- a/helm/charts/rezilion/templates/rezilion.yaml +++ b/helm/charts/rezilion/templates/rezilion.yaml @@ -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" @@ -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 diff --git a/lib/index.ts b/lib/index.ts index b6571d3..ef6362c 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -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 { @@ -30,34 +29,11 @@ export class RezilionAddOn extends HelmAddOn { } deploy(clusterInfo: ssp.ClusterInfo): void | Promise { - 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); }