diff --git a/config/config.go b/config/config.go index eca52ad..6a501f0 100644 --- a/config/config.go +++ b/config/config.go @@ -216,8 +216,6 @@ func (c *Config) Distro() string { return K0SDistro } else if c.ControlPlane.Distro.K8S.Enabled { return K8SDistro - } else if c.ControlPlane.Distro.EKS.Enabled { - return EKSDistro } return K8SDistro @@ -259,7 +257,7 @@ func (c *Config) IsProFeatureEnabled() bool { return true } - if c.Distro() == K8SDistro || c.Distro() == EKSDistro { + if c.Distro() == K8SDistro { if c.ControlPlane.BackingStore.Database.External.Enabled { return true } @@ -754,9 +752,6 @@ type Distro struct { // K0S holds k0s relevant configuration. K0S DistroK0s `json:"k0s,omitempty"` - - // EKS holds eks relevant configuration. - EKS DistroK8s `json:"eks,omitempty"` } type DistroK3s struct { diff --git a/config/default_extra_values.go b/config/default_extra_values.go index aaece02..6770cb3 100644 --- a/config/default_extra_values.go +++ b/config/default_extra_values.go @@ -11,7 +11,6 @@ const ( K3SDistro = "k3s" K8SDistro = "k8s" K0SDistro = "k0s" - EKSDistro = "eks" Unknown = "unknown" ) @@ -72,30 +71,6 @@ var K8SEtcdVersionMap = map[string]string{ "1.27": "registry.k8s.io/etcd:3.5.7-0", } -// EKSAPIVersionMap holds the supported eks api servers -var EKSAPIVersionMap = map[string]string{ - "1.28": "public.ecr.aws/eks-distro/kubernetes/kube-apiserver:v1.28.2-eks-1-28-6", - "1.27": "public.ecr.aws/eks-distro/kubernetes/kube-apiserver:v1.27.6-eks-1-27-13", - "1.26": "public.ecr.aws/eks-distro/kubernetes/kube-apiserver:v1.26.9-eks-1-26-19", - "1.25": "public.ecr.aws/eks-distro/kubernetes/kube-apiserver:v1.25.14-eks-1-25-23", -} - -// EKSControllerVersionMap holds the supported eks controller managers -var EKSControllerVersionMap = map[string]string{ - "1.28": "public.ecr.aws/eks-distro/kubernetes/kube-controller-manager:v1.28.2-eks-1-28-6", - "1.27": "public.ecr.aws/eks-distro/kubernetes/kube-controller-manager:v1.27.6-eks-1-27-13", - "1.26": "public.ecr.aws/eks-distro/kubernetes/kube-controller-manager:v1.26.9-eks-1-26-19", - "1.25": "public.ecr.aws/eks-distro/kubernetes/kube-controller-manager:v1.25.14-eks-1-25-23", -} - -// EKSSchedulerVersionMap holds the supported eks controller managers -var EKSSchedulerVersionMap = map[string]string{ - "1.28": "public.ecr.aws/eks-distro/kubernetes/kube-scheduler:v1.28.2-eks-1-28-6", - "1.27": "public.ecr.aws/eks-distro/kubernetes/kube-scheduler:v1.27.6-eks-1-27-13", - "1.26": "public.ecr.aws/eks-distro/kubernetes/kube-scheduler:v1.26.9-eks-1-26-19", - "1.25": "public.ecr.aws/eks-distro/kubernetes/kube-scheduler:v1.25.14-eks-1-25-23", -} - // ExtraValuesOptions holds the chart options type ExtraValuesOptions struct { Distro string @@ -155,12 +130,6 @@ func getExtraValues(options *ExtraValuesOptions) (*Config, error) { return nil, err } - // apply eks values - err = applyEKSExtraValues(vConfig, options) - if err != nil { - return nil, err - } - // add common release values addCommonReleaseValues(vConfig, options) return vConfig, nil @@ -198,39 +167,6 @@ func applyK0SExtraValues(vConfig *Config, options *ExtraValuesOptions) error { return nil } -func applyEKSExtraValues(vConfig *Config, options *ExtraValuesOptions) error { - // get api server image - apiImage, err := getImageByVersion(options.KubernetesVersion, EKSAPIVersionMap) - if err != nil { - return err - } - - // get controller image - controllerImage, err := getImageByVersion(options.KubernetesVersion, EKSControllerVersionMap) - if err != nil { - return err - } - - // get scheduler image - schedulerImage, err := getImageByVersion(options.KubernetesVersion, EKSSchedulerVersionMap) - if err != nil { - return err - } - - // build values - if apiImage != "" { - vConfig.ControlPlane.Distro.EKS.APIServer.Image = parseImage(apiImage) - } - if controllerImage != "" { - vConfig.ControlPlane.Distro.EKS.ControllerManager.Image = parseImage(controllerImage) - } - if schedulerImage != "" { - vConfig.ControlPlane.Distro.EKS.Scheduler.Image = parseImage(schedulerImage) - } - - return nil -} - func applyK8SExtraValues(vConfig *Config, options *ExtraValuesOptions) error { // get api server image apiImage, err := getImageByVersion(options.KubernetesVersion, K8SAPIVersionMap) @@ -386,8 +322,6 @@ func addCommonReleaseValues(config *Config, options *ExtraValuesOptions) { config.ControlPlane.Distro.K3S.Enabled = true case K0SDistro: config.ControlPlane.Distro.K0S.Enabled = true - case EKSDistro: - config.ControlPlane.Distro.EKS.Enabled = true case K8SDistro: } } diff --git a/config/legacyconfig/migrate.go b/config/legacyconfig/migrate.go index 3ed590e..3680cc8 100644 --- a/config/legacyconfig/migrate.go +++ b/config/legacyconfig/migrate.go @@ -26,12 +26,16 @@ func MigrateLegacyConfig(distro, oldValues string) (string, error) { if err != nil { return "", fmt.Errorf("migrate legacy %s values: %w", distro, err) } - case config.K8SDistro, config.EKSDistro: + case config.K8SDistro: err = migrateK8sAndEKS(distro, oldValues, toConfig) if err != nil { return "", fmt.Errorf("migrate legacy %s values: %w", distro, err) } default: + if distro == "eks" { + return "", fmt.Errorf("eks distro is not supported anymore. Instead use the k8s distro with the eks images") + } + return "", fmt.Errorf("migrating distro %s is not supported", distro) } @@ -52,11 +56,6 @@ func migrateK8sAndEKS(distro, oldValues string, newConfig *config.Config) error convertAPIValues(oldConfig.API, &newConfig.ControlPlane.Distro.K8S.APIServer) convertControllerValues(oldConfig.Controller, &newConfig.ControlPlane.Distro.K8S.ControllerManager) convertSchedulerValues(oldConfig.Scheduler, &newConfig.ControlPlane.Distro.K8S.Scheduler) - } else if distro == config.EKSDistro { - newConfig.ControlPlane.Distro.EKS.Enabled = true - convertAPIValues(oldConfig.API, &newConfig.ControlPlane.Distro.EKS.APIServer) - convertControllerValues(oldConfig.Controller, &newConfig.ControlPlane.Distro.EKS.ControllerManager) - convertSchedulerValues(oldConfig.Scheduler, &newConfig.ControlPlane.Distro.EKS.Scheduler) } // convert etcd diff --git a/config/legacyconfig/migrate_test.go b/config/legacyconfig/migrate_test.go index 774db9e..ef5b152 100644 --- a/config/legacyconfig/migrate_test.go +++ b/config/legacyconfig/migrate_test.go @@ -89,31 +89,6 @@ plugin: statefulSet: scheduling: podManagementPolicy: OrderedReady -sync: - fromHost: - ingressClasses: - enabled: true - toHost: - ingresses: - enabled: true`, - }, - { - Name: "Simple eks", - Distro: "eks", - In: `sync: - ingresses: - enabled: true`, - Expected: `controlPlane: - backingStore: - etcd: - deploy: - enabled: true - distro: - eks: - enabled: true - statefulSet: - scheduling: - podManagementPolicy: OrderedReady sync: fromHost: ingressClasses: @@ -395,9 +370,9 @@ syncer: { Name: "binariesVolume", Distro: "k3s", - In: `syncer: - storage: - binariesVolume: + In: `syncer: + storage: + binariesVolume: - name: binaries persistentVolumeClaim: claimName: my-pvc`, diff --git a/config/values.yaml b/config/values.yaml index fa68ee3..f80b290 100644 --- a/config/values.yaml +++ b/config/values.yaml @@ -98,7 +98,7 @@ controlPlane: image: registry: registry.k8s.io repository: "kube-scheduler" - tag: "v1.29.0" + tag: "v1.30.2" env: [] securityContext: {} resources: @@ -146,44 +146,6 @@ controlPlane: cpu: 40m memory: 64Mi - eks: - enabled: false - apiServer: - enabled: true - command: [] - extraArgs: [] - imagePullPolicy: "" - image: - registry: "public.ecr.aws" - repository: "eks-distro/kubernetes/kube-apiserver" - tag: "v1.28.2-eks-1-28-6" - controllerManager: - enabled: true - command: [] - extraArgs: [] - imagePullPolicy: "" - image: - registry: "public.ecr.aws" - repository: "eks-distro/kubernetes/kube-controller-manager" - tag: "v1.28.2-eks-1-28-6" - scheduler: - command: [] - extraArgs: [] - imagePullPolicy: "" - image: - registry: "public.ecr.aws" - repository: "eks-distro/kubernetes/kube-scheduler" - tag: "v1.28.2-eks-1-28-6" - env: [] - securityContext: {} - resources: - limits: - cpu: 100m - memory: 256Mi - requests: - cpu: 40m - memory: 64Mi - backingStore: database: embedded: diff --git a/values.schema.json b/values.schema.json index 98c8b50..1c14d6c 100755 --- a/values.schema.json +++ b/values.schema.json @@ -741,10 +741,6 @@ "k0s": { "$ref": "#/$defs/DistroK0s", "description": "K0S holds k0s relevant configuration." - }, - "eks": { - "$ref": "#/$defs/DistroK8s", - "description": "EKS holds eks relevant configuration." } }, "additionalProperties": false,