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

Creating image pull secrets? #54

Closed
jiphex opened this issue Nov 12, 2020 · 3 comments
Closed

Creating image pull secrets? #54

jiphex opened this issue Nov 12, 2020 · 3 comments

Comments

@jiphex
Copy link

jiphex commented Nov 12, 2020

I'm just interested if anyone's got a good way to use vault-secrets-operator to generate Kubernetes-compatible Image Pull Secrets?

I realise that I could do this (I think) by creating a VaultSecret object referencing a path in Vault which stores a raw .dockerconfigjson style key (as shown in a previous issue), but I guess really I'd like the keys in the Vault secret to be stored with more useful keys (e.g docker-server,docker-password etc like you can do with kubectl create secret docker-registry).

Maybe I can just implement this with the templates proposed by @bartmeuris, but I feel like this is something that people must have hit before and had a way of sorting?

@ricoberger
Copy link
Owner

Hi @jiphex, we are still creating image pull secrets in the way mentioned in the linked issue (#14). Since @bartmeuris PR is merged now and available in the latest release 1.9.0, we may switch to this approach.

@jiphex jiphex closed this as completed Nov 14, 2020
@jiphex
Copy link
Author

jiphex commented Nov 14, 2020

Thanks @ricoberger that's useful

@jiphex
Copy link
Author

jiphex commented Nov 16, 2020

Just in case someone comes across this in future, I've made this work now using the templates support from 1.9.0

apiVersion: ricoberger.de/v1alpha1
kind: VaultSecret
metadata:
  name: an-image-pull-secret
spec:
  path: secret/some-vault-path
  type: kubernetes.io/dockerconfigjson
  templates:
    .dockerconfigjson: '{"auths":{"hostname.of.registry.com":{"username":"{% .Secrets.username %}","password":"{% .Secrets.token %}"}}}'

This assumes that the Path is a Vault KV object with username and token keys.

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

2 participants