Documentation ¶
Index ¶
Constants ¶
View Source
const KubeconfigOutputKey = "kubeconfig-file"
Variables ¶
View Source
var PlatformAdapters = map[Platform]func(*models.K8sProvisionerSpec, string) K8sClusterAdapter{ PlatformGCP: func(spec *models.K8sProvisionerSpec, workdir string) K8sClusterAdapter { support := gcpsupport.NewKopsSupport(gcpsupport.KopsSupportConfig{ ProjectID: spec.Project, ServiceAccountFileBase64: spec.Credentials.GCPServiceAccountFile, StateStoreName: spec.StateStoreName, WorkDir: workdir, }) return cloud.NewK8sClusterAdapter(spec, support, workdir) }, PlatformAWS: func(spec *models.K8sProvisionerSpec, workdir string) K8sClusterAdapter { support := awssupport.NewKopsSupport(awssupport.KopsSupportConfig{ AccessKeyID: spec.Credentials.AWSAccessKeyID, SecretAccessKey: spec.Credentials.AWSSecretAccessKey, StateStoreName: spec.StateStoreName, Region: spec.Region, SSHPublicKey: spec.Credentials.SSHPublicKey, WorkDir: workdir, }) return cloud.NewK8sClusterAdapter(spec, support, workdir) }, }
View Source
var PlatformMapping = map[string]Platform{ "gcp": PlatformGCP, "aws": PlatformAWS, }
Functions ¶
func NewK8sClusterManager ¶
func NewK8sClusterManager(cfg K8sClusterManagerConfig, adapter K8sClusterAdapter) *k8sClusterManager
NewK8sClusterManager returns a new k8sClusterManager instance. Takes a spec and a platform adapter and synchronize makes relevant synchronization calls to the adapter.
Types ¶
type K8sClusterAdapter ¶
type K8sClusterManager ¶
type K8sClusterManager interface { Synchronize(context.Context) (*models.K8sCluster, errors.Error) SaveKubeconfig(context.Context) errors.Error }
func NewK8sClusterManagerFromSpec ¶
func NewK8sClusterManagerFromSpec(cfg K8sClusterManagerConfig) (K8sClusterManager, errors.Error)
type K8sClusterManagerConfig ¶
type K8sClusterManagerConfig struct { Spec *models.K8sProvisionerSpec Workdir string OutputsClient outputs.OutputsClient }
Click to show internal directories.
Click to hide internal directories.