Skip to content

Lease CRD for Akash provider #14

@evgheni7

Description

@evgheni7

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 identifier
  • owner: 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 timestamp
  • services: Running services information

Client Methods to Implement

  • CreateLease(ctx context.Context, owner, dseq, gseq, oseq, provider string): Create lease from bid
  • GetLease(ctx context.Context, leaseId string): Get lease details
  • CloseLease(ctx context.Context, leaseId string): Close/terminate lease
  • GetLeaseServices(ctx context.Context, leaseId string): Get services running under lease

Controller Methods to Implement

  • Observe(): Query lease status from Akash network
  • Create(): Resolve references, create lease using CreateLease client method
  • Update(): Handle lease renewals or modifications
  • Delete(): 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 request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions