AB#2077: Kubernetes 1.22.12 support (#302)

* Necessary changes to build join-service image
* Reference new join-service image

Tested on GCP and Azure using microservice-demo.
This commit is contained in:
Otto Bittner 2022-07-27 13:38:14 +02:00 committed by GitHub
parent 83d2c7b6a3
commit 44b5e042ea
3 changed files with 37 additions and 15 deletions

View File

@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Kubernetes version is configured through an entry in `constellation-config.yaml`. - Kubernetes version is configured through an entry in `constellation-config.yaml`.
- Kubernetes version 1.24 is now supported. - Kubernetes version 1.24 is now supported.
- Kubernetes version 1.22 is now supported.
### Changed ### Changed

View File

@ -66,7 +66,7 @@ func TestInitConfigurationKubeadmCompatibility(t *testing.T) {
expectedVersion: fmt.Sprintf("v%s", versions.VersionConfigs[versions.Latest].PatchVersion), expectedVersion: fmt.Sprintf("v%s", versions.VersionConfigs[versions.Latest].PatchVersion),
}, },
"Kubeadm receives incompatible version": { "Kubeadm receives incompatible version": {
config: coreOSConfig.InitConfiguration(true, "1.22"), config: coreOSConfig.InitConfiguration(true, "1.19"),
wantErr: true, wantErr: true,
}, },
} }

View File

@ -16,6 +16,8 @@ func NewValidK8sVersion(k8sVersion string) (ValidK8sVersion, error) {
// IsSupportedK8sVersion checks if a given Kubernetes version is supported by Constellation. // IsSupportedK8sVersion checks if a given Kubernetes version is supported by Constellation.
func IsSupportedK8sVersion(version string) bool { func IsSupportedK8sVersion(version string) bool {
switch version { switch version {
case string(V1_22):
return true
case string(V1_23): case string(V1_23):
return true return true
case string(V1_24): case string(V1_24):
@ -28,13 +30,14 @@ func IsSupportedK8sVersion(version string) bool {
const ( const (
// Constellation images. // Constellation images.
// These images are built in a way that they support all versions currently listed in VersionConfigs. // These images are built in a way that they support all versions currently listed in VersionConfigs.
JoinImage = "ghcr.io/edgelesssys/constellation/join-service:v1.3.2-0.20220725100031-c1d912ca" JoinImage = "ghcr.io/edgelesssys/constellation/join-service:v1.3.2-0.20220725190044-ba09c9c6"
AccessManagerImage = "ghcr.io/edgelesssys/constellation/access-manager:v1.3.2-0.20220714151638-d295be31" AccessManagerImage = "ghcr.io/edgelesssys/constellation/access-manager:v1.3.2-0.20220714151638-d295be31"
KmsImage = "ghcr.io/edgelesssys/constellation/kmsserver:v1.3.2-0.20220722135959-3e250b12" KmsImage = "ghcr.io/edgelesssys/constellation/kmsserver:v1.3.2-0.20220722135959-3e250b12"
VerificationImage = "ghcr.io/edgelesssys/constellation/verification-service:v1.3.2-0.20220714151638-d295be31" VerificationImage = "ghcr.io/edgelesssys/constellation/verification-service:v1.3.2-0.20220714151638-d295be31"
GcpGuestImage = "ghcr.io/edgelesssys/gcp-guest-agent:latest" GcpGuestImage = "ghcr.io/edgelesssys/gcp-guest-agent:latest"
// currently supported versions. // currently supported versions.
V1_22 ValidK8sVersion = "1.22"
V1_23 ValidK8sVersion = "1.23" V1_23 ValidK8sVersion = "1.23"
V1_24 ValidK8sVersion = "1.24" V1_24 ValidK8sVersion = "1.24"
Latest ValidK8sVersion = V1_24 Latest ValidK8sVersion = V1_24
@ -42,6 +45,25 @@ const (
// versionConfigs holds download URLs for all required kubernetes components for every supported version. // versionConfigs holds download URLs for all required kubernetes components for every supported version.
var VersionConfigs map[ValidK8sVersion]KubernetesVersion = map[ValidK8sVersion]KubernetesVersion{ var VersionConfigs map[ValidK8sVersion]KubernetesVersion = map[ValidK8sVersion]KubernetesVersion{
V1_22: {
PatchVersion: "1.22.12",
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.24.1/crictl-v1.24.1-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.22.12/bin/linux/amd64/kubelet",
KubeadmURL: "https://storage.googleapis.com/kubernetes-release/release/v1.22.12/bin/linux/amd64/kubeadm",
KubectlURL: "https://storage.googleapis.com/kubernetes-release/release/v1.22.12/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:sha-2f6a5b07fc2d37f24f8ff725132f87584d627d8f",
// CloudControllerManagerImageAzure is the CCM image used on Azure.
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.1.18",
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.1.18",
// External service image. Depends on k8s version.
ClusterAutoscalerImage: "k8s.gcr.io/autoscaling/cluster-autoscaler:v1.22.3",
},
V1_23: { V1_23: {
PatchVersion: "1.23.6", PatchVersion: "1.23.6",
CNIPluginsURL: "https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz", CNIPluginsURL: "https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz",
@ -59,7 +81,7 @@ var VersionConfigs map[ValidK8sVersion]KubernetesVersion = map[ValidK8sVersion]K
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure. // CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.23.11", CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.23.11",
// External service image. Depends on k8s version. // External service image. Depends on k8s version.
ClusterAutoscalerImage: "k8s.gcr.io/autoscaling/cluster-autoscaler:v1.23.0", ClusterAutoscalerImage: "k8s.gcr.io/autoscaling/cluster-autoscaler:v1.23.1",
}, },
V1_24: { V1_24: {
PatchVersion: "1.24.3", PatchVersion: "1.24.3",
@ -85,16 +107,15 @@ var VersionConfigs map[ValidK8sVersion]KubernetesVersion = map[ValidK8sVersion]K
// KubernetesVersion bundles download URLs to all version-releated binaries necessary for installing/deploying a particular Kubernetes version. // KubernetesVersion bundles download URLs to all version-releated binaries necessary for installing/deploying a particular Kubernetes version.
type KubernetesVersion struct { type KubernetesVersion struct {
PatchVersion string PatchVersion string
CNIPluginsURL string CNIPluginsURL string // No k8s version dependency.
CrictlURL string CrictlURL string // k8s version dependency.
KubeletServiceURL string KubeletServiceURL string // No k8s version dependency.
KubeadmConfURL string KubeadmConfURL string // kubeadm/kubelet v1.11+.
KubeletURL string KubeletURL string // k8s version dependency.
KubeadmURL string KubeadmURL string // k8s version dependency.
KubectlURL string KubectlURL string // k8s version dependency.
CloudControllerManagerImageAWS string CloudControllerManagerImageGCP string // k8s compatibility policy unknown. Using self-built image until resolved: https://github.com/kubernetes/cloud-provider-gcp/issues/289
CloudControllerManagerImageGCP string CloudControllerManagerImageAzure string // k8s version dependency.
CloudControllerManagerImageAzure string CloudNodeManagerImageAzure string // k8s version dependency. Same version as above.
CloudNodeManagerImageAzure string ClusterAutoscalerImage string // Matches k8s versioning scheme.
ClusterAutoscalerImage string
} }