Closed nxtcoder36 closed 1 week ago
This pull request implements significant changes to the Kloudlite CLI and related components, focusing on improving cluster management, VPN configuration, and overall system architecture. The changes include updates to the API client, file client, and various command implementations.
sequenceDiagram
participant User
participant apiClient
participant fileclient
User->>apiClient: Call InterceptApp
apiClient->>fileclient: GetVpnTeamConfig
fileclient-->>apiClient: Return VpnTeamConfig
apiClient->>fileclient: GetClusterConfig
fileclient-->>apiClient: Return ClusterConfig
apiClient-->>User: Return result
graph TD;
subgraph Kloudlite CLI
A[API Client]
B[File Client]
C[Cluster Command]
end
subgraph Cluster Management
D[Cluster Config]
E[VPN Config]
end
A --> D
B --> E
C --> D
C --> E
D --> E
style D fill:#f9f,stroke:#333,stroke-width:4px;
style E fill:#bbf,stroke:#333,stroke-width:4px;
classDiagram
class apiClient {
+InterceptApp(app: App, status: bool, ports: []AppPort, envName: string, options: ...fn.Option) error
+CreateDevice(devName: string, displayName: string, team: string) (*Device, error)
+GetClusterConfig(team: string) (*fileclient.TeamClusterConfig, error)
}
class fileclient {
+CurrentTeamName() (string, error)
+GetWGConfig() (*WGConfig, error)
}
class TeamClusterConfig {
+GatewayIP: string
+ClusterCIDR: string
}
class TeamVpnConfig {
+IpAddress: string
}
apiClient --> fileclient
fileclient --> TeamClusterConfig
fileclient --> TeamVpnConfig
Change | Details | Files |
---|---|---|
Refactored cluster management from k3s to a more generic 'cluster' approach |
|
cmd/cluster/up.go cmd/cluster/down.go cmd/cluster/cluster.go clis/kl/loadsubs.go cmd/use/account.go |
Enhanced VPN configuration and management |
|
domain/apiclient/device.go domain/fileclient/device.go klbox-docker/start.sh cmd/box/boxpkg/start.go |
Improved API client and file client implementations |
|
domain/apiclient/app.go domain/apiclient/k3s-local.go domain/fileclient/account.go domain/fileclient/context.go domain/fileclient/k3s-local.go |
Updated CLI commands and their implementations |
|
cmd/use/env.go cmd/use/account.go cmd/intercept/intercept.go cmd/intercept/stop.go cmd/clone/env.go clis/kl/loadsubs.go |
Improved error handling and logging |
|
cmd/box/boxpkg/utils.go cmd/box/boxpkg/info.go domain/fileclient/account.go |
Summary by Sourcery
Refactor the codebase to replace k3s-specific logic with a more generic cluster management approach. Introduce a new cluster command for managing clusters, and update the interception and VPN configuration logic to support device-specific and cluster-specific settings. Remove deprecated k3s-related code and update Docker build processes to include version tagging.
New Features:
Enhancements:
Chores: