generated from crossplane/provider-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Implement a Crossplane CRD for managing Akash Leases to enable Kubernetes-native management of leases.
Requirements
CRD Structure
- API Group:
akash.overlock.network - Kind:
Lease - Version:
v1alpha1
Spec Fields (ForProvider)
deploymentRef: Reference to Deployment CR (name/namespace)activeBidRef: Reference to ActiveBid CR to accept (name/namespace)
Status Fields (AtProvider)
leaseId: Unique lease identifierowner: Lease owner address (resolved from deploymentRef)dseq: Deployment sequence number (resolved from deploymentRef)gseq: Group sequence number (resolved from activeBidRef)oseq: Order sequence number (resolved from activeBidRef)provider: Provider address (resolved from activeBidRef)state: Current lease state (active, closed)price: Lease price information (from accepted bid)createdAt: Lease creation timestampservices: Running services information
Client Methods to Implement
CreateLease(ctx context.Context, owner, dseq, gseq, oseq, provider string): Create lease from bidGetLease(ctx context.Context, leaseId string): Get lease detailsCloseLease(ctx context.Context, leaseId string): Close/terminate leaseGetLeaseServices(ctx context.Context, leaseId string): Get services running under lease
Controller Methods to Implement
Observe(): Query lease status from Akash networkCreate(): Resolve references, create lease using CreateLease client methodUpdate(): Handle lease renewals or modificationsDelete(): Close lease using CloseLease client method
Acceptance Criteria
- CRD types defined in
apis/akash/v1alpha1/lease_types.go - Implement reference resolution for Deployment and ActiveBid CRs
- Implement all client methods in
internal/client/lease.go - Controller implemented in
internal/controller/lease/ - Unit tests for client methods and controller logic
- Example manifest in
examples/lease.yaml - CRD manifest generated in
package/crds/
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request