-
Notifications
You must be signed in to change notification settings - Fork 190
/
index.ts
69 lines (59 loc) · 2.07 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { Construct } from "constructs";
import { ClusterAddOn, ClusterInfo } from '../../spi';
import { HelmAddOnUserProps } from '../helm-addon';
import { CsiDriverProviderAws } from './csi-driver-provider-aws';
import { cloneDeep, supportsALL } from "../../utils";
/**
* Configuration options for Secrets Store AddOn
*/
export interface SecretsStoreAddOnProps extends HelmAddOnUserProps {
/**
* Namespace where Secrets Store CSI driver will be installed
* @default 'kube-system'
*/
readonly namespace?: string;
/**
* Version of the Secrets Store CSI Driver. Eg. v0.0.23
* @default 'v0.0.23/'
*/
readonly version?: string;
/**
* Rotation Poll Interval, e.g. '120s'.
* @default undefined
* If provided, sets auto rotation to true and sets the polling interval.
*/
readonly rotationPollInterval?: string;
/**
* Enable Sync Secrets to kubernetes secrets
*/
readonly syncSecrets?: boolean;
/**
* ASCP secret and configuration provider URL for provisioning.
*/
readonly ascpUrl?: string
}
/**
* Defaults options for the add-on
*/
const defaultProps: SecretsStoreAddOnProps = {
ascpUrl: 'https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/deployment/aws-provider-installer.yaml',
chart: 'secrets-store-csi-driver',
name: 'secrets-store-csi-driver',
namespace: 'kube-system',
version: '1.4.1',
release: 'blueprints-addon-secret-store-csi-driver',
repository: 'https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts',
rotationPollInterval: undefined,
syncSecrets: true,
};
@supportsALL
export class SecretsStoreAddOn implements ClusterAddOn {
private options: SecretsStoreAddOnProps;
constructor(props?: SecretsStoreAddOnProps) {
this.options = cloneDeep({ ...defaultProps, ...props });
}
deploy(clusterInfo: ClusterInfo): Promise<Construct> {
const csiDriverProviderAws = new CsiDriverProviderAws(this.options);
return Promise.resolve(csiDriverProviderAws.deploy(clusterInfo));
}
}