Documentation
¶
Index ¶
- Constants
- Variables
- type Cluster
- func (c *Cluster) Create(ctx context.Context) error
- func (c *Cluster) ETCDRemoveSnapshot(ctx context.Context, snapshotName string) error
- func (c *Cluster) ETCDRestore(ctx context.Context, snapshotName string) error
- func (c *Cluster) ETCDSave(ctx context.Context, snapshotName string) error
- func (c *Cluster) GenerateServiceAccount(ctx context.Context) error
- func (c *Cluster) GetCapabilities(ctx context.Context) (*types.Capabilities, error)
- func (c *Cluster) GetClusterSize(ctx context.Context) (*types.NodeCount, error)
- func (c *Cluster) GetDriverCreateOptions(ctx context.Context) (*types.DriverFlags, error)
- func (c *Cluster) GetDriverUpdateOptions(ctx context.Context) (*types.DriverFlags, error)
- func (c *Cluster) GetK8SCapabilities(ctx context.Context) (*types.K8SCapabilities, error)
- func (c *Cluster) GetVersion(ctx context.Context) (*types.KubernetesVersion, error)
- func (c *Cluster) PostCheck(ctx context.Context) error
- func (c *Cluster) Remove(ctx context.Context, forceRemove bool) error
- func (c *Cluster) RemoveLegacyServiceAccount(ctx context.Context) error
- func (c *Cluster) SetClusterSize(ctx context.Context, count *types.NodeCount) error
- func (c *Cluster) SetVersion(ctx context.Context, version *types.KubernetesVersion) error
- func (c *Cluster) Store() error
- func (c *Cluster) Update(ctx context.Context) error
- type ConfigGetter
- type PersistentStore
Constants ¶
View Source
const ( PreCreating = "Pre-Creating" Creating = "Creating" PostCheck = "Post-Checking" Running = "Running" Error = "Error" Updating = "Updating" Init = "Init" )
Variables ¶
View Source
var ( // ErrClusterExists This error is checked in rancher, don't change the string ErrClusterExists = errors2.New("cluster already exists") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { // The cluster driver to provision cluster Driver types.CloseableDriver `json:"-"` // The name of the cluster driver DriverName string `json:"driverName,omitempty" yaml:"driver_name,omitempty"` // The name of the cluster Name string `json:"name,omitempty" yaml:"name,omitempty"` // The status of the cluster Status string `json:"status,omitempty" yaml:"status,omitempty"` // specific info about kubernetes cluster // Kubernetes cluster version Version string `json:"version,omitempty" yaml:"version,omitempty"` // Service account token to access kubernetes API ServiceAccountToken string `json:"serviceAccountToken,omitempty" yaml:"service_account_token,omitempty"` // Kubernetes API master endpoint Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` // Username for http basic authentication Username string `json:"username,omitempty" yaml:"username,omitempty"` // Password for http basic authentication Password string `json:"password,omitempty" yaml:"password,omitempty"` // Root CaCertificate for API server(base64 encoded) RootCACert string `json:"rootCACert,omitempty" yaml:"root_ca_cert,omitempty"` // Client Certificate(base64 encoded) ClientCertificate string `json:"clientCertificate,omitempty" yaml:"client_certificate,omitempty"` // Client private key(base64 encoded) ClientKey string `json:"clientKey,omitempty" yaml:"client_key,omitempty"` // Node count in the cluster NodeCount int64 `json:"nodeCount,omitempty" yaml:"node_count,omitempty"` // Metadata store specific driver options per cloud provider Metadata map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"` PersistStore PersistentStore `json:"-" yaml:"-"` ConfigGetter ConfigGetter `json:"-" yaml:"-"` Logger logstream.Logger `json:"-" yaml:"-"` }
Cluster represents a kubernetes cluster
func FromCluster ¶
func FromCluster(cluster *Cluster, addr string, configGetter ConfigGetter, persistStore PersistentStore) (*Cluster, error)
func NewCluster ¶
func NewCluster(driverName, name, addr string, configGetter ConfigGetter, persistStore PersistentStore) (*Cluster, error)
NewCluster create a cluster interface to do operations
func (*Cluster) ETCDRemoveSnapshot ¶
func (*Cluster) ETCDRestore ¶
func (*Cluster) GenerateServiceAccount ¶
func (*Cluster) GetCapabilities ¶
func (*Cluster) GetClusterSize ¶
func (*Cluster) GetDriverCreateOptions ¶
func (*Cluster) GetDriverUpdateOptions ¶
func (*Cluster) GetK8SCapabilities ¶
func (*Cluster) GetVersion ¶
func (*Cluster) RemoveLegacyServiceAccount ¶
func (*Cluster) SetClusterSize ¶
func (*Cluster) SetVersion ¶
type ConfigGetter ¶
type ConfigGetter interface {
GetConfig() (types.DriverOptions, error)
}
ConfigGetter defines the interface for getting the driver options.
type PersistentStore ¶
type PersistentStore interface { GetStatus(name string) (string, error) Get(name string) (Cluster, error) Remove(name string) error Store(cluster Cluster) error PersistStatus(cluster Cluster, status string) error }
PersistentStore defines the interface for persist options like check and store
Click to show internal directories.
Click to hide internal directories.