cluster

package
v0.0.0-...-0d95af9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BootstrapScriptMasterKey     = "BOOTSTRAP_SCRIPT_MASTER"
	BootstrapScriptNodeKey       = "BOOTSTRAP_SCRIPT_NODE"
	BootstrapScriptMasterDefault = "" /* 135-byte string literal not displayed */
	BootstrapScriptNodeDefault   = "" /* 133-byte string literal not displayed */
)

const's of BootstrapScript values

Variables

This section is empty.

Functions

func DownloadK8sConfig

func DownloadK8sConfig(kubicornCluster *kcluster.Cluster) (*[]byte, error)

DownloadK8sConfig downloads the Kubernetes config from the cluster Todo check first if config is locally available

func GenerateConfig

func GenerateConfig(prometheusCfg []PrometheusCfg) []byte

GenerateConfig generates prometheus config

func GetConfigPostHook

func GetConfigPostHook(cluster CommonCluster)

GetConfigPostHook functions with func(*cluster.Cluster) signature

func GetKubicornProfile

func GetKubicornProfile(cs *model.ClusterModel) *kcluster.Cluster

GetKubicornProfile creates *cluster.Cluster from ClusterModel struct

func InstallHelmPostHook

func InstallHelmPostHook(cluster CommonCluster)

InstallHelmPostHook this posthook installs the helm related things

func InstallIngressControllerPostHook

func InstallIngressControllerPostHook(cluster CommonCluster)

InstallIngressControllerPostHook post hooks can't return value, they can log error and/or update state?

func PersistKubernetesKeys

func PersistKubernetesKeys(cluster CommonCluster)

PersistKubernetesKeys is a basic version of persisting keys TODO check if we need this from API or anywhere else

func ReadCluster

func ReadCluster(modelCluster *model.ClusterModel) (*kcluster.Cluster, error)

ReadCluster reads a persisted cluster from the statestore

func RunPostHooks

func RunPostHooks(functionList []func(cluster CommonCluster), createdCluster CommonCluster)

RunPostHooks calls posthook functions with created cluster

func UpdatePrometheus

func UpdatePrometheus()

UpdatePrometheus updates a configmap used by Prometheus

func UpdatePrometheusConfig

func UpdatePrometheusConfig() error

UpdatePrometheusConfig updates the Prometheus configuration

func UpdatePrometheusPostHook

func UpdatePrometheusPostHook(_ CommonCluster)

UpdatePrometheusPostHook updates a configmap used by Prometheus

Types

type AKSCluster

type AKSCluster struct {
	APIEndpoint string
	// contains filtered or unexported fields
}

AKSCluster struct for AKS cluster

func CreateAKSClusterFromModel

func CreateAKSClusterFromModel(clusterModel *model.ClusterModel) (*AKSCluster, error)

CreateAKSClusterFromModel creates ClusterModel struct from model

func CreateAKSClusterFromRequest

func CreateAKSClusterFromRequest(request *components.CreateClusterRequest) (*AKSCluster, error)

CreateAKSClusterFromRequest creates ClusterModel struct from the request

func (*AKSCluster) AddDefaultsToUpdate

func (c *AKSCluster) AddDefaultsToUpdate(r *components.UpdateClusterRequest)

AddDefaultsToUpdate adds defaults to update request

func (*AKSCluster) CheckEqualityToUpdate

func (c *AKSCluster) CheckEqualityToUpdate(r *components.UpdateClusterRequest) error

CheckEqualityToUpdate validates the update request

func (*AKSCluster) CreateCluster

func (c *AKSCluster) CreateCluster() error

CreateCluster creates a new cluster

func (*AKSCluster) DeleteCluster

func (c *AKSCluster) DeleteCluster() error

DeleteCluster deletes cluster from aks

func (*AKSCluster) DeleteFromDatabase

func (c *AKSCluster) DeleteFromDatabase() error

DeleteFromDatabase deletes model from the database

func (*AKSCluster) GetAPIEndpoint

func (c *AKSCluster) GetAPIEndpoint() (string, error)

GetAPIEndpoint returns the Kubernetes Api endpoint

func (*AKSCluster) GetID

func (c *AKSCluster) GetID() uint

GetID returns the specified cluster id

func (*AKSCluster) GetK8sConfig

func (c *AKSCluster) GetK8sConfig() (*[]byte, error)

GetK8sConfig returns the Kubernetes config

func (*AKSCluster) GetModel

func (c *AKSCluster) GetModel() *model.ClusterModel

GetModel returns the whole clusterModel

func (*AKSCluster) GetName

func (c *AKSCluster) GetName() string

GetName returns the name of the cluster

func (*AKSCluster) GetStatus

func (c *AKSCluster) GetStatus() (*bTypes.GetClusterStatusResponse, error)

GetStatus gets cluster status

func (*AKSCluster) GetType

func (c *AKSCluster) GetType() string

GetType returns the cloud type of the cluster

func (*AKSCluster) Persist

func (c *AKSCluster) Persist() error

Persist save the cluster model

func (*AKSCluster) UpdateCluster

func (c *AKSCluster) UpdateCluster(request *bTypes.UpdateClusterRequest) error

UpdateCluster updates AKS cluster in cloud

type AWSCluster

type AWSCluster struct {
	APIEndpoint string
	// contains filtered or unexported fields
}

AWSCluster struct for AWS cluster

func CreateAWSClusterFromModel

func CreateAWSClusterFromModel(clusterModel *model.ClusterModel) (*AWSCluster, error)

CreateAWSClusterFromModel creates ClusterModel struct from the kubicorn model

func CreateAWSClusterFromRequest

func CreateAWSClusterFromRequest(request *components.CreateClusterRequest) (*AWSCluster, error)

CreateAWSClusterFromRequest creates ClusterModel struct from the request

func (*AWSCluster) AddDefaultsToUpdate

func (c *AWSCluster) AddDefaultsToUpdate(r *components.UpdateClusterRequest)

AddDefaultsToUpdate adds defaults to update request

func (*AWSCluster) CheckEqualityToUpdate

func (c *AWSCluster) CheckEqualityToUpdate(r *components.UpdateClusterRequest) error

CheckEqualityToUpdate validates the update request

func (*AWSCluster) CreateCluster

func (c *AWSCluster) CreateCluster() error

CreateCluster creates a new cluster

func (*AWSCluster) DeleteCluster

func (c *AWSCluster) DeleteCluster() error

DeleteCluster deletes cluster from amazon

func (*AWSCluster) DeleteFromDatabase

func (c *AWSCluster) DeleteFromDatabase() error

DeleteFromDatabase deletes model from the database

func (*AWSCluster) GetAPIEndpoint

func (c *AWSCluster) GetAPIEndpoint() (string, error)

GetAPIEndpoint returns the Kubernetes Api endpoint

func (*AWSCluster) GetID

func (c *AWSCluster) GetID() uint

GetID returns the specified cluster id

func (*AWSCluster) GetK8sConfig

func (c *AWSCluster) GetK8sConfig() (*[]byte, error)

GetK8sConfig returns the Kubernetes config

func (*AWSCluster) GetKubicornCluster

func (c *AWSCluster) GetKubicornCluster() (*kcluster.Cluster, error)

GetKubicornCluster returns a Kubicorn cluster

func (*AWSCluster) GetModel

func (c *AWSCluster) GetModel() *model.ClusterModel

GetModel returns the whole clusterModel

func (*AWSCluster) GetName

func (c *AWSCluster) GetName() string

GetName returns the name of the cluster

func (*AWSCluster) GetStatus

GetStatus gets cluster status

func (*AWSCluster) GetType

func (c *AWSCluster) GetType() string

GetType returns the cloud type of the cluster

func (*AWSCluster) Persist

func (c *AWSCluster) Persist() error

Persist save the cluster model

func (*AWSCluster) UpdateCluster

