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

Add support for Enterprise License to be configured in Vault #1032

Merged
merged 21 commits into from
Feb 18, 2022

Conversation

jmurret
Copy link
Member

@jmurret jmurret commented Feb 14, 2022

Changes proposed in this PR:
For server-statefulset, client-agent-snapshot-deployment, and client-daemonset:

  • when vault is enabled as secrets backend, allow default behavior of retrieving kubernetes secret for enterprise license
  • when vault is enabled as secrets backend
    • use vault injectors to get retrieve the license from vault and write it to disk
    • use the license from disk to write the location of the vault injected license to the environment variable for the license. (server-statefulset and client-daemonset use CONSUL_LICENSE_PATH and client-agent-snapshot-deployment uses ENTERPRISE_LICENSE).
    • do not create a volume or a volumeMount for the license since it is not coming from kubernetes.

How I've tested this PR:

  • unit tests
  • acceptance tests

How I expect reviewers to test this PR:

  • review code and test changes

Checklist:

  • Tests added
  • CHANGELOG entry added
  • Acceptance tests added
  • Docs PR to describe how to enable this behavior

@jmurret
Copy link
Member Author

jmurret commented Feb 14, 2022

I'm most curious to talk through the VolumeMounts, how I should assume they will work, and whether those need to be modified.

@jmurret
Copy link
Member Author

jmurret commented Feb 14, 2022

I've also found these failure validations for gossipEncryption key that I also implemented for enterpriseLicense in this PR.

This has caused these two tests to fail. So, I amwondering:

  • should I modify the old tests? modify the added logic? just forgo this logic in the PR?
  • should these failure validations also be in client-daemonset and client-snapshot-agent-deployment? (likewise client-daemonset does not have the validations for gossip key).

@jmurret jmurret marked this pull request as ready for review February 17, 2022 02:43
@jmurret jmurret requested review from a team, kschoche and ishustava and removed request for a team February 17, 2022 15:27
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

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

Looking pretty good, John! I left some comments in-line.

acceptance/tests/vault/vault_test.go Outdated Show resolved Hide resolved
acceptance/tests/vault/vault_test.go Outdated Show resolved Hide resolved
charts/consul/templates/client-daemonset.yaml Show resolved Hide resolved
charts/consul/templates/server-statefulset.yaml Outdated Show resolved Hide resolved
@jmurret jmurret force-pushed the jm/vault-ent-license branch 2 times, most recently from 82f9f48 to 6977124 Compare February 17, 2022 21:14
…hat we can conditionally add consul-enterprise licence policy to the Vault Auth Roles.
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

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

A couple more comments about tests, but otherwise looks good!

acceptance/tests/vault/helpers.go Outdated Show resolved Hide resolved
…terpriseLicense.secretKey or secretName is supplied.
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

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

:shipit:

@jmurret jmurret merged commit ae206c9 into main Feb 18, 2022
@jmurret jmurret deleted the jm/vault-ent-license branch February 18, 2022 19:58
@jmurret jmurret added the vault label Mar 24, 2022
geobeau pushed a commit to geobeau/consul-k8s that referenced this pull request May 20, 2022
hashicorp#1032)

* update the wording for the consul sidecar to reflect current behaviour

Co-authored-by: Nitya Dhanushkodi <nitya@hashicorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants