Documentation
¶
Index ¶
- Variables
- func ListClusters(workdir string) ([]string, error)
- type BuildRuntime
- type Cluster
- func (c *Cluster) AuditLogs(ctx context.Context, out io.Writer) error
- func (c *Cluster) AuditLogsFollow(ctx context.Context, out io.Writer) error
- func (c *Cluster) Config() (Config, error)
- func (c *Cluster) InHostKubeconfig() (string, error)
- func (c *Cluster) Init(ctx context.Context, conf Config) error
- func (c *Cluster) Install(ctx context.Context) error
- func (c *Cluster) Kubectl(ctx context.Context, stm utils.IOStreams, args ...string) error
- func (c *Cluster) KubectlInCluster(ctx context.Context, stm utils.IOStreams, args ...string) error
- func (c *Cluster) Load() (conf Config, err error)
- func (c *Cluster) Logger() logger.Logger
- func (c *Cluster) Ready(ctx context.Context) (bool, error)
- func (c *Cluster) Uninstall(ctx context.Context) error
- func (c *Cluster) Update(ctx context.Context, conf Config) error
- func (c *Cluster) WaitReady(ctx context.Context, timeout time.Duration) error
- type Config
- type Registry
- type Runtime
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RawClusterConfigName = "kwok.yaml" InHostKubeconfigName = "kubeconfig.yaml" InClusterKubeconfigName = "kubeconfig" EtcdDataDirName = "etcd" PkiName = "pki" ComposeName = "docker-compose.yaml" Prometheus = "prometheus.yaml" KindName = "kind.yaml" KwokDeploy = "kwok-controller-deployment.yaml" PrometheusDeploy = "prometheus-deployment.yaml" AuditPolicyName = "audit.yaml" AuditLogName = "audit.log" )
View Source
var DefaultRegistry = NewRegistry()
Functions ¶
func ListClusters ¶
ListClusters returns the list of clusters in the directory
Types ¶
type BuildRuntime ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func (*Cluster) AuditLogsFollow ¶
func (*Cluster) InHostKubeconfig ¶
func (*Cluster) KubectlInCluster ¶
type Config ¶
type Config struct { Name string `json:"name,omitempty"` Workdir string `json:"workdir,omitempty"` Runtime string `json:"runtime,omitempty"` EtcdPort uint32 `json:"etcd_port,omitempty"` EtcdPeerPort uint32 `json:"etcd_peer_port,omitempty"` KubeApiserverPort uint32 `json:"kube_apiserver_port,omitempty"` KubeControllerManagerPort uint32 `json:"kube_controller_manager_port,omitempty"` KubeSchedulerPort uint32 `json:"kube_scheduler_port,omitempty"` KwokControllerPort uint32 `json:"kwok_controller_port,omitempty"` PrometheusPort uint32 `json:"prometheus_port,omitempty"` // For docker-compose EtcdImage string `json:"etcd_image,omitempty"` KubeApiserverImage string `json:"kube_apiserver_image,omitempty"` KubeControllerManagerImage string `json:"kube_controller_manager_image,omitempty"` KubeSchedulerImage string `json:"kube_scheduler_image,omitempty"` KwokControllerImage string `json:"kwok_controller_image,omitempty"` PrometheusImage string `json:"prometheus_image,omitempty"` // For kind KindNodeImage string `json:"kind_node_image,omitempty"` // For binary KubeApiserverBinary string `json:"kube_apiserver_binary,omitempty"` KubeControllerManagerBinary string `json:"kube_controller_manager_binary,omitempty"` KubeSchedulerBinary string `json:"kube_scheduler_binary,omitempty"` KwokControllerBinary string `json:"kwok_controller_binary,omitempty"` EtcdBinary string `json:"etcd_binary,omitempty"` EtcdBinaryTar string `json:"etcd_binary_tar,omitempty"` PrometheusBinary string `json:"prometheus_binary,omitempty"` PrometheusBinaryTar string `json:"prometheus_binary_tar,omitempty"` // Cache directory CacheDir string `json:"cache_dir,omitempty"` // For docker-compose and binary SecretPort bool `json:"secret_port,omitempty"` // Pull image QuietPull bool `json:"quiet_pull,omitempty"` // Feature gates of Kubernetes FeatureGates string `json:"kube_feature_gates,omitempty"` // For audit log AuditPolicy string `json:"audit_policy,omitempty"` // Runtime config of Kubernetes RuntimeConfig string `json:"kube_runtime_config,omitempty"` }
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Register ¶
func (r *Registry) Register(name string, buildRuntime BuildRuntime)
Register a runtime
type Runtime ¶
type Runtime interface { // Init the config of cluster Init(ctx context.Context, conf Config) error // Config return the config of cluster Config() (Config, error) // Install the cluster Install(ctx context.Context) error // Uninstall the cluster Uninstall(ctx context.Context) error // Up start the cluster Up(ctx context.Context) error // Down stop the cluster Down(ctx context.Context) error // Start start a container Start(ctx context.Context, name string) error // Stop stop a container Stop(ctx context.Context, name string) error // Ready check the cluster is ready Ready(ctx context.Context) (bool, error) // WaitReady wait the cluster is ready WaitReady(ctx context.Context, timeout time.Duration) error // InHostKubeconfig return the kubeconfig in host InHostKubeconfig() (string, error) // Kubectl command Kubectl(ctx context.Context, stm utils.IOStreams, args ...string) error // KubectlInCluster command in cluster KubectlInCluster(ctx context.Context, stm utils.IOStreams, args ...string) error // Logs logs of a component Logs(ctx context.Context, name string, out io.Writer) error // LogsFollow follow logs of a component with follow LogsFollow(ctx context.Context, name string, out io.Writer) error // AuditLogs audit logs of apiserver AuditLogs(ctx context.Context, out io.Writer) error // AuditLogsFollow follow audit logs of apiserver AuditLogsFollow(ctx context.Context, out io.Writer) error // ListBinaries list binaries in the cluster ListBinaries(ctx context.Context, actual bool) ([]string, error) // ListImages list images in the cluster ListImages(ctx context.Context, actual bool) ([]string, error) // SnapshotSave save the snapshot of cluster SnapshotSave(ctx context.Context, path string) error // SnapshotRestore restore the snapshot of cluster SnapshotRestore(ctx context.Context, path string) error }
Click to show internal directories.
Click to hide internal directories.