func (c *AWSCluster) UpdateCluster(request *components.UpdateClusterRequest) error

UpdateCluster updates Amazon cluster in cloud

type CommonCluster

type CommonCluster interface {
	CreateCluster() error
	Persist() error
	GetK8sConfig() (*[]byte, error)
	GetName() string
	GetType() string
	GetStatus() (*bTypes.GetClusterStatusResponse, error)
	DeleteCluster() error
	UpdateCluster(*bTypes.UpdateClusterRequest) error
	GetID() uint
	GetModel() *model.ClusterModel
	CheckEqualityToUpdate(*bTypes.UpdateClusterRequest) error
	AddDefaultsToUpdate(*bTypes.UpdateClusterRequest)
	GetAPIEndpoint() (string, error)
	DeleteFromDatabase() error
}

CommonCluster interface for clusters

func CreateCommonClusterFromRequest

func CreateCommonClusterFromRequest(createClusterRequest *bTypes.CreateClusterRequest) (CommonCluster, error)

CreateCommonClusterFromRequest creates a CommonCluster from a request

func GetCommonClusterFromModel

func GetCommonClusterFromModel(modelCluster *model.ClusterModel) (CommonCluster, error)

GetCommonClusterFromModel extracts CommonCluster from a ClusterModel

type GKECluster

type GKECluster struct {
	APIEndpoint string
	// contains filtered or unexported fields
}

GKECluster struct for GKE cluster

func CreateGKEClusterFromModel

func CreateGKEClusterFromModel(clusterModel *model.ClusterModel) (*GKECluster, error)

CreateGKEClusterFromModel creates ClusterModel struct from model

func CreateGKEClusterFromRequest

func CreateGKEClusterFromRequest(request *components.CreateClusterRequest) (*GKECluster, error)

CreateGKEClusterFromRequest creates ClusterModel struct from the request

func (*GKECluster) AddDefaultsToUpdate

func (g *GKECluster) AddDefaultsToUpdate(r *components.UpdateClusterRequest)

AddDefaultsToUpdate adds defaults to update request

func (*GKECluster) CheckEqualityToUpdate

func (g *GKECluster) CheckEqualityToUpdate(r *components.UpdateClusterRequest) error

CheckEqualityToUpdate validates the update request

func (*GKECluster) CreateCluster

func (g *GKECluster) CreateCluster() error

CreateCluster creates a new cluster

func (*GKECluster) DeleteCluster

func (g *GKECluster) DeleteCluster() error

DeleteCluster deletes cluster from google

func (*GKECluster) DeleteFromDatabase

func (g *GKECluster) DeleteFromDatabase() error

DeleteFromDatabase deletes model from the database

func (*GKECluster) GetAPIEndpoint

func (g *GKECluster) GetAPIEndpoint() (string, error)

GetAPIEndpoint returns the Kubernetes Api endpoint

func (*GKECluster) GetID

func (g *GKECluster) GetID() uint

GetID returns the specified cluster id

func (*GKECluster) GetK8sConfig

func (g *GKECluster) GetK8sConfig() (*[]byte, error)

GetK8sConfig returns the Kubernetes config

func (*GKECluster) GetModel

func (g *GKECluster) GetModel() *model.ClusterModel

GetModel returns the whole clusterModel

func (*GKECluster) GetName

func (g *GKECluster) GetName() string

GetName returns the name of the cluster

func (*GKECluster) GetStatus

GetStatus gets cluster status

func (*GKECluster) GetType

func (g *GKECluster) GetType() string

GetType returns the cloud type of the cluster

func (*GKECluster) Persist

func (g *GKECluster) Persist() error

Persist save the cluster model

func (*GKECluster) UpdateCluster

func (g *GKECluster) UpdateCluster(updateRequest *components.UpdateClusterRequest) error

UpdateCluster updates GKE cluster in cloud

type PrometheusCfg

type PrometheusCfg struct {
	Endpoint string
	Name     string
}

PrometheusCfg describes Prometheus config

Jump to

Keyboard shortcuts

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