kubefate

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultIngressControllerYAML

func GetDefaultIngressControllerYAML() string

GetDefaultIngressControllerYAML returns the default ingress controller deployment yaml

func GetDefaultYAML

func GetDefaultYAML() string

GetDefaultYAML returns the default kubefate deployment yaml

Types

type ChartListResponse

type ChartListResponse struct {
	Data []*modules.HelmChart
	Msg  string
}

type Client

type Client interface {
	// CheckVersion returns the version of the KubeFATE service
	CheckVersion() (string, error)
	// EnsureChartExist makes sure the specified chart is downloaded and managed by kubefate
	EnsureChartExist(name, version string, content []byte) error
	// ListClusterByNamespace returns clusters list in the specified namespace
	ListClusterByNamespace(namespace string) ([]*modules.Cluster, error)

	SubmitClusterInstallationJob(yamlStr string) (string, error)
	SubmitClusterUpdateJob(yamlStr string) (string, error)
	SubmitClusterDeletionJob(clusterUUID string) (string, error)
	GetJobInfo(jobUUID string) (*modules.Job, error)
	WaitJob(jobUUID string) (*modules.Job, error)
	WaitClusterUUID(jobUUID string) (string, error)
	StopJob(jobUUID string) error

	IngressAddress() string
	IngressRuleHost() string
}

Client can be used to access KubeFATE service

type ClientManager

type ClientManager interface {
	// K8sClient returns the embedded K8s client
	K8sClient() kubernetes.Client
	// BuildClient retrieve the KubeFATE access info from the underlying K8s cluster and return a client instance
	BuildClient() (Client, error)
	// BuildPFClient build a KubeFATE client based on internal port-forwarding routine, caller must call the returned closerFn when no longer needs it
	BuildPFClient() (client Client, closerFn func(), err error)
}

ClientManager provides methods to work with KubeFATE as a client

func NewClientManager

func NewClientManager(client kubernetes.Client, meta *InstallationMeta) ClientManager

NewClientManager returns the KubeFATE client manager

type ClusterArgs

type ClusterArgs struct {
	Name         string `json:"name"`
	Namespace    string `json:"namespace"`
	ChartName    string `json:"chart_name"`
	ChartVersion string `json:"chart_version"`
	Cover        bool   `json:"cover"`
	Data         []byte `json:"data"`
}

ClusterArgs is the args to manage a cluster

type ClusterInfoResponse

type ClusterInfoResponse struct {
	Data *modules.Cluster
	Msg  string
}

type ClusterJobResponse

type ClusterJobResponse struct {
	Data *modules.Job
	Msg  string
}

type ClusterListResponse

type ClusterListResponse struct {
	Data []*modules.Cluster
	Msg  string
}

type InstallationMeta

type InstallationMeta struct {
	// contains filtered or unexported fields
}

InstallationMeta describes the basic info of a KubeFATE installation

func BuildInstallationMetaFromYAML

func BuildInstallationMetaFromYAML(namespace, yamlStr, ingressControllerYAMLStr string) (*InstallationMeta, error)

BuildInstallationMetaFromYAML builds a meta description of a KubeFATE installation

type Manager

type Manager interface {
	ClientManager
	// Install installs a KubeFATE deployment
	Install(bool) error
	// Uninstall uninstalls a KubeFATE installation
	Uninstall() error
	// InstallIngressNginxController installs a default ingress nginx controller
	InstallIngressNginxController() error
	// GetKubeFATEDeployment returns the Deployment object of KubeFATE
	GetKubeFATEDeployment() (*appv1.Deployment, error)
}

Manager extends ClientManager and provides methods to work with KubeFATE installation

func NewManager

func NewManager(client kubernetes.Client, meta *InstallationMeta) Manager

NewManager returns the KubeFATE manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL