-
Notifications
You must be signed in to change notification settings - Fork 23
feat: use kubernetes lease election for Trillian log signer #851
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
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: osmman 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 |
8deaa46 to
b9ca11d
Compare
|
/test all |
b9ca11d to
42e53f0
Compare
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
42e53f0 to
5b79903
Compare
|
@sourcery-ai review |
Reviewer's GuideThis PR upgrades the Trillian log signer to use Kubernetes lease-based leader election by injecting pod identity into the server deployment, switching to k8s election flags, and extending RBAC and controller markers to allow coordination.k8s.io/leases access. Sequence Diagram: Trillian Log Signer Acquiring Kubernetes LeasesequenceDiagram
participant SignerPod as Trillian Log Signer Pod
participant K8sAPI as Kubernetes API Server
SignerPod->>SignerPod: Initialize with election flags:<br>--election_system=k8s<br>--lock_namespace=$(NAMESPACE)<br>--lock_holder_identity=$(POD_NAME)
SignerPod->>SignerPod: Read POD_NAME & NAMESPACE from Env Vars
alt Attempt to acquire leader lease
SignerPod->>K8sAPI: GET Lease (name: configured-lease, ns: $(NAMESPACE))
K8sAPI-->>SignerPod: Lease not found or available
SignerPod->>K8sAPI: CREATE Lease (name: configured-lease, ns: $(NAMESPACE), holderIdentity: $(POD_NAME))
K8sAPI-->>SignerPod: Lease Created (Pod is Leader)
SignerPod->>SignerPod: Become Leader
loop Periodic Renewal
SignerPod->>K8sAPI: UPDATE Lease (Renew, holderIdentity: $(POD_NAME))
K8sAPI-->>SignerPod: Lease Renewed
end
else Lease held by another pod
SignerPod->>K8sAPI: GET/CREATE Lease
K8sAPI-->>SignerPod: Lease Conflict (Held by another)
SignerPod->>SignerPod: Remain Standby / Retry / Watch Lease
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @osmman - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Hey @osmman - I've reviewed your changes - here's some feedback:
- Verify that passing
--lock_namespace=$(NAMESPACE)and--lock_holder_identity=$(POD_NAME)in the Deployment args actually triggers env‐var expansion at runtime (Kubernetes won’t substitute env vars in args without a shell). - Add the new
coordination.k8s.io/leasesrules to the CSV’sspec.install.spec.permissions/clusterPermissionsso OLM installs the lease RBAC correctly. - The re-generated CSV icon blobs bloat this PR; consider reverting or moving the icon update into its own commit to keep the lease-election changes focused.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
5b79903 to
bc5bc53
Compare
bc5bc53 to
aac73a8
Compare
PoC uses latest build of upstream Trillian log signer
Summary by Sourcery
Enable Kubernetes lease-based leader election for the Trillian log signer and update related deployment and RBAC configuration.
New Features:
Enhancements: