migrator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterAppVersion  = "0.60.0"
	ClusterAppCatalog  = "cluster"
	DefaultAppsVersion = "0.45.1"
	DefaultAppsCatalog = "cluster"

	DefaultAppsAWSRepoName = "default-apps-aws"
	ClusterAWSRepoName     = "cluster-aws"

	SecretKindLoverCase    = "secret"
	SecretKindUpperCase    = "Secret"
	ConfigMapKindLoverCase = "configmap"
	ConfigMapKindUpperCase = "ConfigMap"
)
View Source
const (
	AWSOperatorVersionLabel = "aws-operator.giantswarm.io/version"
	ChartOperatorPaused     = "chart-operator.giantswarm.io/paused"
)

Variables

View Source
var ClusterAWSDefaultAppList = []string{"cilium", "aws-ebs-csi-driver", "aws-cloud-controller-manager", "coredns"}
View Source
var DefaultAppsAWSAppList = []string{"aws-pod-identity-webhook", "cert-exporter", "cert-manager", "cluster-autoscaler", "external-dns", "metrics-server", "net-exporter", "node-exporter", "vertical-pod-autoscaler"}

Functions

func IsExecutionFailed

func IsExecutionFailed(err error) bool

IsExecutionFailed asserts executionFailedError.

func IsInvalidCredentialSecretError

func IsInvalidCredentialSecretError(err error) bool

IsInvalidCredentialSecretError asserts invalidCredentialSecretError.

func Migrate

func Migrate(ctx context.Context, c cluster.Config, f flags.Flags) error

Types

type API

type API struct {
	ClusterIPRange string `yaml:"clusterIPRange"`
}

type App

type App struct {
	ExtraConfigs []ExtraConfig `yaml:"extraConfigs,omitempty"`
}

type AppExtraConfig

type AppExtraConfig struct {
	AwsPodIdentityWebhook App `yaml:"aws-pod-identity-webhook,omitempty"`
	CertExporter          App `yaml:"certExporter,omitempty"`
	CertManager           App `yaml:"certManager,omitempty"`
	ClusterAutoscaler     App `yaml:"cluster-autoscaler,omitempty"`
	ExternalDns           App `yaml:"externalDns,omitempty"`
	MetricsServer         App `yaml:"metricsServer,omitempty"`
	NetExporter           App `yaml:"netExporter,omitempty"`
	NodeExporter          App `yaml:"nodeExporter,omitempty"`
	VPA                   App `yaml:"vpa,omitempty"`
}

type AppInfo

type AppInfo struct {
	ClusterAppVersion  string
	ClusterAppCatalog  string
	DefaultAppsVersion string
	DefaultAppsCatalog string
}

type Apps

type Apps struct {
	AwsCloudControllerManager App `yaml:"awsCloudControllerManager,omitempty"`
	AwsEbsCsiDriver           App `yaml:"awsEbsCsiDriver,omitempty"`
	Cilium                    App `yaml:"cilium,omitempty"`
	CoreDNS                   App `yaml:"coreDns,omitempty"`
}

type Cluster

type Cluster struct {
	Kubernetes Kubernetes `yaml:"kubernetes"`
}

type ClusterAppValuesData

type ClusterAppValuesData struct {
	Global   Global   `yaml:"global"`
	Internal Internal `yaml:"internal"`
}

type Config

type Config struct {
	Config         *cluster.Cluster
	WorkerBachSize int
}

type ConfigService

type ConfigService struct {
	Cluster Cluster `yaml:"cluster"`
}

type Connectivity

type Connectivity struct {
	Network Network  `yaml:"network"`
	Subnets []Subnet `yaml:"subnets"`
}

type ContentFrom

type ContentFrom struct {
	Secret Secret `yaml:"secret"`
}

type ControlPlane

type ControlPlane struct {
	AdditionalSecurityGroups []SecurityGroup     `yaml:"additionalSecurityGroups"`
	ApiExtraArgs             map[string]string   `yaml:"apiExtraArgs"`
	ApiExtraCertSans         []string            `yaml:"apiExtraCertSANs"`
	InstanceType             string              `yaml:"instanceType"`
	SubnetTags               []map[string]string `yaml:"subnetTags"`
}

type DefaultAppsConfig

type DefaultAppsConfig struct {
	ClusterName  string         `yaml:"clusterName,omitempty"`
	Organization string         `yaml:"organization,omitempty"`
	Apps         AppExtraConfig `yaml:"apps,omitempty"`
}

type ExtraConfig

type ExtraConfig struct {
	Name      string `yaml:"name"`
	Namespace string `yaml:"namespace,omitempty"`
	Kind      string `yaml:"kind"`
}

type File

type File struct {
	ContentFrom ContentFrom `yaml:"contentFrom"`
	Path        string      `yaml:"path"`
	Permissions string      `yaml:"permissions"`
}

type Global

type Global struct {
	Metadata Metadata `yaml:"metadata"`

	Apps             Apps                `yaml:"apps,omitempty"`
	ControlPlane     ControlPlane        `yaml:"controlPlane"`
	Connectivity     Connectivity        `yaml:"connectivity"`
	NodePools        map[string]NodePool `yaml:"nodePools"`
	ProviderSpecific ProviderSpecific    `yaml:"providerSpecific"`
}

type Internal

type Internal struct {
	CGroupsv1 bool      `yaml:"cgroupsv1"`
	Migration Migration `yaml:"migration"`
}

type Kubernetes

type Kubernetes struct {
	API API `yaml:"api"`
}

type Metadata

type Metadata struct {
	Name            string `yaml:"name"`
	Description     string `yaml:"description"`
	Organization    string `yaml:"organization"`
	ServicePriority string `yaml:"servicePriority"`
}

type Migration

type Migration struct {
	ApiBindPort                     int               `yaml:"apiBindPort"`
	ControlPlaneExtraFiles          []File            `yaml:"controlPlaneExtraFiles"`
	ControlPlanePreKubeadmCommands  []string          `yaml:"controlPlanePreKubeadmCommands"`
	ControlPlanePostKubeadmCommands []string          `yaml:"controlPlanePostKubeadmCommands"`
	EtcdExtraArgs                   map[string]string `yaml:"etcdExtraArgs"`
	IrsaAdditionalDomain            string            `yaml:"irsaAdditionalDomain"`
}

type Network

type Network struct {
	Pods              Pods     `yaml:"pods"`
	Services          Services `yaml:"services"`
	VPCID             string   `yaml:"vpcId"`
	InternetGatewayID string   `yaml:"internetGatewayId"`
}

type NodePool

type NodePool struct {
	AdditionalSecurityGroups []SecurityGroup     `yaml:"additionalSecurityGroups"`
	AvailabilityZones        []string            `yaml:"availabilityZones"`
	InstanceType             string              `yaml:"instanceType"`
	MinSize                  int                 `yaml:"minSize"`
	MaxSize                  int                 `yaml:"maxSize"`
	RootVolumeSizeGB         int                 `yaml:"rootVolumeSizeGB"`
	SubnetTags               []map[string]string `yaml:"subnetTags"`
	CustomNodeLabel          []string            `yaml:"customNodeLabel"`
}

type Pods

type Pods struct {
	CidrBlocks []string `yaml:"cidrBlocks"`
}

type ProviderSpecific

type ProviderSpecific struct {
	AwsClusterRoleIdentityName string `yaml:"awsClusterRoleIdentityName"`
	Region                     string `yaml:"region"`
}

type Secret

type Secret struct {
	Name string `yaml:"name"`
	Key  string `yaml:"key"`
}

type SecurityGroup

type SecurityGroup struct {
	ID string `yaml:"id"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(c Config) (*Service, error)

func (*Service) CleanVintageCluster

func (s *Service) CleanVintageCluster(ctx context.Context) error

CleanVintageCluster drains all vintage nodes and deletes the ASGs

func (*Service) CreateAWSClients

func (s *Service) CreateAWSClients(awsSession *session.Session)

func (*Service) GenerateCAPIClusterTemplates

func (s *Service) GenerateCAPIClusterTemplates(ctx context.Context) error

func (*Service) PrepareMigration

func (s *Service) PrepareMigration(ctx context.Context) error

func (*Service) ProvisionCAPICluster

func (s *Service) ProvisionCAPICluster(ctx context.Context) error

func (*Service) StopVintageReconciliation

func (s *Service) StopVintageReconciliation(ctx context.Context) error

type Services

type Services struct {
	CidrBlocks []string `yaml:"cidrBlocks"`
}

type Subnet

type Subnet struct {
	ID           string `yaml:"id"`
	IsPublic     bool   `yaml:"isPublic"`
	RouteTableID string `yaml:"routeTableId"`
	NatGatewayID string `yaml:"natGatewayId,omitempty"`
}

type VintageCRs

type VintageCRs struct {
	AwsCluster            *giantswarmawsalpha3.AWSCluster
	AwsControlPlane       *giantswarmawsalpha3.AWSControlPlane
	AwsMachineDeployments []giantswarmawsalpha3.AWSMachineDeployment

	Cluster            *capi.Cluster
	MachineDeployments []capi.MachineDeployment
}

Jump to

Keyboard shortcuts

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