-
Notifications
You must be signed in to change notification settings - Fork 113
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
Make build operator leader durations configurable #433
Make build operator leader durations configurable #433
Conversation
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.
Nice work. Requesting two additions:
- a unit test where
BUILD_OPERATOR_LEADER_ELECTION_NAMESPACE
is set - documentation for the environment variables, maybe just add a new file within the docs folder about the manager configuration; we will need to link this from somewhere then separately (the metrics.md is currently also not referenced from anywhere which we will also need to fix)
A comment:
|
In case the build operator needs to be started with very specific leader lease duration configuration, there is currently no way to configure it. Introduce new section in build configuration that contains some of the manager options to be configurable and passed through to the manager. Pass new section values as-is into the manager options for the build operator setup. Any `nil` value will result in the default value. Add four new environment variables to override these settings: - `BUILD_OPERATOR_LEADER_ELECTION_NAMESPACE` - `BUILD_OPERATOR_LEASE_DURATION` - `BUILD_OPERATOR_RENEW_DEADLINE` - `BUILD_OPERATOR_RETRY_PERIOD` Hint: All duration based environment variables use the time duration parse function, so they expect an input like `42s`.
In order to make it more readable and distinguishable, rename `c` to a name that is more descriptive: `buildCfg`.
The current namespace of the build-operator lock configmap is hard-coded to be `default` at the moment. With the new override possibilities, it can be set to a more suitable location. Use downward API to set `BUILD_OPERATOR_LEADER_ELECTION_NAMESPACE` environment variable in the deployment YAML for the build-operator to be the same namespace as the operator pod is located in.
Add new configuration documentation to explain the possible overrides of the build-operator using environment variables.
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SaschaSchwarze0 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In case the build operator needs to be started with very specific leader
lease duration configuration, there is currently no way to configure it.
Introduce new section in build configuration that contains some of the
manager options to be configurable and passed through to the manager.
Pass new section values as-is into the manager options for the build
operator setup. Any
nil
value will result in the default value.Add four new environment variables to override these settings:
BUILD_OPERATOR_LEADER_ELECTION_NAMESPACE
BUILD_OPERATOR_LEASE_DURATION
BUILD_OPERATOR_RENEW_DEADLINE
BUILD_OPERATOR_RETRY_PERIOD
Please note: All duration based environment variables use the time duration
parse function, so they expect an input like
42s
.This should fix #414.