This repository was archived by the owner on Jul 26, 2022. It is now read-only.
File tree 4 files changed +47
-3
lines changed
4 files changed +47
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ The conversion is completely transparent to `Pods` that can access `Secrets` nor
16
16
17
17
![ Architecture] ( architecture.png )
18
18
19
- 1 . ` ExternalSecrets ` are added in the cluster (e.g., ` kubectly apply -f external-secret-example.yml` )
19
+ 1 . ` ExternalSecrets ` are added in the cluster (e.g., ` kubectl apply -f external-secret-example.yml` )
20
20
1 . Controller fetches ` ExternalSecrets ` using the Kubernetes API
21
21
1 . Controller uses ` ExternalSecrets ` to fetch secret data from external providers (e.g, AWS Secrets Manager)
22
22
1 . Controller upsert ` Secrets `
@@ -172,3 +172,31 @@ minikube start
172
172
173
173
npm run nodemon
174
174
` ` `
175
+
176
+ # ## Development with localstack
177
+
178
+ [Localstack](https://github.com/localstack/localstack) mocks AWS services locally so you can test without connecting to AWS.
179
+
180
+ Run localstack in a seperate terminal window
181
+
182
+ ` ` ` sh
183
+ npm run localstack
184
+ ` ` `
185
+
186
+ Start minikube as above
187
+
188
+ ` ` ` sh
189
+ minikube start
190
+ ` ` `
191
+
192
+ Run the daemon with localstack
193
+
194
+ ` ` ` sh
195
+ npm run local
196
+ ` ` `
197
+
198
+ Add secrets using the AWS cli (example)
199
+
200
+ ` ` ` sh
201
+ aws --endpoint-url=http://localhost:4584 secretsmanager create-secret --name hello-service/password --secret-string "1234"
202
+ ` ` `
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ /* eslint-disable no-process-env */
4
+
5
+ const localstack = process . env . LOCALSTACK || 0
6
+
7
+ const secretsManagerConfig = localstack ? { endpoint : 'http://localhost:4584' , region : 'us-west-2' } : { }
8
+ const systemManagerConfig = localstack ? { endpoint : 'http://localhost:4583' , region : 'us-west-2' } : { }
9
+
10
+ module . exports = {
11
+ secretsManagerConfig,
12
+ systemManagerConfig
13
+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const kube = require('kubernetes-client')
5
5
const KubeRequest = require ( 'kubernetes-client/backends/request' )
6
6
const pino = require ( 'pino' )
7
7
8
+ const awsConfig = require ( './aws-config' )
8
9
const envConfig = require ( './environment' )
9
10
const CustomResourceManager = require ( '../lib/custom-resource-manager' )
10
11
const customResourceManifest = require ( '../custom-resource-manifest.json' )
@@ -31,9 +32,9 @@ const customResourceManager = new CustomResourceManager({
31
32
logger
32
33
} )
33
34
34
- const secretsManagerClient = new AWS . SecretsManager ( )
35
+ const secretsManagerClient = new AWS . SecretsManager ( awsConfig . secretsManagerConfig )
35
36
const secretsManagerBackend = new SecretsManagerBackend ( { client : secretsManagerClient , logger } )
36
- const systemManagerClient = new AWS . SSM ( )
37
+ const systemManagerClient = new AWS . SSM ( awsConfig . systemManagerConfig )
37
38
const systemManagerBackend = new SystemManagerBackend ( { client : systemManagerClient , logger } )
38
39
const backends = {
39
40
secretsManager : secretsManagerBackend ,
Original file line number Diff line number Diff line change 6
6
"scripts" : {
7
7
"coverage" : " nyc ./node_modules/mocha/bin/_mocha --recursive lib" ,
8
8
"lint" : " eslint --fix --ignore-pattern /coverage/ ./" ,
9
+ "local" : " LOCALSTACK=1 nodemon" ,
10
+ "localstack" : " docker run -it -p 4583:4583 -p 4584:4584 -p 9999:8080 -e DEBUG=1 --rm localstack/localstack:0.9.4" ,
9
11
"release" : " standard-version --tag-prefix='' && ./release.sh" ,
10
12
"start" : " ./bin/daemon.js" ,
11
13
"nodemon" : " nodemon ./bin/daemon.js" ,
You can’t perform that action at this time.
0 commit comments