Documentation ¶
Index ¶
- func GetLatestK3sVersions() ([]string, error)
- type GitHubRelease
- type Service
- func (s *Service) DownloadK3sKubeconfig() error
- func (s *Service) Exec(output ssh.OutputWriter, cmdStr string) error
- func (s *Service) InstallK3s(output ssh.OutputWriter, initCluster bool, tlsSan, k3sArgs, version string) (string, error)
- func (s *Service) JoinK3s(output ssh.OutputWriter, server string, master bool, token string) (string, error)
- func (s *Service) ListClusters() ([]db.K3sCluster, error)
- func (s *Service) ListNodesByCluster(clusterID string) ([]db.K3sNode, error)
- func (s *Service) SetKubeconfig() error
- func (s *Service) UninstallK3s(output ssh.OutputWriter, agent bool) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLatestK3sVersions ¶
GetLatestK3sVersions returns the latest K3s versions
Types ¶
type GitHubRelease ¶
GitHubRelease represents a GitHub release
type Service ¶
Service is the service for managing k3s cluster nodes using SSH.
func NewK3sService ¶
NewK3sService provides functionalities for managing k3s cluster nodes using SSH.
func (*Service) DownloadK3sKubeconfig ¶
DownloadK3sKubeconfig downloads the K3s kubeconfig file
func (*Service) Exec ¶
func (s *Service) Exec(output ssh.OutputWriter, cmdStr string) error
Exec executes a given SSH command on the remote machine. It takes an OutputWriter to handle the output of the SSH command, and a cmdStr which is the string representation of the command to be executed.
func (*Service) InstallK3s ¶
func (s *Service) InstallK3s(output ssh.OutputWriter, initCluster bool, tlsSan, k3sArgs, version string) (string, error)
InstallCluster installs a K3s cluster on the remote host
func (*Service) JoinK3s ¶
func (s *Service) JoinK3s(output ssh.OutputWriter, server string, master bool, token string) (string, error)
JoinK3s joins a node to a k3s cluster.
func (*Service) ListClusters ¶
func (s *Service) ListClusters() ([]db.K3sCluster, error)
ListClusters returns a list of all clusters in the database.
func (*Service) ListNodesByCluster ¶
ListNodesByCluster returns a list of all nodes in a cluster.
func (*Service) SetKubeconfig ¶
SetKubeconfig sets the KUBECONFIG environment variable
func (*Service) UninstallK3s ¶
UninstallK3s uninstalls K3s from host