-
Notifications
You must be signed in to change notification settings - Fork 601
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
CORE-7343 License: add fallback license env var #23583
Conversation
/dt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems legit
src/v/cluster/feature_manager.cc
Outdated
@@ -309,17 +309,36 @@ void feature_manager::verify_enterprise_license() { | |||
} | |||
|
|||
const auto& license = _feature_table.local().get_license(); | |||
auto license_missing_or_expired = !license || license->is_expired(); | |||
std::optional<security::license> fallback_license = std::nullopt; | |||
auto fallback_license_str = std::getenv("RP_FALLBACK_ENTERPRISE_LICENSE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's tons of precedent for this, but maybe
auto fallback_license_str = std::getenv("RP_FALLBACK_ENTERPRISE_LICENSE"); | |
auto fallback_license_str = std::getenv("REDPANDA_FALLBACK_ENTERPRISE_LICENSE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prior art of existing env vars:
- Redpanda:
RP_SI_CREDS_API_ADDRESS (undocumented)
RP_BOOTSTRAP_USER (only documented Redpanda env var)
RP_FIXTURE_ENV (testing)
REDPANDA_ENVIRONMENT (undocumented, set by operator to "kubernetes", used for phone-home data)
__REDPANDA_SKIP_IAM_TOKEN (testing)
__REDPANDA_LICENSE_CHECK_INTERVAL_SEC (testing)
__REDPANDA_TOPIC_REC_DL_CHECK_MILLIS (testing)
__REDPANDA_TEST_FEATURES (testing)
__REDPANDA_TEST_FEATURE_NO_AUTO_ACTIVATE_BRAVO (testing)
__REDPANDA_LATEST_LOGICAL_VERSION (testing)
__REDPANDA_EARLIEST_LOGICAL_VERSION (testing)
__REDPANDA_TEST_DISK_SIZE (testing)
- Rpk uses
REDPANDA_
prefix - Wasm transforms use the
REDPANDA_
prefix
So, there is no clear consistency so far, but I think it makes sense to prefer the REDPANDA_
prefix for this and env vars going forward. Some env vars also use the __
prefix, but that seems to be the pattern for test-only variables, so I think we don't want to add that for this variable.
I've changed this to REDPANDA_FALLBACK_ENTERPRISE_LICENSE
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah, missed RP_BOOTSTRAP_USER
. The __
prefix is definitely meant for "hidden" knobs, so no worries there. I don't think it's worth belaboring too much, but we might want to ask product.
62cd9b9
to
fb8fc5f
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems legit
too legit to quit
new failures in https://buildkite.com/redpanda/redpanda/builds/55642#01924cfd-80f8-4475-83b8-9c35ab4bd3be:
|
...instead of `const ss:string&` to allow passing in the contents of an environment variable stored as a `char*`.
This is to make it easier to reuse the assertion and its message outside of `redpanda.install_license`. I am going to reuse it in the next commit.
This adds an environment variable that can be used to insert an enterprise license on startup into a non-compliant cluster when it is failing the license enforcement check. This should be an undocumented escape hatch we can use if we ever need to inject a license into this check without being able to add it into the controller log via `rpk cluster license set` (eg. if we can't downgrade the broker to a previous version).
0847ba1
fb8fc5f
to
0847ba1
Compare
Force-push: rebased to dev now that the base PR is merged |
This is part of a series of changes to verify that clusters have a valid enterprise license during major version upgrades if they use enterprise features.
This adds an environment variable that can be used to insert an enterprise license on startup into a non-compliant cluster when it is failing the license enforcement check. This should be an undocumented escape hatch we can use if we ever need to inject a license into this check if we cannot add it into the controller log via
rpk cluster license set
(eg. if we cannot downgrade the broker to a previous version for any reason).Fixes https://redpandadata.atlassian.net/browse/CORE-7343
Backports Required
Release Notes