Documentation ¶
Index ¶
- Constants
- Variables
- func CreateClusterWorkflow(ctx workflow.Context, input CreateClusterWorkflowInput) error
- func CreateOrUpdateResourceGroup(orgID uint, secretID string, resourceGroupName, location string) error
- func EKSCreateClusterWorkflow(ctx workflow.Context, input EKSCreateClusterWorkflowInput) error
- func EKSDeleteClusterWorkflow(ctx workflow.Context, input EKSDeleteClusterWorkflowInput) error
- func GetDesiredLabelsForCluster(ctx context.Context, cluster CommonCluster, nodePoolLabels []NodePoolLabels) (map[string]map[string]string, error)
- func GetEKSNodePools(cluster CommonCluster) ([]*eksmodel.AmazonNodePoolsModel, error)
- func GetKubernetesVersion(orgID uint, secretID string, location string) ([]string, error)
- func GetLocations(orgID uint, secretID string) (locations []string, err error)
- func GetMachineTypes(orgID uint, secretID string, location string) (pkgCluster.MachineTypes, error)
- func InstallSecret(cc interface{ ... }, secretName string, req InstallSecretRequest) (string, error)
- func InstallSecretByK8SConfig(kubeConfig []byte, orgID uint, secretName string, req InstallSecretRequest) (string, error)
- func InstallSecrets(ctx context.Context, cc CommonCluster, query *secret.ListSecretsQuery, ...) ([]string, error)
- func InstallSecretsByK8SConfig(ctx context.Context, kubeConfig []byte, orgID uint, ...) ([]string, error)
- func ListResourceGroups(orgID uint, secretID string) (res []string, err error)
- func MergeSecret(ctx context.Context, cc CommonCluster, secretName string, ...) (string, error)
- func MergeSecretByK8SConfig(ctx context.Context, kubeConfig []byte, orgID uint, secretName string, ...) (string, error)
- func NewClusterCheckMiddleware(manager *Manager, errorHandler emperror.Handler) gin.HandlerFunc
- func NewClusterCreator(request *pkgCluster.CreateClusterRequest, cluster CommonCluster, ...) clusterCreator
- func NewClusterEvents(eb eventBus) *clusterEventBus
- func NewCommonClusterCreator(request *pkgCluster.CreateClusterRequest, cluster CommonCluster) *commonCreator
- func NewCommonClusterUpdater(request *cluster.UpdateClusterRequest, clientFactory DynamicClientFactory, ...) *commonUpdater
- func NewCommonNodepoolUpdater(request *cluster.UpdateNodePoolsRequest, cluster CommonCluster, userID uint) *commonNodepoolUpdater
- func NewCreatorBaseFields(createdAt time.Time, createdBy uint) *pkgCommon.CreatorBaseFields
- func NewExporter() *pipelineMetrics
- func NewLogurLogger(fl logrus.FieldLogger) logur.Logger
- func NewNopClusterEvents() *nopClusterEvents
- func RunPostHooksWorkflow(ctx workflow.Context, input RunPostHooksWorkflowInput) error
- func StoreKubernetesConfig(cluster CommonCluster, config []byte) error
- type AKSCluster
- func (c *AKSCluster) AddDefaultsToUpdate(r *pkgCluster.UpdateClusterRequest)
- func (c *AKSCluster) CheckEqualityToUpdate(r *pkgCluster.UpdateClusterRequest) error
- func (c *AKSCluster) CreateCluster() error
- func (c *AKSCluster) DeleteCluster() error
- func (c *AKSCluster) DeleteFromDatabase() error
- func (c *AKSCluster) DownloadK8sConfig() ([]byte, error)
- func (c *AKSCluster) GetAKSNodePools() []*azureadapter.AKSNodePoolModel
- func (c *AKSCluster) GetAPIEndpoint() (string, error)
- func (c *AKSCluster) GetCloud() string
- func (c *AKSCluster) GetConfigSecretId() string
- func (c *AKSCluster) GetDistribution() string
- func (c *AKSCluster) GetID() uint
- func (c *AKSCluster) GetK8sConfig() ([]byte, error)
- func (c *AKSCluster) GetK8sUserConfig() ([]byte, error)
- func (c *AKSCluster) GetKubernetesVersion() (string, error)
- func (c *AKSCluster) GetLocation() string
- func (c *AKSCluster) GetModel() *model.ClusterModel
- func (c *AKSCluster) GetName() string
- func (c *AKSCluster) GetOrganizationId() uint
- func (c *AKSCluster) GetResourceGroupName() string
- func (c *AKSCluster) GetSecretId() string
- func (c *AKSCluster) GetSecretWithValidation() (*secret.SecretItemResponse, error)
- func (c *AKSCluster) GetSshSecretId() string
- func (c *AKSCluster) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
- func (c *AKSCluster) GetUID() string
- func (c *AKSCluster) IsReady() (bool, error)
- func (c *AKSCluster) NodePoolExists(nodePoolName string) bool
- func (c *AKSCluster) Persist() error
- func (c *AKSCluster) RbacEnabled() bool
- func (c *AKSCluster) RequiresSshPublicKey() bool
- func (c *AKSCluster) SaveConfigSecretId(configSecretID string) error
- func (c *AKSCluster) SaveSshSecretId(sshSecretID string) error
- func (c *AKSCluster) SetStatus(status, statusMessage string) error
- func (c *AKSCluster) UpdateCluster(request *pkgCluster.UpdateClusterRequest, userID uint) error
- func (c *AKSCluster) UpdateNodePools(request *pkgCluster.UpdateNodePoolsRequest, userID uint) error
- func (c *AKSCluster) ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error
- type ClientFactory
- type CommonCluster
- type CommonClusterBase
- type CreateClusterWorkflowInput
- type CreationContext
- type DownloadK8sConfigActivity
- type DownloadK8sConfigActivityInput
- type DynamicClientFactory
- type EC2ClusterPKE
- func (c *EC2ClusterPKE) AddDefaultsToUpdate(*pkgCluster.UpdateClusterRequest)
- func (c *EC2ClusterPKE) CheckEqualityToUpdate(*pkgCluster.UpdateClusterRequest) error
- func (c *EC2ClusterPKE) CreateCluster() error
- func (c *EC2ClusterPKE) CreatePKECluster(tokenGenerator TokenGenerator, externalBaseURL string) error
- func (c *EC2ClusterPKE) DeleteCluster() error
- func (c *EC2ClusterPKE) DeleteFromDatabase() error
- func (c *EC2ClusterPKE) DeletePKECluster(ctx context.Context, workflowClient client.Client) error
- func (c *EC2ClusterPKE) GetAPIEndpoint() (string, error)
- func (c *EC2ClusterPKE) GetAWSClient() (*session.Session, error)
- func (c *EC2ClusterPKE) GetBootstrapCommand(nodePoolName string, url string, urlInsecure bool, token string, ...) (string, error)
- func (c *EC2ClusterPKE) GetCAHash() (string, error)
- func (c *EC2ClusterPKE) GetCloud() string
- func (c *EC2ClusterPKE) GetConfigSecretId() string
- func (c *EC2ClusterPKE) GetCurrentWorkflowID() string
- func (c *EC2ClusterPKE) GetDistribution() string
- func (c *EC2ClusterPKE) GetID() uint
- func (c *EC2ClusterPKE) GetK8sConfig() ([]byte, error)
- func (c *EC2ClusterPKE) GetK8sUserConfig() ([]byte, error)
- func (c *EC2ClusterPKE) GetKubernetesContainerRuntime() (string, error)
- func (c *EC2ClusterPKE) GetKubernetesNetworkProvider() (string, error)
- func (c *EC2ClusterPKE) GetKubernetesVersion() (string, error)
- func (c *EC2ClusterPKE) GetLocation() string
- func (c *EC2ClusterPKE) GetName() string
- func (c *EC2ClusterPKE) GetNetworkApiServerAddress() (host, port string, err error)
- func (c *EC2ClusterPKE) GetNetworkCloudProvider() (cloudProvider, vpcID string, subnets []string, err error)
- func (c *EC2ClusterPKE) GetNodePools() []PKENodePool
- func (c *EC2ClusterPKE) GetOrganizationId() uint
- func (c *EC2ClusterPKE) GetPipelineToken(tokenGenerator interface{}) (string, error)
- func (c *EC2ClusterPKE) GetSecretId() string
- func (c *EC2ClusterPKE) GetSecretWithValidation() (*secret.SecretItemResponse, error)
- func (c *EC2ClusterPKE) GetSshPublicKey() (string, error)
- func (c *EC2ClusterPKE) GetSshSecretId() string
- func (c *EC2ClusterPKE) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
- func (c *EC2ClusterPKE) GetUID() string
- func (c *EC2ClusterPKE) HasK8sConfig() (bool, error)
- func (c *EC2ClusterPKE) IsMasterReady() (bool, error)
- func (c *EC2ClusterPKE) IsReady() (bool, error)
- func (c *EC2ClusterPKE) ListNodePools() ([]string, error)
- func (c *EC2ClusterPKE) NodePoolExists(nodePoolName string) bool
- func (c *EC2ClusterPKE) Persist() error
- func (c *EC2ClusterPKE) RbacEnabled() bool
- func (c *EC2ClusterPKE) RegisterNode(name, nodePoolName, ip string, master, worker bool) error
- func (c *EC2ClusterPKE) RequiresSshPublicKey() bool
- func (c *EC2ClusterPKE) SaveConfigSecretId(configSecretId string) error
- func (c *EC2ClusterPKE) SaveNetworkApiServerAddress(host, port string) error
- func (c *EC2ClusterPKE) SaveNetworkCloudProvider(cloudProvider, vpcID string, subnets []string) error
- func (c *EC2ClusterPKE) SaveSshSecretId(sshSecretId string) error
- func (c *EC2ClusterPKE) SetCurrentWorkflowID(workflowID string) error
- func (c *EC2ClusterPKE) SetStatus(status, statusMessage string) error
- func (c *EC2ClusterPKE) UpdateCluster(*pkgCluster.UpdateClusterRequest, uint) error
- func (c *EC2ClusterPKE) UpdateNodePools(*pkgCluster.UpdateNodePoolsRequest, uint) error
- func (c *EC2ClusterPKE) UpdatePKECluster(ctx context.Context, request *pkgCluster.UpdateClusterRequest, userID uint, ...) error
- func (c *EC2ClusterPKE) ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error
- type EKSCluster
- func (c *EKSCluster) AddDefaultsToUpdate(r *pkgCluster.UpdateClusterRequest)
- func (c *EKSCluster) CheckEqualityToUpdate(r *pkgCluster.UpdateClusterRequest) error
- func (c *EKSCluster) CreateCluster() error
- func (c *EKSCluster) DeleteCluster() error
- func (c *EKSCluster) DeleteFromDatabase() error
- func (c *EKSCluster) GetAPIEndpoint() (string, error)
- func (c *EKSCluster) GetCloud() string
- func (c *EKSCluster) GetConfigSecretId() string
- func (c *EKSCluster) GetDistribution() string
- func (c *EKSCluster) GetID() uint
- func (c *EKSCluster) GetK8sConfig() ([]byte, error)
- func (c *EKSCluster) GetK8sUserConfig() ([]byte, error)
- func (c *EKSCluster) GetKubernetesVersion() (string, error)
- func (c *EKSCluster) GetLocation() string
- func (c *EKSCluster) GetModel() *eksmodel.EKSClusterModel
- func (c *EKSCluster) GetName() string
- func (c *EKSCluster) GetOrganizationId() uint
- func (c *EKSCluster) GetSecretId() string
- func (c *EKSCluster) GetSecretWithValidation() (*secret.SecretItemResponse, error)
- func (c *EKSCluster) GetSshSecretId() string
- func (c *EKSCluster) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
- func (c *EKSCluster) GetSubnetMapping() map[string][]*pkgEks.Subnet
- func (c *EKSCluster) GetUID() string
- func (c *EKSCluster) IsReady() (bool, error)
- func (c *EKSCluster) IsSSHGenerated() bool
- func (c *EKSCluster) NodePoolExists(nodePoolName string) bool
- func (c *EKSCluster) Persist() error
- func (c *EKSCluster) PersistSSHGenerate(sshGenerated bool) error
- func (c *EKSCluster) RbacEnabled() bool
- func (c *EKSCluster) RequiresSshPublicKey() bool
- func (c *EKSCluster) SaveConfigSecretId(configSecretId string) error
- func (c *EKSCluster) SaveSshSecretId(sshSecretId string) error
- func (c *EKSCluster) SetCurrentWorkflowID(workflowID string) error
- func (c *EKSCluster) SetStatus(status string, statusMessage string) error
- func (c *EKSCluster) UpdateCluster(*pkgCluster.UpdateClusterRequest, uint) errordeprecated
- func (c *EKSCluster) UpdateNodePools(request *pkgCluster.UpdateNodePoolsRequest, userId uint) error
- func (c *EKSCluster) ValidateCreationFields(*pkgCluster.CreateClusterRequest) error
- type EKSClusterRepository
- type EKSCreateClusterWorkflowInput
- type EKSDeleteClusterWorkflowInput
- type EKSUpdateClusterWorkflow
- type EKSUpdateClusterstructureWorkflowInput
- type ErrorHandler
- type GKECluster
- func (c *GKECluster) AddDefaultsToUpdate(r *pkgCluster.UpdateClusterRequest)
- func (c *GKECluster) CheckEqualityToUpdate(r *pkgCluster.UpdateClusterRequest) error
- func (c *GKECluster) CreateCluster() error
- func (c *GKECluster) DeleteCluster() error
- func (c *GKECluster) DeleteFromDatabase() error
- func (c *GKECluster) DownloadK8sConfig() ([]byte, error)
- func (c *GKECluster) GetAPIEndpoint() (string, error)
- func (c *GKECluster) GetAllMachineTypes() (map[string]pkgCluster.MachineTypes, error)
- func (c *GKECluster) GetAllMachineTypesByZone(zone string) (map[string]pkgCluster.MachineTypes, error)
- func (c *GKECluster) GetCloud() string
- func (c *GKECluster) GetConfigSecretId() string
- func (c *GKECluster) GetDistribution() string
- func (c *GKECluster) GetGkeServerConfig(zone string) (*gke.ServerConfig, error)
- func (c *GKECluster) GetGoogleCluster() (*gke.Cluster, error)
- func (c *GKECluster) GetID() uint
- func (c *GKECluster) GetK8sConfig() ([]byte, error)
- func (c *GKECluster) GetK8sUserConfig() ([]byte, error)
- func (c *GKECluster) GetLocation() string
- func (c *GKECluster) GetName() string
- func (c *GKECluster) GetOrganizationId() uint
- func (c *GKECluster) GetProjectId() (string, error)
- func (c *GKECluster) GetSecretId() string
- func (c *GKECluster) GetSecretWithValidation() (*secret.SecretItemResponse, error)
- func (c *GKECluster) GetSshSecretId() string
- func (c *GKECluster) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
- func (c *GKECluster) GetUID() string
- func (c *GKECluster) GetZones() ([]string, error)
- func (c *GKECluster) IsReady() (bool, error)
- func (c *GKECluster) NodePoolExists(nodePoolName string) bool
- func (c *GKECluster) Persist() error
- func (c *GKECluster) RbacEnabled() bool
- func (c *GKECluster) SaveConfigSecretId(configSecretId string) error
- func (c *GKECluster) SaveSshSecretId(sshSecretId string) error
- func (c *GKECluster) SetStatus(status, statusMessage string) error
- func (c *GKECluster) UpdateCluster(updateRequest *pkgCluster.UpdateClusterRequest, userId uint) error
- func (c *GKECluster) UpdateNodePools(request *pkgCluster.UpdateNodePoolsRequest, userId uint) error
- func (c *GKECluster) ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error
- type GKEClusterRepository
- type HelmService
- type HelmServiceInjector
- type HookWithParamsFactory
- type InitSpotConfigPostHook
- type InstallSecretRequest
- type InstallSecretRequestSpecItem
- type K8sConfigDownloader
- type KubeAPIProxy
- type KubeCluster
- func (c *KubeCluster) AddDefaultsToUpdate(*pkgCluster.UpdateClusterRequest)
- func (c *KubeCluster) CheckEqualityToUpdate(*pkgCluster.UpdateClusterRequest) error
- func (c *KubeCluster) CreateCluster() error
- func (c *KubeCluster) DeleteCluster() error
- func (c *KubeCluster) DeleteFromDatabase() error
- func (c *KubeCluster) DownloadK8sConfig() ([]byte, error)
- func (c *KubeCluster) GetAPIEndpoint() (string, error)
- func (c *KubeCluster) GetCloud() string
- func (c *KubeCluster) GetConfigSecretId() string
- func (c *KubeCluster) GetDistribution() string
- func (c *KubeCluster) GetID() uint
- func (c *KubeCluster) GetK8sConfig() ([]byte, error)
- func (c *KubeCluster) GetK8sUserConfig() ([]byte, error)
- func (c *KubeCluster) GetLocation() string
- func (c *KubeCluster) GetModel() *model.ClusterModel
- func (c *KubeCluster) GetName() string
- func (c *KubeCluster) GetOrganizationId() uint
- func (c *KubeCluster) GetSecretId() string
- func (c *KubeCluster) GetSecretWithValidation() (*secret.SecretItemResponse, error)
- func (c *KubeCluster) GetSshSecretId() string
- func (c *KubeCluster) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
- func (c *KubeCluster) GetUID() string
- func (c *KubeCluster) IsReady() (bool, error)
- func (c *KubeCluster) NodePoolExists(nodePoolName string) bool
- func (c *KubeCluster) Persist() error
- func (c *KubeCluster) RbacEnabled() bool
- func (c *KubeCluster) SaveConfigSecretId(configSecretId string) error
- func (c *KubeCluster) SaveSshSecretId(sshSecretId string) error
- func (c *KubeCluster) SetStatus(status, statusMessage string) error
- func (c *KubeCluster) UpdateCluster(updateRequest *pkgCluster.UpdateClusterRequest, _ uint) error
- func (c *KubeCluster) UpdateNodePools(request *pkgCluster.UpdateNodePoolsRequest, userId uint) error
- func (c *KubeCluster) ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error
- type KubeProxyCache
- type KubernetesDashboardPostHook
- type LabelNodesWithNodepoolNameActivity
- type LabelNodesWithNodepoolNameActivityInput
- type Manager
- func (m *Manager) CreateCluster(ctx context.Context, creationCtx CreationContext, creator clusterCreator) (CommonCluster, error)
- func (m *Manager) DeleteCluster(ctx context.Context, cluster CommonCluster, force bool) error
- func (m *Manager) DeleteKubeProxy(commonCluster CommonCluster)
- func (m *Manager) GetAllClusters(ctx context.Context) ([]CommonCluster, error)
- func (m *Manager) GetClusterByID(ctx context.Context, organizationID uint, clusterID uint) (CommonCluster, error)
- func (m *Manager) GetClusterByIDOnly(ctx context.Context, clusterID uint) (CommonCluster, error)
- func (m *Manager) GetClusterByName(ctx context.Context, organizationID uint, clusterName string) (CommonCluster, error)
- func (m *Manager) GetClusterStatus(ctx context.Context, clusterID uint) (string, error)
- func (m *Manager) GetClusters(ctx context.Context, organizationID uint) ([]CommonCluster, error)
- func (m *Manager) GetClustersBySecretID(ctx context.Context, organizationID uint, secretID string) ([]CommonCluster, error)
- func (m *Manager) GetKubeProxy(requestSchema string, requestHost string, apiProxyPrefix string, ...) (*KubeAPIProxy, error)
- func (m *Manager) GetKubeProxyCache() KubeProxyCache
- func (m *Manager) KubeConfigFunc() func(ctx context.Context, clusterID uint) ([]byte, error)
- func (m *Manager) UpdateCluster(ctx context.Context, updateCtx UpdateContext, updater clusterUpdater) error
- type NodePoolLabels
- type PKENodePool
- type PostFunctioner
- type Priority
- type RunPostHookActivity
- type RunPostHookActivityInput
- type RunPostHooksWorkflowInput
- type RunPostHooksWorkflowInputPostHook
- type TokenGenerator
- type UpdateClusterStatusActivity
- type UpdateClusterStatusActivityInput
- type UpdateContext
Constants ¶
const ( ExternalBaseURLKey = contextKey("ExternalBaseURL") ExternalBaseURLInsecureKey = contextKey("ExternalBaseURLInsecure") )
const CreateClusterWorkflowName = "create-cluster-legacy"
const DownloadK8sConfigActivityName = "download-k8s-config-legacy"
const EKSCreateClusterWorkflowName = "eks-create-cluster"
const EKSDeleteClusterWorkflowName = "eks-delete-cluster"
const EKSUpdateClusterWorkflowName = "eks-update-cluster"
const LabelNodesWithNodepoolNameActivityName = "label-nodes-with-nodepool-name-legacy"
const RBAC_API_VERSION = "rbac.authorization.k8s.io"
const RunPostHookActivityName = "run-posthook"
const RunPostHooksWorkflowName = "run-posthooks"
const (
StorageAccountContributor = "Storage Account Contributor"
)
Storage Account Contributor role constant
const UpdateClusterStatusActivityName = "update-cluster-status"
Variables ¶
var ( ErrSecretNotFound = stderrors.New("secret not found") ErrKubernetesSecretNotFound = stderrors.New("kubernetes secret not found") ErrKubernetesSecretAlreadyExists = stderrors.New("kubernetes secret already exists") )
var BasePostHookFunctions = []string{ pkgCluster.InstallKubernetesDashboardPostHook, pkgCluster.InitSpotConfig, }
BasePostHookFunctions default posthook functions after cluster create nolint: gochecknoglobals
var ErrAlreadyExists = stderrors.New("cluster already exists with this name")
var ErrConfigNotExists = fmt.Errorf("Kubernetes config is not available for the cluster")
ErrConfigNotExists means that a cluster has no kubeconfig stored in vault (probably didn't successfully start yet)
var ErrInvalidClusterInstance = errors.New("invalid cluster instance")
var ErrNoInfrastructureRG = errors.New("no infrastructure resource group found")
var HookMap = map[string]PostFunctioner{ pkgCluster.InstallKubernetesDashboardPostHook: &KubernetesDashboardPostHook{ ErrorHandler: ErrorHandler{}, }, pkgCluster.InitSpotConfig: &InitSpotConfigPostHook{ ErrorHandler: ErrorHandler{}, }, }
HookMap for api hook endpoints nolint: gochecknoglobals
Functions ¶
func CreateClusterWorkflow ¶
func CreateClusterWorkflow(ctx workflow.Context, input CreateClusterWorkflowInput) error
func CreateOrUpdateResourceGroup ¶
func CreateOrUpdateResourceGroup(orgID uint, secretID string, resourceGroupName, location string) error
CreateOrUpdateResourceGroup creates or updates a resource group
func EKSCreateClusterWorkflow ¶
func EKSCreateClusterWorkflow(ctx workflow.Context, input EKSCreateClusterWorkflowInput) error
CreateClusterWorkflow executes the Cadence workflow responsible for creating and configuring an EKS cluster
func EKSDeleteClusterWorkflow ¶
func EKSDeleteClusterWorkflow(ctx workflow.Context, input EKSDeleteClusterWorkflowInput) error
DeleteClusterWorkflow executes the Cadence workflow responsible for deleting an EKS cluster
func GetDesiredLabelsForCluster ¶
func GetDesiredLabelsForCluster(ctx context.Context, cluster CommonCluster, nodePoolLabels []NodePoolLabels) (map[string]map[string]string, error)
GetDesiredLabelsForCluster returns desired set of labels for each node pool name, adding reserved labels like: head node, ondemand labels + cloudinfo to user defined labels in specified nodePools map. All user labels are deleted in case Label map is empty in NodePoolLabels, however in case Label map is nil no labels are returned to avoid overriding already exisisting user specified labels.
func GetEKSNodePools ¶
func GetEKSNodePools(cluster CommonCluster) ([]*eksmodel.AmazonNodePoolsModel, error)
GetEKSNodePools returns EKS node pools from a common cluster.
func GetKubernetesVersion ¶
GetKubernetesVersion returns a list of supported kubernetes version in the specified subscription
func GetLocations ¶
GetLocations returns all the locations that are available for resource providers
func GetMachineTypes ¶
func GetMachineTypes(orgID uint, secretID string, location string) (pkgCluster.MachineTypes, error)
GetMachineTypes lists all available virtual machine sizes for a subscription in a location
func InstallSecret ¶
func InstallSecret(cc interface { GetK8sConfig() ([]byte, error) GetOrganizationId() uint }, secretName string, req InstallSecretRequest, ) (string, error)
InstallSecret installs a new secret under the name into namespace of a Kubernetes cluster. It returns the installed secret name and meta about how to mount it.
func InstallSecretByK8SConfig ¶
func InstallSecretByK8SConfig(kubeConfig []byte, orgID uint, secretName string, req InstallSecretRequest) (string, error)
InstallSecretByK8SConfig is the same as InstallSecret but use this if you already have a K8S config at hand.
func InstallSecrets ¶
func InstallSecrets(ctx context.Context, cc CommonCluster, query *secret.ListSecretsQuery, namespace string) ([]string, error)
InstallSecrets installs or updates secrets that matches the query under the name into namespace of a Kubernetes cluster. It returns the list of installed secret names and meta about how to mount them.
func InstallSecretsByK8SConfig ¶
func InstallSecretsByK8SConfig(ctx context.Context, kubeConfig []byte, orgID uint, query *secret.ListSecretsQuery, namespace string) ([]string, error)
InstallSecretsByK8SConfig is the same as InstallSecrets but use this if you already have a K8S config at hand.
func ListResourceGroups ¶
ListResourceGroups returns all resource group
func MergeSecret ¶
func MergeSecret(ctx context.Context, cc CommonCluster, secretName string, req InstallSecretRequest) (string, error)
MergeSecret merges a secret with an already existing one in a Kubernetes cluster. It returns the installed secret name and meta about how to mount it.
func MergeSecretByK8SConfig ¶
func MergeSecretByK8SConfig(ctx context.Context, kubeConfig []byte, orgID uint, secretName string, req InstallSecretRequest) (string, error)
MergeSecretByK8SConfig is the same as MergeSecret but use this if you already have a K8S config at hand.
func NewClusterCheckMiddleware ¶
func NewClusterCheckMiddleware(manager *Manager, errorHandler emperror.Handler) gin.HandlerFunc
NewClusterCheckMiddleware returns a new gin middleware that checks cluster is exists in the current org.
func NewClusterCreator ¶
func NewClusterCreator(request *pkgCluster.CreateClusterRequest, cluster CommonCluster, workflowClient client.Client) clusterCreator
NewClusterCreator returns a new PKE or Common cluster creator instance depending on the cluster.
func NewClusterEvents ¶
func NewClusterEvents(eb eventBus) *clusterEventBus
func NewCommonClusterCreator ¶
func NewCommonClusterCreator(request *pkgCluster.CreateClusterRequest, cluster CommonCluster) *commonCreator
NewCommonClusterCreator returns a new cluster creator instance.
func NewCommonClusterUpdater ¶
func NewCommonClusterUpdater( request *cluster.UpdateClusterRequest, clientFactory DynamicClientFactory, cluster CommonCluster, userID uint, workflowClient client.Client, externalBaseURL string, externalBaseURLInsecure bool, helmService HelmService, ) *commonUpdater
NewCommonClusterUpdater returns a new cluster creator instance.
func NewCommonNodepoolUpdater ¶
func NewCommonNodepoolUpdater(request *cluster.UpdateNodePoolsRequest, cluster CommonCluster, userID uint) *commonNodepoolUpdater
NewCommonNodepoolUpdater returns a new cluster creator instance.
func NewCreatorBaseFields ¶
func NewCreatorBaseFields(createdAt time.Time, createdBy uint) *pkgCommon.CreatorBaseFields
NewCreatorBaseFields creates a new CreatorBaseFields instance from createdAt and createdBy
func NewExporter ¶
func NewExporter() *pipelineMetrics
func NewLogurLogger ¶
func NewLogurLogger(fl logrus.FieldLogger) logur.Logger
func NewNopClusterEvents ¶
func NewNopClusterEvents() *nopClusterEvents
func RunPostHooksWorkflow ¶
func RunPostHooksWorkflow(ctx workflow.Context, input RunPostHooksWorkflowInput) error
func StoreKubernetesConfig ¶
func StoreKubernetesConfig(cluster CommonCluster, config []byte) error
StoreKubernetesConfig stores the given K8S config in vault
Types ¶
type AKSCluster ¶
type AKSCluster struct { CommonClusterBase // contains filtered or unexported fields }
AKSCluster represents an AKS cluster
func CreateAKSClusterFromModel ¶
func CreateAKSClusterFromModel(clusterModel *model.ClusterModel) *AKSCluster
CreateAKSClusterFromModel creates ClusterModel struct from model
func CreateAKSClusterFromRequest ¶
func CreateAKSClusterFromRequest(request *pkgCluster.CreateClusterRequest, orgID uint, userID uint) (*AKSCluster, error)
CreateAKSClusterFromRequest returns an AKS cluster instance created from the specified request
func (*AKSCluster) AddDefaultsToUpdate ¶
func (c *AKSCluster) AddDefaultsToUpdate(r *pkgCluster.UpdateClusterRequest)
AddDefaultsToUpdate adds defaults to update request
func (*AKSCluster) CheckEqualityToUpdate ¶
func (c *AKSCluster) CheckEqualityToUpdate(r *pkgCluster.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 the cluster from AKS
func (*AKSCluster) DeleteFromDatabase ¶
func (c *AKSCluster) DeleteFromDatabase() error
DeleteFromDatabase deletes model from the database
func (*AKSCluster) DownloadK8sConfig ¶
func (c *AKSCluster) DownloadK8sConfig() ([]byte, error)
DownloadK8sConfig returns the kubeconfig file's contents from AKS
func (*AKSCluster) GetAKSNodePools ¶
func (c *AKSCluster) GetAKSNodePools() []*azureadapter.AKSNodePoolModel
GetAKSNodePools returns AKS node pools.
func (*AKSCluster) GetAPIEndpoint ¶
func (c *AKSCluster) GetAPIEndpoint() (string, error)
GetAPIEndpoint returns the Kubernetes API endpoint
func (*AKSCluster) GetCloud ¶
func (c *AKSCluster) GetCloud() string
GetCloud returns the cloud type of the cluster
func (*AKSCluster) GetConfigSecretId ¶
func (c *AKSCluster) GetConfigSecretId() string
GetConfigSecretId returns the cluster's config secret ID
func (*AKSCluster) GetDistribution ¶
func (c *AKSCluster) GetDistribution() string
GetDistribution returns the distribution type of the cluster
func (*AKSCluster) GetK8sConfig ¶
func (c *AKSCluster) GetK8sConfig() ([]byte, error)
GetK8sConfig returns the Kubernetes config
func (*AKSCluster) GetK8sUserConfig ¶
func (c *AKSCluster) GetK8sUserConfig() ([]byte, error)
GetK8sUserConfig returns the Kubernetes config for external users
func (*AKSCluster) GetKubernetesVersion ¶
func (c *AKSCluster) GetKubernetesVersion() (string, error)
func (*AKSCluster) GetLocation ¶
func (c *AKSCluster) GetLocation() string
GetLocation returns the location of the cluster
func (*AKSCluster) GetModel ¶
func (c *AKSCluster) GetModel() *model.ClusterModel
GetModel returns the cluster's model
func (*AKSCluster) GetName ¶
func (c *AKSCluster) GetName() string
GetName returns the name of the cluster
func (*AKSCluster) GetOrganizationId ¶
func (c *AKSCluster) GetOrganizationId() uint
GetOrganizationId returns the ID of the organization where the cluster belongs to
func (*AKSCluster) GetResourceGroupName ¶
func (c *AKSCluster) GetResourceGroupName() string
GetResourceGroupName return the resource group's name the cluster belongs in
func (*AKSCluster) GetSecretId ¶
func (c *AKSCluster) GetSecretId() string
GetSecretId returns the cluster secret's ID
func (*AKSCluster) GetSecretWithValidation ¶
func (c *AKSCluster) GetSecretWithValidation() (*secret.SecretItemResponse, error)
GetSecretWithValidation returns secret from vault
func (*AKSCluster) GetSshSecretId ¶
func (c *AKSCluster) GetSshSecretId() string
GetSSHSecretID returns the cluster's SSH secret ID
func (*AKSCluster) GetStatus ¶
func (c *AKSCluster) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
GetStatus returns the cluster's status
func (*AKSCluster) IsReady ¶
func (c *AKSCluster) IsReady() (bool, error)
IsReady checks if the cluster is running according to the cloud provider
func (*AKSCluster) NodePoolExists ¶
func (c *AKSCluster) NodePoolExists(nodePoolName string) bool
NodePoolExists returns true if node pool with nodePoolName exists
func (*AKSCluster) Persist ¶
func (c *AKSCluster) Persist() error
Persist saves the cluster model Deprecated: Do not use.
func (*AKSCluster) RbacEnabled ¶
func (c *AKSCluster) RbacEnabled() bool
RbacEnabled returns true if rbac enabled on the cluster
func (*AKSCluster) RequiresSshPublicKey ¶
func (c *AKSCluster) RequiresSshPublicKey() bool
RequiresSshPublicKey returns true if a public SSH key is needed for bootstrapping the cluster
func (*AKSCluster) SaveConfigSecretId ¶
func (c *AKSCluster) SaveConfigSecretId(configSecretID string) error
SaveConfigSecretId saves the config secret ID in database
func (*AKSCluster) SaveSshSecretId ¶
func (c *AKSCluster) SaveSshSecretId(sshSecretID string) error
SaveSshSecretId saves the SSH secret ID to database
func (*AKSCluster) SetStatus ¶
func (c *AKSCluster) SetStatus(status, statusMessage string) error
SetStatus sets the cluster's status
func (*AKSCluster) UpdateCluster ¶
func (c *AKSCluster) UpdateCluster(request *pkgCluster.UpdateClusterRequest, userID uint) error
UpdateCluster updates the cluster in AKS
func (*AKSCluster) UpdateNodePools ¶
func (c *AKSCluster) UpdateNodePools(request *pkgCluster.UpdateNodePoolsRequest, userID uint) error
UpdateNodePools updates nodes pools of a cluster
func (*AKSCluster) ValidateCreationFields ¶
func (c *AKSCluster) ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error
ValidateCreationFields validates all field
type ClientFactory ¶
type ClientFactory interface { // FromSecret creates a Kubernetes client for a cluster from a secret. FromSecret(ctx context.Context, secretID string) (kubernetes.Interface, error) }
ClientFactory returns a Kubernetes client.
type CommonCluster ¶
type CommonCluster interface { // Entity properties GetID() uint GetUID() string GetOrganizationId() uint GetName() string GetCloud() string GetDistribution() string GetLocation() string // Secrets GetSecretId() string GetSshSecretId() string SaveSshSecretId(string) error SaveConfigSecretId(string) error GetConfigSecretId() string GetSecretWithValidation() (*secret.SecretItemResponse, error) // Persistence Persist() error DeleteFromDatabase() error // Cluster management CreateCluster() error ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error UpdateCluster(*pkgCluster.UpdateClusterRequest, uint) error UpdateNodePools(*pkgCluster.UpdateNodePoolsRequest, uint) error CheckEqualityToUpdate(*pkgCluster.UpdateClusterRequest) error AddDefaultsToUpdate(*pkgCluster.UpdateClusterRequest) DeleteCluster() error // Kubernetes GetAPIEndpoint() (string, error) GetK8sConfig() ([]byte, error) GetK8sUserConfig() ([]byte, error) RequiresSshPublicKey() bool RbacEnabled() bool // Cluster info GetStatus() (*pkgCluster.GetClusterStatusResponse, error) IsReady() (bool, error) NodePoolExists(nodePoolName string) bool SetStatus(status, statusMessage string) error }
CommonCluster interface for clusters.
func CreateCommonClusterFromRequest ¶
func CreateCommonClusterFromRequest(createClusterRequest *pkgCluster.CreateClusterRequest, orgId uint, userId uint) (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 CommonClusterBase ¶
type CommonClusterBase struct {
// contains filtered or unexported fields
}
CommonClusterBase holds the fields that is common to all cluster types also provides default implementation for common interface methods.
func (*CommonClusterBase) RequiresSshPublicKey ¶
func (c *CommonClusterBase) RequiresSshPublicKey() bool
RequiresSshPublicKey returns true if an ssh public key is needed for the cluster for bootstrapping it. The default is false.
type CreationContext ¶
type CreationContext struct { OrganizationID uint UserID uint ExternalBaseURL string ExternalBaseURLInsecure bool Name string Provider string SecretID string SecretIDs []string PostHooks pkgCluster.PostHooks }
CreationContext represents the data necessary to do generic cluster creation steps/checks.
type DownloadK8sConfigActivity ¶
type DownloadK8sConfigActivity struct {
// contains filtered or unexported fields
}
func NewDownloadK8sConfigActivity ¶
func NewDownloadK8sConfigActivity(manager *Manager) DownloadK8sConfigActivity
func (DownloadK8sConfigActivity) Execute ¶
func (a DownloadK8sConfigActivity) Execute(ctx context.Context, input DownloadK8sConfigActivityInput) (string, error)
type DownloadK8sConfigActivityInput ¶
type DownloadK8sConfigActivityInput struct {
ClusterID uint
}
type DynamicClientFactory ¶
type DynamicClientFactory interface { // FromSecret creates a Kubernetes client for a cluster from a secret. FromSecret(ctx context.Context, secretID string) (dynamic.Interface, error) }
DynamicClientFactory returns a dynamic Kubernetes client.
type EC2ClusterPKE ¶
type EC2ClusterPKE struct { // amazonCluster *ec2.EC2 //Don't use this directly APIEndpoint string CommonClusterBase // contains filtered or unexported fields }
func CreateEC2ClusterPKEFromModel ¶
func CreateEC2ClusterPKEFromModel(modelCluster *model.ClusterModel) (*EC2ClusterPKE, error)
func CreateEC2ClusterPKEFromRequest ¶
func CreateEC2ClusterPKEFromRequest(request *pkgCluster.CreateClusterRequest, orgId uint, userId uint) (*EC2ClusterPKE, error)
func (*EC2ClusterPKE) AddDefaultsToUpdate ¶
func (c *EC2ClusterPKE) AddDefaultsToUpdate(*pkgCluster.UpdateClusterRequest)
func (*EC2ClusterPKE) CheckEqualityToUpdate ¶
func (c *EC2ClusterPKE) CheckEqualityToUpdate(*pkgCluster.UpdateClusterRequest) error
func (*EC2ClusterPKE) CreateCluster ¶
func (c *EC2ClusterPKE) CreateCluster() error
func (*EC2ClusterPKE) CreatePKECluster ¶
func (c *EC2ClusterPKE) CreatePKECluster(tokenGenerator TokenGenerator, externalBaseURL string) error
func (*EC2ClusterPKE) DeleteCluster ¶
func (c *EC2ClusterPKE) DeleteCluster() error
func (*EC2ClusterPKE) DeleteFromDatabase ¶
func (c *EC2ClusterPKE) DeleteFromDatabase() error
DeleteFromDatabase deletes the distribution related entities from the database
func (*EC2ClusterPKE) DeletePKECluster ¶
func (*EC2ClusterPKE) GetAPIEndpoint ¶
func (c *EC2ClusterPKE) GetAPIEndpoint() (string, error)
func (*EC2ClusterPKE) GetAWSClient ¶
func (c *EC2ClusterPKE) GetAWSClient() (*session.Session, error)
func (*EC2ClusterPKE) GetBootstrapCommand ¶
func (c *EC2ClusterPKE) GetBootstrapCommand( nodePoolName string, url string, urlInsecure bool, token string, labels []string, version string, ) (string, error)
GetBootstrapCommand returns a command line to use to install a node in the given nodepool
func (*EC2ClusterPKE) GetCAHash ¶
func (c *EC2ClusterPKE) GetCAHash() (string, error)
func (*EC2ClusterPKE) GetCloud ¶
func (c *EC2ClusterPKE) GetCloud() string
func (*EC2ClusterPKE) GetConfigSecretId ¶
func (c *EC2ClusterPKE) GetConfigSecretId() string
func (*EC2ClusterPKE) GetCurrentWorkflowID ¶
func (c *EC2ClusterPKE) GetCurrentWorkflowID() string
func (*EC2ClusterPKE) GetDistribution ¶
func (c *EC2ClusterPKE) GetDistribution() string
func (*EC2ClusterPKE) GetID ¶
func (c *EC2ClusterPKE) GetID() uint
func (*EC2ClusterPKE) GetK8sConfig ¶
func (c *EC2ClusterPKE) GetK8sConfig() ([]byte, error)
func (*EC2ClusterPKE) GetK8sUserConfig ¶
func (c *EC2ClusterPKE) GetK8sUserConfig() ([]byte, error)
func (*EC2ClusterPKE) GetKubernetesContainerRuntime ¶
func (c *EC2ClusterPKE) GetKubernetesContainerRuntime() (string, error)
func (*EC2ClusterPKE) GetKubernetesNetworkProvider ¶
func (c *EC2ClusterPKE) GetKubernetesNetworkProvider() (string, error)
func (*EC2ClusterPKE) GetKubernetesVersion ¶
func (c *EC2ClusterPKE) GetKubernetesVersion() (string, error)
func (*EC2ClusterPKE) GetLocation ¶
func (c *EC2ClusterPKE) GetLocation() string
func (*EC2ClusterPKE) GetName ¶
func (c *EC2ClusterPKE) GetName() string
func (*EC2ClusterPKE) GetNetworkApiServerAddress ¶
func (c *EC2ClusterPKE) GetNetworkApiServerAddress() (host, port string, err error)
GetNetworkApiServerAddress returns Kubernetes API Server host and port.
func (*EC2ClusterPKE) GetNetworkCloudProvider ¶
func (c *EC2ClusterPKE) GetNetworkCloudProvider() (cloudProvider, vpcID string, subnets []string, err error)
GetNetworkCloudProvider return cloud provider specific network information.
func (*EC2ClusterPKE) GetNodePools ¶
func (c *EC2ClusterPKE) GetNodePools() []PKENodePool
func (*EC2ClusterPKE) GetOrganizationId ¶
func (c *EC2ClusterPKE) GetOrganizationId() uint
func (*EC2ClusterPKE) GetPipelineToken ¶
func (c *EC2ClusterPKE) GetPipelineToken(tokenGenerator interface{}) (string, error)
GetPipelineToken returns a lazily generated token for Pipeline
func (*EC2ClusterPKE) GetSecretId ¶
func (c *EC2ClusterPKE) GetSecretId() string
func (*EC2ClusterPKE) GetSecretWithValidation ¶
func (c *EC2ClusterPKE) GetSecretWithValidation() (*secret.SecretItemResponse, error)
func (*EC2ClusterPKE) GetSshPublicKey ¶
func (c *EC2ClusterPKE) GetSshPublicKey() (string, error)
func (*EC2ClusterPKE) GetSshSecretId ¶
func (c *EC2ClusterPKE) GetSshSecretId() string
func (*EC2ClusterPKE) GetStatus ¶
func (c *EC2ClusterPKE) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
func (*EC2ClusterPKE) GetUID ¶
func (c *EC2ClusterPKE) GetUID() string
func (*EC2ClusterPKE) HasK8sConfig ¶
func (c *EC2ClusterPKE) HasK8sConfig() (bool, error)
HasK8sConfig returns true if the cluster's k8s config is available
func (*EC2ClusterPKE) IsMasterReady ¶
func (c *EC2ClusterPKE) IsMasterReady() (bool, error)
IsMasterReady returns true when the master node has been reported as ready
func (*EC2ClusterPKE) IsReady ¶
func (c *EC2ClusterPKE) IsReady() (bool, error)
IsReady checks if the cluster is running according to the cloud provider.
func (*EC2ClusterPKE) ListNodePools ¶
func (c *EC2ClusterPKE) ListNodePools() ([]string, error)
ListNodePools returns node pool names.
func (*EC2ClusterPKE) NodePoolExists ¶
func (c *EC2ClusterPKE) NodePoolExists(nodePoolName string) bool
func (*EC2ClusterPKE) Persist ¶
func (c *EC2ClusterPKE) Persist() error
func (*EC2ClusterPKE) RbacEnabled ¶
func (c *EC2ClusterPKE) RbacEnabled() bool
func (*EC2ClusterPKE) RegisterNode ¶
func (c *EC2ClusterPKE) RegisterNode(name, nodePoolName, ip string, master, worker bool) error
RegisterNode adds a Node to the DB
func (*EC2ClusterPKE) RequiresSshPublicKey ¶
func (c *EC2ClusterPKE) RequiresSshPublicKey() bool
RequiresSshPublicKey returns true as a public ssh key is needed for bootstrapping the cluster
func (*EC2ClusterPKE) SaveConfigSecretId ¶
func (c *EC2ClusterPKE) SaveConfigSecretId(configSecretId string) error
func (*EC2ClusterPKE) SaveNetworkApiServerAddress ¶
func (c *EC2ClusterPKE) SaveNetworkApiServerAddress(host, port string) error
SaveNetworkApiServerAddress stores Kubernetes API Server host and port.
func (*EC2ClusterPKE) SaveNetworkCloudProvider ¶
func (c *EC2ClusterPKE) SaveNetworkCloudProvider(cloudProvider, vpcID string, subnets []string) error
SaveNetworkCloudProvider saves cloud provider specific network information.
func (*EC2ClusterPKE) SaveSshSecretId ¶
func (c *EC2ClusterPKE) SaveSshSecretId(sshSecretId string) error
func (*EC2ClusterPKE) SetCurrentWorkflowID ¶
func (c *EC2ClusterPKE) SetCurrentWorkflowID(workflowID string) error
func (*EC2ClusterPKE) SetStatus ¶
func (c *EC2ClusterPKE) SetStatus(status, statusMessage string) error
SetStatus sets the cluster's status
func (*EC2ClusterPKE) UpdateCluster ¶
func (c *EC2ClusterPKE) UpdateCluster(*pkgCluster.UpdateClusterRequest, uint) error
func (*EC2ClusterPKE) UpdateNodePools ¶
func (c *EC2ClusterPKE) UpdateNodePools(*pkgCluster.UpdateNodePoolsRequest, uint) error
func (*EC2ClusterPKE) UpdatePKECluster ¶
func (c *EC2ClusterPKE) UpdatePKECluster(ctx context.Context, request *pkgCluster.UpdateClusterRequest, userID uint, workflowClient client.Client, externalBaseURL string, externalBaseURLInsecure bool) error
func (*EC2ClusterPKE) ValidateCreationFields ¶
func (c *EC2ClusterPKE) ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error
type EKSCluster ¶
type EKSCluster struct { EncryptionConfig []pkgEks.EncryptionConfig // maps node pools to subnets. The subnets identified by the "default" key represent the subnets provided in // request.Properties.CreateClusterEKS.Subnets SubnetMapping map[string][]*pkgEks.Subnet CommonClusterBase // contains filtered or unexported fields }
EKSCluster struct for EKS cluster
func CreateEKSClusterFromModel ¶
func CreateEKSClusterFromModel(clusterModel *model.ClusterModel) (*EKSCluster, error)
CreateEKSClusterFromModel creates ClusterModel struct from the model
func CreateEKSClusterFromRequest ¶
func CreateEKSClusterFromRequest(request *pkgCluster.CreateClusterRequest, orgId uint, userId uint) (*EKSCluster, error)
CreateEKSClusterFromRequest creates ClusterModel struct from the request
func (*EKSCluster) AddDefaultsToUpdate ¶
func (c *EKSCluster) AddDefaultsToUpdate(r *pkgCluster.UpdateClusterRequest)
AddDefaultsToUpdate adds defaults to update request
func (*EKSCluster) CheckEqualityToUpdate ¶
func (c *EKSCluster) CheckEqualityToUpdate(r *pkgCluster.UpdateClusterRequest) error
CheckEqualityToUpdate validates the update request
func (*EKSCluster) CreateCluster ¶
func (c *EKSCluster) CreateCluster() error
func (*EKSCluster) DeleteCluster ¶
func (c *EKSCluster) DeleteCluster() error
func (*EKSCluster) DeleteFromDatabase ¶
func (c *EKSCluster) DeleteFromDatabase() error
DeleteFromDatabase deletes model from the database
func (*EKSCluster) GetAPIEndpoint ¶
func (c *EKSCluster) GetAPIEndpoint() (string, error)
GetAPIEndpoint returns the Kubernetes Api endpoint
func (*EKSCluster) GetCloud ¶
func (c *EKSCluster) GetCloud() string
GetCloud returns the cloud type of the cluster
func (*EKSCluster) GetConfigSecretId ¶
func (c *EKSCluster) GetConfigSecretId() string
GetConfigSecretId returns config secret id
func (*EKSCluster) GetDistribution ¶
func (c *EKSCluster) GetDistribution() string
GetDistribution returns the distribution type of the cluster
func (*EKSCluster) GetID ¶
func (c *EKSCluster) GetID() uint
GetID returns the DB ID of this cluster
func (*EKSCluster) GetK8sConfig ¶
func (c *EKSCluster) GetK8sConfig() ([]byte, error)
GetK8sConfig returns the Kubernetes config for internal use
func (*EKSCluster) GetK8sUserConfig ¶
func (c *EKSCluster) GetK8sUserConfig() ([]byte, error)
GetK8sUserConfig returns the Kubernetes config for external users
func (*EKSCluster) GetKubernetesVersion ¶
func (c *EKSCluster) GetKubernetesVersion() (string, error)
func (*EKSCluster) GetLocation ¶
func (c *EKSCluster) GetLocation() string
GetLocation gets where the cluster is.
func (*EKSCluster) GetModel ¶
func (c *EKSCluster) GetModel() *eksmodel.EKSClusterModel
GetModel returns the DB model of this cluster
func (*EKSCluster) GetName ¶
func (c *EKSCluster) GetName() string
GetName returns the name of the cluster
func (*EKSCluster) GetOrganizationId ¶
func (c *EKSCluster) GetOrganizationId() uint
GetOrganizationId gets org where the cluster belongs
func (*EKSCluster) GetSecretId ¶
func (c *EKSCluster) GetSecretId() string
GetSecretId retrieves the secret id
func (*EKSCluster) GetSecretWithValidation ¶
func (c *EKSCluster) GetSecretWithValidation() (*secret.SecretItemResponse, error)
GetSecretWithValidation returns secret from vault
func (*EKSCluster) GetSshSecretId ¶
func (c *EKSCluster) GetSshSecretId() string
GetSshSecretId retrieves the secret id
func (*EKSCluster) GetStatus ¶
func (c *EKSCluster) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
GetStatus describes the status of this EKS cluster.
func (*EKSCluster) GetSubnetMapping ¶
func (c *EKSCluster) GetSubnetMapping() map[string][]*pkgEks.Subnet
func (*EKSCluster) GetUID ¶
func (c *EKSCluster) GetUID() string
func (*EKSCluster) IsReady ¶
func (c *EKSCluster) IsReady() (bool, error)
IsReady checks if the cluster is running according to the cloud provider.
func (*EKSCluster) IsSSHGenerated ¶
func (c *EKSCluster) IsSSHGenerated() bool
func (*EKSCluster) NodePoolExists ¶
func (c *EKSCluster) NodePoolExists(nodePoolName string) bool
NodePoolExists returns true if node pool with nodePoolName exists
func (*EKSCluster) Persist ¶
func (c *EKSCluster) Persist() error
Persist saves the cluster model Deprecated: Do not use.
func (*EKSCluster) PersistSSHGenerate ¶
func (c *EKSCluster) PersistSSHGenerate(sshGenerated bool) error
func (*EKSCluster) RbacEnabled ¶
func (c *EKSCluster) RbacEnabled() bool
RbacEnabled returns true if rbac enabled on the cluster
func (*EKSCluster) RequiresSshPublicKey ¶
func (c *EKSCluster) RequiresSshPublicKey() bool
RequiresSshPublicKey returns true as a public ssh key is needed for bootstrapping the cluster
func (*EKSCluster) SaveConfigSecretId ¶
func (c *EKSCluster) SaveConfigSecretId(configSecretId string) error
SaveConfigSecretId saves the config secret id in database
func (*EKSCluster) SaveSshSecretId ¶
func (c *EKSCluster) SaveSshSecretId(sshSecretId string) error
SaveSshSecretId saves the ssh secret id to database
func (*EKSCluster) SetCurrentWorkflowID ¶
func (c *EKSCluster) SetCurrentWorkflowID(workflowID string) error
func (*EKSCluster) SetStatus ¶
func (c *EKSCluster) SetStatus(status string, statusMessage string) error
SetStatus sets the cluster's status
func (*EKSCluster) UpdateCluster
deprecated
func (c *EKSCluster) UpdateCluster(*pkgCluster.UpdateClusterRequest, uint) error
Deprecated: UpdateCluster updates EKS cluster in cloud
func (*EKSCluster) UpdateNodePools ¶
func (c *EKSCluster) UpdateNodePools(request *pkgCluster.UpdateNodePoolsRequest, userId uint) error
UpdateNodePools updates nodes pools of a cluster
This will become obsolete once we have the Node Pool API ready
func (*EKSCluster) ValidateCreationFields ¶
func (c *EKSCluster) ValidateCreationFields(*pkgCluster.CreateClusterRequest) error
type EKSClusterRepository ¶
type EKSClusterRepository interface { DeleteClusterModel(model *clustermodel.ClusterModel) error DeleteModel(model *eksmodel.EKSClusterModel) error DeleteNodePool(model *eksmodel.AmazonNodePoolsModel) error DeleteSubnet(model *eksmodel.EKSSubnetModel) error SaveModel(model *eksmodel.EKSClusterModel) error SaveStatusHistory(model *clustermodel.StatusHistoryModel) error }
EKSClusterRepository describes a EKS cluster's persistent storage repository
func NewDBEKSClusterRepository ¶
func NewDBEKSClusterRepository(db *gorm.DB) (EKSClusterRepository, error)
NewDBEKSClusterRepository returns a new EKSClusterRepository backed by a GORM DB
type EKSCreateClusterWorkflowInput ¶
type EKSCreateClusterWorkflowInput struct { eksWorkflow.CreateInfrastructureWorkflowInput OrganizationName string PostHooks pkgCluster.PostHooks NodePoolLabels map[string]map[string]string }
CreateClusterWorkflowInput holds data needed by the create cluster workflow
type EKSDeleteClusterWorkflowInput ¶
type EKSDeleteClusterWorkflowInput struct { OrganizationID uint SecretID string Region string ClusterName string NodePoolNames []string ClusterID uint ClusterUID string // the identifier of the kubeconfig secret of the cluster K8sSecretID string DefaultUser bool // force delete Forced bool GeneratedSSHKeyUsed bool }
DeleteClusterWorkflowInput holds data needed by the delete cluster workflow
type EKSUpdateClusterWorkflow ¶
type EKSUpdateClusterWorkflow struct {
// contains filtered or unexported fields
}
func NewEKSUpdateClusterWorkflow ¶
func NewEKSUpdateClusterWorkflow(nodePoolStore eks.NodePoolStore) (eksUpdateClusterWorkflow *EKSUpdateClusterWorkflow)
func (EKSUpdateClusterWorkflow) Execute ¶
func (w EKSUpdateClusterWorkflow) Execute(ctx workflow.Context, input EKSUpdateClusterstructureWorkflowInput) error
UpdateClusterstructureWorkflow executes the Cadence workflow responsible for updating EKS worker nodes
type EKSUpdateClusterstructureWorkflowInput ¶
type EKSUpdateClusterstructureWorkflowInput struct { Region string OrganizationID uint SecretID string ConfigSecretID string ClusterID uint ClusterName string Tags map[string]string UpdaterUserID uint DeletableNodePoolNames []string NewNodePools []eks.NewNodePool NewNodePoolSubnetIDs map[string][]string NodePoolLabels map[string]map[string]string // TODO: remove when UpdateNodePoolWorkflow is refactored. UpdatedNodePools []eksWorkflow.AutoscaleGroup }
EKSUpdateClusterstructureWorkflowInput holds data needed to update EKS cluster worker node pools
type ErrorHandler ¶
type ErrorHandler struct{}
ErrorHandler is the common struct which implement Error function
func (*ErrorHandler) Error ¶
func (*ErrorHandler) Error(c CommonCluster, err error)
type GKECluster ¶
type GKECluster struct { APIEndpoint string CommonClusterBase // 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 *pkgCluster.CreateClusterRequest, orgID uint, userID uint) (*GKECluster, error)
CreateGKEClusterFromRequest creates ClusterModel struct from the request
func (*GKECluster) AddDefaultsToUpdate ¶
func (c *GKECluster) AddDefaultsToUpdate(r *pkgCluster.UpdateClusterRequest)
AddDefaultsToUpdate adds defaults to update request
func (*GKECluster) CheckEqualityToUpdate ¶
func (c *GKECluster) CheckEqualityToUpdate(r *pkgCluster.UpdateClusterRequest) error
CheckEqualityToUpdate validates the update request
func (*GKECluster) CreateCluster ¶
func (c *GKECluster) CreateCluster() error
CreateCluster creates a new cluster
func (*GKECluster) DeleteCluster ¶
func (c *GKECluster) DeleteCluster() error
DeleteCluster deletes cluster from google
func (*GKECluster) DeleteFromDatabase ¶
func (c *GKECluster) DeleteFromDatabase() error
DeleteFromDatabase deletes model from the database
func (*GKECluster) DownloadK8sConfig ¶
func (c *GKECluster) DownloadK8sConfig() ([]byte, error)
DownloadK8sConfig downloads the kubeconfig file from cloud
func (*GKECluster) GetAPIEndpoint ¶
func (c *GKECluster) GetAPIEndpoint() (string, error)
GetAPIEndpoint returns the Kubernetes Api endpoint
func (*GKECluster) GetAllMachineTypes ¶
func (c *GKECluster) GetAllMachineTypes() (map[string]pkgCluster.MachineTypes, error)
GetAllMachineTypes lists all supported machine types
func (*GKECluster) GetAllMachineTypesByZone ¶
func (c *GKECluster) GetAllMachineTypesByZone(zone string) (map[string]pkgCluster.MachineTypes, error)
GetAllMachineTypesByZone lists supported machine types by zone
func (*GKECluster) GetCloud ¶
func (c *GKECluster) GetCloud() string
GetCloud returns the cloud type of the cluster
func (*GKECluster) GetConfigSecretId ¶
func (c *GKECluster) GetConfigSecretId() string
GetConfigSecretId return config secret id
func (*GKECluster) GetDistribution ¶
func (c *GKECluster) GetDistribution() string
GetDistribution returns the distribution type of the cluster
func (*GKECluster) GetGkeServerConfig ¶
func (c *GKECluster) GetGkeServerConfig(zone string) (*gke.ServerConfig, error)
GetGkeServerConfig returns configuration info about the Kubernetes Engine service.
func (*GKECluster) GetGoogleCluster ¶
func (c *GKECluster) GetGoogleCluster() (*gke.Cluster, error)
GetGoogleCluster returns with a Cluster from GKE
func (*GKECluster) GetK8sConfig ¶
func (c *GKECluster) GetK8sConfig() ([]byte, error)
GetK8sConfig returns the Kubernetes config
func (*GKECluster) GetK8sUserConfig ¶
func (c *GKECluster) GetK8sUserConfig() ([]byte, error)
GetK8sUserConfig returns the Kubernetes config
func (*GKECluster) GetLocation ¶
func (c *GKECluster) GetLocation() string
GetLocation gets where the cluster is.
func (*GKECluster) GetName ¶
func (c *GKECluster) GetName() string
GetName returns the name of the cluster
func (*GKECluster) GetOrganizationId ¶
func (c *GKECluster) GetOrganizationId() uint
GetOrganizationId gets org where the cluster belongs
func (*GKECluster) GetProjectId ¶
func (c *GKECluster) GetProjectId() (string, error)
GetProjectId returns with project id from secret
func (*GKECluster) GetSecretId ¶
func (c *GKECluster) GetSecretId() string
GetSecretId retrieves the secret id
func (*GKECluster) GetSecretWithValidation ¶
func (c *GKECluster) GetSecretWithValidation() (*secret.SecretItemResponse, error)
GetSecretWithValidation returns secret from vault
func (*GKECluster) GetSshSecretId ¶
func (c *GKECluster) GetSshSecretId() string
GetSshSecretId retrieves the secret id
func (*GKECluster) GetStatus ¶
func (c *GKECluster) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
GetStatus gets cluster status
func (*GKECluster) GetUID ¶
func (c *GKECluster) GetUID() string
func (*GKECluster) GetZones ¶
func (c *GKECluster) GetZones() ([]string, error)
GetZones lists supported zones
func (*GKECluster) IsReady ¶
func (c *GKECluster) IsReady() (bool, error)
IsReady checks if the cluster is running according to the cloud provider.
func (*GKECluster) NodePoolExists ¶
func (c *GKECluster) NodePoolExists(nodePoolName string) bool
NodePoolExists returns true if node pool with nodePoolName exists
func (*GKECluster) RbacEnabled ¶
func (c *GKECluster) RbacEnabled() bool
RbacEnabled returns true if rbac enabled on the cluster
func (*GKECluster) SaveConfigSecretId ¶
func (c *GKECluster) SaveConfigSecretId(configSecretId string) error
SaveConfigSecretId saves the config secret id in database
func (*GKECluster) SaveSshSecretId ¶
func (c *GKECluster) SaveSshSecretId(sshSecretId string) error
SaveSshSecretId saves the ssh secret id to database
func (*GKECluster) SetStatus ¶
func (c *GKECluster) SetStatus(status, statusMessage string) error
SetStatus sets the cluster's status
func (*GKECluster) UpdateCluster ¶
func (c *GKECluster) UpdateCluster(updateRequest *pkgCluster.UpdateClusterRequest, userId uint) error
UpdateCluster updates GKE cluster in cloud
func (*GKECluster) UpdateNodePools ¶
func (c *GKECluster) UpdateNodePools(request *pkgCluster.UpdateNodePoolsRequest, userId uint) error
UpdateNodePools updates nodes pools of a cluster
func (*GKECluster) ValidateCreationFields ¶
func (c *GKECluster) ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error
ValidateCreationFields validates all field
type GKEClusterRepository ¶
type GKEClusterRepository interface { DeleteClusterModel(model *clustermodel.ClusterModel) error DeleteModel(model *google.GKEClusterModel) error DeleteNodePool(model *google.GKENodePoolModel) error SaveModel(model *google.GKEClusterModel) error SaveStatusHistory(model *clustermodel.StatusHistoryModel) error }
GKEClusterRepository describes a GKE cluster's persistent storage repository
func NewDBGKEClusterRepository ¶
func NewDBGKEClusterRepository(db *gorm.DB) (GKEClusterRepository, error)
NewDBGKEClusterRepository returns a new GKEClusterRepository backed by a GORM DB
type HelmService ¶
type HelmService interface { ApplyDeployment( ctx context.Context, clusterID uint, namespace string, chartName string, releaseName string, values []byte, chartVersion string, ) error ApplyDeploymentReuseValues( ctx context.Context, clusterID uint, namespace string, chartName string, releaseName string, values []byte, chartVersion string, reuseValues bool, ) error InstallDeployment( ctx context.Context, clusterID uint, namespace string, chartName string, releaseName string, values []byte, chartVersion string, wait bool, ) error // DeleteDeployment deletes a deployment from a specific cluster. DeleteDeployment(ctx context.Context, clusterID uint, releaseName, namespace string) error // GetDeployment gets a deployment by release name from a specific cluster. GetDeployment(ctx context.Context, clusterID uint, releaseName, namespace string) (*pkgHelm.GetDeploymentResponse, error) }
A generic interface for using Helm for hooks
type HelmServiceInjector ¶
type HelmServiceInjector interface {
InjectHelmService(HelmService)
}
type HookWithParamsFactory ¶
type HookWithParamsFactory interface {
Create(pkgCluster.PostHookParam) PostFunctioner
}
type InitSpotConfigPostHook ¶
type InitSpotConfigPostHook struct { Priority ErrorHandler // contains filtered or unexported fields }
func (*InitSpotConfigPostHook) Do ¶
func (ph *InitSpotConfigPostHook) Do(cluster CommonCluster) error
InitSpotConfig creates a ConfigMap to store spot related config and installs the scheduler and the spot webhook charts
func (*InitSpotConfigPostHook) InjectHelmService ¶
func (h *InitSpotConfigPostHook) InjectHelmService(helmService HelmService)
InjectHelmService injects the service to be used by the "parent" struct
type InstallSecretRequest ¶
type InstallSecretRequest struct { SourceSecretName string Namespace string Spec map[string]InstallSecretRequestSpecItem Update bool }
type K8sConfigDownloader ¶
K8sConfigDownloader can download a cluster config.
type KubeAPIProxy ¶
type KubeAPIProxy struct {
Handler gin.HandlerFunc
}
func NewKubeAPIProxy ¶
func NewKubeAPIProxy(requestSchema string, requestHost string, apiProxyPrefix string, cluster CommonCluster, keepalive time.Duration) (*KubeAPIProxy, error)
NewKubeAPIProxy creates a new Kubernetes API Server Proxy to the given cluster with a well-defined keep-alive timeout.
type KubeCluster ¶
type KubeCluster struct { APIEndpoint string CommonClusterBase // contains filtered or unexported fields }
KubeCluster struct for Build your own cluster
func CreateKubernetesClusterFromModel ¶
func CreateKubernetesClusterFromModel(clusterModel *model.ClusterModel) (*KubeCluster, error)
CreateKubernetesClusterFromModel converts ClusterModel to KubeCluster
func CreateKubernetesClusterFromRequest ¶
func CreateKubernetesClusterFromRequest(request *pkgCluster.CreateClusterRequest, orgId uint, userId uint) (*KubeCluster, error)
CreateKubernetesClusterFromRequest creates ClusterModel struct from the request
func (*KubeCluster) AddDefaultsToUpdate ¶
func (c *KubeCluster) AddDefaultsToUpdate(*pkgCluster.UpdateClusterRequest)
AddDefaultsToUpdate adds defaults to update request, in this case no update function
func (*KubeCluster) CheckEqualityToUpdate ¶
func (c *KubeCluster) CheckEqualityToUpdate(*pkgCluster.UpdateClusterRequest) error
CheckEqualityToUpdate validates the update request, in this case no update function
func (*KubeCluster) CreateCluster ¶
func (c *KubeCluster) CreateCluster() error
CreateCluster creates a new cluster
func (*KubeCluster) DeleteCluster ¶
func (c *KubeCluster) DeleteCluster() error
DeleteCluster deletes cluster from cloud, in this case no delete function
func (*KubeCluster) DeleteFromDatabase ¶
func (c *KubeCluster) DeleteFromDatabase() error
DeleteFromDatabase deletes model from the database
func (*KubeCluster) DownloadK8sConfig ¶
func (c *KubeCluster) DownloadK8sConfig() ([]byte, error)
DownloadK8sConfig downloads the kubeconfig file from cloud
func (*KubeCluster) GetAPIEndpoint ¶
func (c *KubeCluster) GetAPIEndpoint() (string, error)
GetAPIEndpoint returns the Kubernetes Api endpoint
func (*KubeCluster) GetCloud ¶
func (c *KubeCluster) GetCloud() string
GetCloud returns the cloud type of the cluster
func (*KubeCluster) GetConfigSecretId ¶
func (c *KubeCluster) GetConfigSecretId() string
GetConfigSecretId return config secret id
func (*KubeCluster) GetDistribution ¶
func (c *KubeCluster) GetDistribution() string
GetDistribution returns the distribution type of the cluster
func (*KubeCluster) GetID ¶
func (c *KubeCluster) GetID() uint
GetID returns the specified cluster id
func (*KubeCluster) GetK8sConfig ¶
func (c *KubeCluster) GetK8sConfig() ([]byte, error)
GetK8sConfig returns the Kubernetes config
func (*KubeCluster) GetK8sUserConfig ¶
func (c *KubeCluster) GetK8sUserConfig() ([]byte, error)
GetK8sUserConfig returns the Kubernetes config
func (*KubeCluster) GetLocation ¶
func (c *KubeCluster) GetLocation() string
GetLocation gets where the cluster is.
func (*KubeCluster) GetModel ¶
func (c *KubeCluster) GetModel() *model.ClusterModel
GetModel returns the whole clusterModel
func (*KubeCluster) GetName ¶
func (c *KubeCluster) GetName() string
GetName returns the name of the cluster
func (*KubeCluster) GetOrganizationId ¶
func (c *KubeCluster) GetOrganizationId() uint
GetOrganizationId returns the specified organization id
func (*KubeCluster) GetSecretId ¶
func (c *KubeCluster) GetSecretId() string
GetSecretId returns the specified secret id
func (*KubeCluster) GetSecretWithValidation ¶
func (c *KubeCluster) GetSecretWithValidation() (*secret.SecretItemResponse, error)
GetSecretWithValidation returns secret from vault
func (*KubeCluster) GetSshSecretId ¶
func (c *KubeCluster) GetSshSecretId() string
GetSshSecretId returns the specified ssh secret id
func (*KubeCluster) GetStatus ¶
func (c *KubeCluster) GetStatus() (*pkgCluster.GetClusterStatusResponse, error)
GetStatus gets cluster status
func (*KubeCluster) GetUID ¶
func (c *KubeCluster) GetUID() string
func (*KubeCluster) IsReady ¶
func (c *KubeCluster) IsReady() (bool, error)
IsReady checks if the cluster is running according to the cloud provider.
func (*KubeCluster) NodePoolExists ¶
func (c *KubeCluster) NodePoolExists(nodePoolName string) bool
NodePoolExists returns true if node pool with nodePoolName exists
func (*KubeCluster) Persist ¶
func (c *KubeCluster) Persist() error
Persist save the cluster model Deprecated: Do not use.
func (*KubeCluster) RbacEnabled ¶
func (c *KubeCluster) RbacEnabled() bool
RbacEnabled returns true if rbac enabled on the cluster
func (*KubeCluster) SaveConfigSecretId ¶
func (c *KubeCluster) SaveConfigSecretId(configSecretId string) error
SaveConfigSecretId saves the config secret id in database
func (*KubeCluster) SaveSshSecretId ¶
func (c *KubeCluster) SaveSshSecretId(sshSecretId string) error
SaveSshSecretId saves the ssh secret id to database
func (*KubeCluster) SetStatus ¶
func (c *KubeCluster) SetStatus(status, statusMessage string) error
SetStatus sets the cluster's status
func (*KubeCluster) UpdateCluster ¶
func (c *KubeCluster) UpdateCluster(updateRequest *pkgCluster.UpdateClusterRequest, _ uint) error
UpdateCluster updates cluster in cloud, in this case no update function
func (*KubeCluster) UpdateNodePools ¶
func (c *KubeCluster) UpdateNodePools(request *pkgCluster.UpdateNodePoolsRequest, userId uint) error
UpdateNodePools updates nodes pools of a cluster
func (*KubeCluster) ValidateCreationFields ¶
func (c *KubeCluster) ValidateCreationFields(r *pkgCluster.CreateClusterRequest) error
ValidateCreationFields validates all field
type KubeProxyCache ¶
type KubeProxyCache interface { Get(clusterUID string) (*KubeAPIProxy, bool) Put(clusterUID string, proxy *KubeAPIProxy) Delete(clusterUID string) }
type KubernetesDashboardPostHook ¶
type KubernetesDashboardPostHook struct { Priority ErrorHandler // contains filtered or unexported fields }
func (*KubernetesDashboardPostHook) Do ¶
func (ph *KubernetesDashboardPostHook) Do(cluster CommonCluster) error
func (*KubernetesDashboardPostHook) InjectHelmService ¶
func (h *KubernetesDashboardPostHook) InjectHelmService(helmService HelmService)
InjectHelmService injects the service to be used by the "parent" struct
type LabelNodesWithNodepoolNameActivity ¶
type LabelNodesWithNodepoolNameActivity struct {
// contains filtered or unexported fields
}
func NewLabelNodesWithNodepoolNameActivity ¶
func NewLabelNodesWithNodepoolNameActivity(clientFactory ClientFactory, manager *Manager) LabelNodesWithNodepoolNameActivity
func (LabelNodesWithNodepoolNameActivity) Execute ¶
func (a LabelNodesWithNodepoolNameActivity) Execute(ctx context.Context, input LabelNodesWithNodepoolNameActivityInput) error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager( clusters clusterRepository, secrets secretValidator, events clusterEvents, statusChangeDurationMetric metrics.ClusterStatusChangeDurationMetric, clusterTotalMetric *prometheus.CounterVec, workflowClient client.Client, logger logrus.FieldLogger, errorHandler emperror.Handler, clusterStore interface { SetStatus(ctx context.Context, id uint, status, message string) error }, releaseDeleter interface { DeleteReleases(ctx context.Context, orgID uint, kubeConfig []byte, namespaces []string) error }, ) *Manager
func (*Manager) CreateCluster ¶
func (m *Manager) CreateCluster( ctx context.Context, creationCtx CreationContext, creator clusterCreator, ) (CommonCluster, error)
CreateCluster creates a new cluster in the background.
func (*Manager) DeleteCluster ¶
DeleteCluster deletes a cluster.
func (*Manager) DeleteKubeProxy ¶
func (m *Manager) DeleteKubeProxy(commonCluster CommonCluster)
func (*Manager) GetAllClusters ¶
func (m *Manager) GetAllClusters(ctx context.Context) ([]CommonCluster, error)
GetAllClusters returns all cluster instances.
func (*Manager) GetClusterByID ¶
func (m *Manager) GetClusterByID(ctx context.Context, organizationID uint, clusterID uint) (CommonCluster, error)
GetClusterByID returns the cluster instance for an organization ID by cluster ID.
func (*Manager) GetClusterByIDOnly ¶
GetClusterByIDOnly returns the cluster instance by cluster ID.
func (*Manager) GetClusterByName ¶
func (m *Manager) GetClusterByName(ctx context.Context, organizationID uint, clusterName string) (CommonCluster, error)
GetClusterByName returns the cluster instance for an organization ID by cluster name.
func (*Manager) GetClusterStatus ¶
GetClusterStatus returns the status of the cluster with the specified ID
func (*Manager) GetClusters ¶
GetClusters returns the cluster instances for an organization ID.
func (*Manager) GetClustersBySecretID ¶
func (m *Manager) GetClustersBySecretID(ctx context.Context, organizationID uint, secretID string) ([]CommonCluster, error)
GetClustersBySecretID returns the cluster instance for an organization ID by secret ID.
func (*Manager) GetKubeProxy ¶
func (m *Manager) GetKubeProxy(requestSchema string, requestHost string, apiProxyPrefix string, commonCluster CommonCluster) (*KubeAPIProxy, error)
func (*Manager) GetKubeProxyCache ¶
func (m *Manager) GetKubeProxyCache() KubeProxyCache
func (*Manager) KubeConfigFunc ¶
func (*Manager) UpdateCluster ¶
func (m *Manager) UpdateCluster(ctx context.Context, updateCtx UpdateContext, updater clusterUpdater) error
UpdateCluster updates a cluster.
type NodePoolLabels ¶
type NodePoolLabels struct { NodePoolName string Existing bool InstanceType string `json:"instanceType,omitempty"` SpotPrice string `json:"spotPrice,omitempty"` Preemptible bool `json:"preemptible,omitempty"` CustomLabels map[string]string `json:"labels,omitempty"` }
func (NodePoolLabels) GetInstanceType ¶
func (n NodePoolLabels) GetInstanceType() string
GetInstanceType returns the node pool instance type.
func (NodePoolLabels) GetLabels ¶
func (n NodePoolLabels) GetLabels() map[string]string
GetLabels returns labels that are/should be applied to every node in the pool.
func (NodePoolLabels) GetName ¶
func (n NodePoolLabels) GetName() string
GetName returns the node pool name.
func (NodePoolLabels) IsOnDemand ¶
func (n NodePoolLabels) IsOnDemand() bool
IsOnDemand determines whether the machines in the node pool are on demand or spot/preemtible instances.
type PKENodePool ¶
type PostFunctioner ¶
type PostFunctioner interface { Do(CommonCluster) error GetPriority() int Error(CommonCluster, error) }
PostFunctioner manages posthook functions
type Priority ¶
type Priority struct {
// contains filtered or unexported fields
}
Priority can be used to run post hooks in a specific order
func (*Priority) GetPriority ¶
Priority returns the priority value of a posthook - the lower the value, the sooner the posthook will run
type RunPostHookActivity ¶
type RunPostHookActivity struct {
// contains filtered or unexported fields
}
func NewRunPostHookActivity ¶
func NewRunPostHookActivity(manager *Manager, helmService HelmService) *RunPostHookActivity
func (*RunPostHookActivity) Execute ¶
func (a *RunPostHookActivity) Execute(ctx context.Context, input RunPostHookActivityInput) error
type RunPostHooksWorkflowInput ¶
type RunPostHooksWorkflowInput struct { ClusterID uint PostHooks []RunPostHooksWorkflowInputPostHook }
type RunPostHooksWorkflowInputPostHook ¶
type RunPostHooksWorkflowInputPostHook struct { Name string Param interface{} }
func BuildWorkflowPostHookFunctions ¶
func BuildWorkflowPostHookFunctions(postHooks pkgCluster.PostHooks, alwaysIncludeBasePostHooks bool) []RunPostHooksWorkflowInputPostHook
BuildWorkflowPostHookFunctions builds posthook workflow input.
type TokenGenerator ¶
type UpdateClusterStatusActivity ¶
type UpdateClusterStatusActivity struct {
// contains filtered or unexported fields
}
func NewUpdateClusterStatusActivity ¶
func NewUpdateClusterStatusActivity(manager *Manager) *UpdateClusterStatusActivity
func (*UpdateClusterStatusActivity) Execute ¶
func (a *UpdateClusterStatusActivity) Execute(ctx context.Context, input UpdateClusterStatusActivityInput) error
type UpdateContext ¶
UpdateContext represents the data necessary to do generic cluster update steps/checks.
Source Files ¶
- aks.go
- cluster_workflow.go
- common.go
- create_workflow.go
- ec2_pke.go
- eks.go
- eks_create_cluster.go
- eks_delete_cluster.go
- eks_update_cluster.go
- error.go
- error_handler.go
- events.go
- gke.go
- gke_node_pools.go
- gke_operations.go
- gke_operations_compute_global.go
- gke_operations_compute_region.go
- gke_operations_container.go
- gke_resource.go
- gke_resource_firewall.go
- gke_resource_forwarding_rules.go
- gke_resource_loadbalancer.go
- gke_resource_target_pools.go
- hook_workflow.go
- hookfunctions.go
- hooks.go
- kubernetes.go
- log.go
- manager.go
- manager_common_creator.go
- manager_common_nodepool_updater.go
- manager_common_updater.go
- manager_create.go
- manager_delete.go
- manager_get.go
- manager_update.go
- middleware.go
- nodelabels.go
- pipeline_monitoring.go
- proxy.go
- secrets.go
- utils.go