Kubernetes 1.25 preview

Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
Malte Poll 2022-09-02 14:05:44 +02:00 committed by Malte Poll
parent 571b4ff36f
commit c38a142d64
2 changed files with 36 additions and 0 deletions

View File

@ -37,6 +37,7 @@ import (
"github.com/edgelesssys/constellation/internal/license"
"github.com/edgelesssys/constellation/internal/retry"
"github.com/edgelesssys/constellation/internal/state"
"github.com/edgelesssys/constellation/internal/versions"
kms "github.com/edgelesssys/constellation/kms/setup"
"github.com/spf13/afero"
"github.com/spf13/cobra"
@ -93,6 +94,14 @@ func initialize(cmd *cobra.Command, newDialer func(validator *cloudcmd.Validator
return fmt.Errorf("reading and validating config: %w", err)
}
k8sVersion, err := versions.NewValidK8sVersion(config.KubernetesVersion)
if err != nil {
return fmt.Errorf("validating kubernetes version: %w", err)
}
if versions.IsPreviewK8sVersion(k8sVersion) {
cmd.Printf("Warning: Constellation with Kubernetes %v is still in preview. Use only for evaluation purposes.\n", k8sVersion)
}
checker := license.NewChecker(quotaChecker, fileHandler)
if err := checker.CheckLicense(cmd.Context(), cmd.Printf); err != nil {
cmd.Printf("License check failed: %v", err)

View File

@ -28,11 +28,18 @@ func IsSupportedK8sVersion(version string) bool {
return true
case string(V1_24):
return true
case string(V1_25):
return true
default:
return false
}
}
// IsPreviewK8sVersion checks if a given Kubernetes version is still in preview and not fully supported.
func IsPreviewK8sVersion(version ValidK8sVersion) bool {
return version == V1_25
}
const (
// Constellation images.
// These images are built in a way that they support all versions currently listed in VersionConfigs.
@ -52,6 +59,7 @@ const (
V1_22 ValidK8sVersion = "1.22"
V1_23 ValidK8sVersion = "1.23"
V1_24 ValidK8sVersion = "1.24"
V1_25 ValidK8sVersion = "1.25"
Default ValidK8sVersion = V1_23
)
@ -114,6 +122,25 @@ var VersionConfigs map[ValidK8sVersion]KubernetesVersion = map[ValidK8sVersion]K
// External service image. Depends on k8s version.
ClusterAutoscalerImage: "k8s.gcr.io/autoscaling/cluster-autoscaler:v1.23.1",
},
V1_25: {
PatchVersion: "1.25.0",
CNIPluginsURL: "https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz",
CrictlURL: "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.25.0/crictl-v1.25.0-linux-amd64.tar.gz",
KubeletServiceURL: "https://raw.githubusercontent.com/kubernetes/release/v0.13.0/cmd/kubepkg/templates/latest/deb/kubelet/lib/systemd/system/kubelet.service",
KubeadmConfURL: "https://raw.githubusercontent.com/kubernetes/release/v0.13.0/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf",
KubeletURL: "https://storage.googleapis.com/kubernetes-release/release/v1.25.0/bin/linux/amd64/kubelet",
KubeadmURL: "https://storage.googleapis.com/kubernetes-release/release/v1.25.0/bin/linux/amd64/kubeadm",
KubectlURL: "https://storage.googleapis.com/kubernetes-release/release/v1.25.0/bin/linux/amd64/kubectl",
// CloudControllerManagerImageGCP is the CCM image used on GCP.
// TODO: use newer "cloud-provider-gcp" from https://github.com/kubernetes/cloud-provider-gcp when newer releases are available.
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v24",
// CloudControllerManagerImageAzure is the CCM image used on Azure.
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.24.4",
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.24.4",
// External service image. Depends on k8s version.
ClusterAutoscalerImage: "k8s.gcr.io/autoscaling/cluster-autoscaler:v1.23.1",
},
}
// KubernetesVersion bundles download URLs to all version-releated binaries necessary for installing/deploying a particular Kubernetes version.