Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to sync to ConfigMaps as well as Secrets #32

Open
tdmalone opened this issue May 29, 2019 · 4 comments
Open

Option to sync to ConfigMaps as well as Secrets #32

tdmalone opened this issue May 29, 2019 · 4 comments

Comments

@tdmalone
Copy link

Hi there,

Thank you for putting this tool together - it's incredibly helpful and works great!

I'm syncing multiple parameters from SSM, some are 'secret' and some are just plain configuration data. To keep things semantically correct, I'd ideally like to sync the plain config data to a ConfigMap instead of a secret.

I'm fairly new to Kubernetes but my understanding at the moment is that ConfigMaps and Secrets are almost the same (Secrets are just base64 encoded for now and may have encryption features added in future). I'm wondering therefore whether it might be possible for this tool to also sync ConfigMap resources, using pretty much the same annotations?

@cmattoon
Copy link
Owner

I've actually been considering this, perhaps as part of a separate tool, maybe in conjunction with some code from dir2cm to load files from S3 into ConfigMaps.

You're right - they're roughly the same in the ways they're defined and used, with Secrets having . In theory, it could easily sync to ConfigMaps too; it just explicitly interacts with Secrets right now.

I'm currently refactoring this in Lambda (and starting a new job) so I might not get to this for a while, but feel free to send a PR.

@tdmalone
Copy link
Author

No worries - I haven’t written Go before, but this is probably a good place to start; I’ll try to get around to doing a PR (if no-one else does in the meantime).

Congrats on the new job!

@tdmalone
Copy link
Author

tdmalone commented Jun 14, 2019

Ok - I got this working on my fork:

master...tdmalone:master

Fair warning - I'm not a Go programmer. I almost literally copied and pasted the Secret configuration and did a find/replace.

It's working on my test cluster though!

I suspect for a PR you will want a much better job done with much less repetition; I wouldn't know how to go about that in Go but hopefully this helps anyone else who might want to use ConfigMaps in the meantime.

(Docker build also available at tdmalone/aws-ssm:latest, tracking my fork's master)

@wallentx
Copy link

If this could be included, this would be amazing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants