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

secrets from HashiCorp Vault #890

Merged
merged 3 commits into from
Jul 2, 2020
Merged

secrets from HashiCorp Vault #890

merged 3 commits into from
Jul 2, 2020

Conversation

nissanitz
Copy link
Contributor

Added support for authentication with secrets from HashiCorp Vault by expanding the TriggerAuthentication resource with vault property which contains the authentication settings.

Vault property allows next options:

  • address - Vault address (format - <scheme>://<host>:<port>)
  • authentication - authentication method (currently supported: token and kubernetes)
  • role and mount
  • credetial - defines the Hashicorp Vault credentials depending on the authentication method
  • secrets - list that defines the mapping between the path of the secret and the key in Vault to the parameter

for example:

apiVersion: keda.k8s.io/v1alpha1
kind: TriggerAuthentication
metadata:
  name: keda-trigger-auth-vault
  namespace: devops
spec:
  vault:
    address: <VAULT-ADDRESS>
    authentication: kubernetes
    role: <ROLE>
    mount: kubernetes
    credetial:
      serviceAccount: /var/run/secrets/kubernetes.io/serviceaccount/token
    secrets:
      - parameter: connection
        key: CONNECTION_STRING
        path: <SECRET-PATH>

Fixes #
#673

Signed-off-by: Nisan Itzhakov <nisan.mfy@gmail.com>
Copy link
Member

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind opening a PR for our docs as well please?

deploy/crds/keda.k8s.io_triggerauthentications_crd.yaml Outdated Show resolved Hide resolved
Signed-off-by: Nisan Itzhakov <nisan.mfy@gmail.com>
@nissanitz
Copy link
Contributor Author

PR to keda docs kedacore/keda-docs#199

@zroubalik
Copy link
Member

@nisan270390 do you think you could add some tests to cover this scenario?

@nissanitz
Copy link
Contributor Author

@zroubalik All the logic around HashiCorpVault Handler is in the initializing of the vault client, I don't see a way to write tests that will test this topic well

Secrets []VaultSecret `json:"secrets"`

// +optional
Credential Credential `json:"credetial"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there is a misspelling here that carries through in a couple other spots

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot, updated :)

Signed-off-by: Nisan Itzhakov <nisan.mfy@gmail.com>
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zroubalik zroubalik merged commit ecf07e9 into kedacore:master Jul 2, 2020
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

Successfully merging this pull request may close these issues.

5 participants