2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-01-19 09:57:50 -05:00
|
|
|
/*
|
|
|
|
Package versions defines the supported versions of Constellation components.
|
|
|
|
|
|
|
|
Binaries and container image versions are pinned by their hashes, the generate tool can be found in the hash-generator subpackage.
|
|
|
|
*/
|
2022-07-21 08:41:07 -04:00
|
|
|
package versions
|
|
|
|
|
2022-10-06 06:58:56 -04:00
|
|
|
import (
|
|
|
|
"fmt"
|
2023-01-31 06:12:19 -05:00
|
|
|
"sort"
|
2022-10-06 06:58:56 -04:00
|
|
|
"strings"
|
2022-11-14 13:09:49 -05:00
|
|
|
|
2023-02-09 11:38:02 -05:00
|
|
|
"github.com/edgelesssys/constellation/v2/internal/compatibility"
|
2022-11-14 13:09:49 -05:00
|
|
|
"github.com/edgelesssys/constellation/v2/internal/constants"
|
2023-01-06 06:04:36 -05:00
|
|
|
"github.com/edgelesssys/constellation/v2/internal/versions/components"
|
2023-01-31 06:12:19 -05:00
|
|
|
"golang.org/x/mod/semver"
|
2022-10-06 06:58:56 -04:00
|
|
|
)
|
2022-07-22 09:05:04 -04:00
|
|
|
|
2023-01-31 06:12:19 -05:00
|
|
|
// SupportedK8sVersions returns a list (sorted) of supported Kubernetes versions.
|
|
|
|
func SupportedK8sVersions() []string {
|
|
|
|
validVersions := make([]string, len(VersionConfigs))
|
|
|
|
i := 0
|
|
|
|
for _, conf := range VersionConfigs {
|
2023-02-09 11:38:02 -05:00
|
|
|
validVersions[i] = compatibility.EnsurePrefixV(conf.ClusterVersion)
|
2023-01-31 06:12:19 -05:00
|
|
|
i++
|
|
|
|
}
|
|
|
|
validVersionsSorted := semver.ByVersion(validVersions)
|
|
|
|
sort.Sort(validVersionsSorted)
|
|
|
|
|
|
|
|
return validVersionsSorted
|
|
|
|
}
|
|
|
|
|
2022-07-22 09:05:04 -04:00
|
|
|
// ValidK8sVersion represents any of the three currently supported k8s versions.
|
|
|
|
type ValidK8sVersion string
|
|
|
|
|
|
|
|
// NewValidK8sVersion validates the given string and produces a new ValidK8sVersion object.
|
2023-09-19 07:50:00 -04:00
|
|
|
// It accepts a full version (e.g. 1.26.7) and validates it.
|
2023-06-05 03:13:02 -04:00
|
|
|
// Returns an empty string if the given version is invalid.
|
|
|
|
// strict controls whether the patch version is checked or not.
|
2023-09-19 07:50:00 -04:00
|
|
|
// If strict is false, the patch version validation is skipped.
|
2023-06-05 03:13:02 -04:00
|
|
|
func NewValidK8sVersion(k8sVersion string, strict bool) (ValidK8sVersion, error) {
|
2023-09-19 07:50:00 -04:00
|
|
|
prefixedVersion := compatibility.EnsurePrefixV(k8sVersion)
|
2023-06-05 03:13:02 -04:00
|
|
|
var supported bool
|
|
|
|
if strict {
|
2023-09-19 07:50:00 -04:00
|
|
|
supported = isSupportedK8sVersionStrict(prefixedVersion)
|
2023-06-05 03:13:02 -04:00
|
|
|
} else {
|
2023-09-19 07:50:00 -04:00
|
|
|
supported = isSupportedK8sVersion(prefixedVersion)
|
2023-06-05 03:13:02 -04:00
|
|
|
}
|
2023-07-12 06:42:51 -04:00
|
|
|
if !supported {
|
2023-09-19 07:50:00 -04:00
|
|
|
return "", fmt.Errorf("invalid Kubernetes version: %s; supported versions are %v", prefixedVersion, SupportedK8sVersions())
|
2023-07-12 06:42:51 -04:00
|
|
|
}
|
2023-09-19 07:50:00 -04:00
|
|
|
return ValidK8sVersion(prefixedVersion), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalYAML implements the yaml.Unmarshaler interface.
|
|
|
|
func (v *ValidK8sVersion) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|
|
|
var version string
|
|
|
|
if err := unmarshal(&version); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if !hasPatchVersion(version) {
|
|
|
|
return fmt.Errorf("Kubernetes version %s does not specify a patch, supported versions are %s", version, strings.Join(SupportedK8sVersions(), ", "))
|
|
|
|
}
|
|
|
|
valid, err := NewValidK8sVersion(version, false) // allow any patch version to not force K8s patch upgrades
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("unsupported Kubernetes version %s, supported versions are %s", version, strings.Join(SupportedK8sVersions(), ", "))
|
|
|
|
}
|
|
|
|
*v = valid
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ResolveK8sPatchVersion transforms a MAJOR.MINOR definition into a supported
|
|
|
|
// MAJOR.MINOR.PATCH release.
|
|
|
|
func ResolveK8sPatchVersion(k8sVersion string) (string, error) {
|
|
|
|
k8sVersion = compatibility.EnsurePrefixV(k8sVersion)
|
|
|
|
if !semver.IsValid(k8sVersion) {
|
|
|
|
return "", fmt.Errorf("Kubernetes version does not specify a valid semantic version: %s", k8sVersion)
|
|
|
|
}
|
|
|
|
if hasPatchVersion(k8sVersion) {
|
|
|
|
return k8sVersion, nil
|
|
|
|
}
|
|
|
|
extendedVersion := k8sVersionFromMajorMinor(k8sVersion)
|
|
|
|
if extendedVersion == "" {
|
|
|
|
return "", fmt.Errorf("Kubernetes version %s is not valid. Supported versions: %s",
|
|
|
|
strings.TrimPrefix(k8sVersion, "v"), supportedVersions())
|
2022-07-22 09:05:04 -04:00
|
|
|
}
|
2023-07-12 06:42:51 -04:00
|
|
|
|
2023-09-19 07:50:00 -04:00
|
|
|
return extendedVersion, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// k8sVersionFromMajorMinor takes a semver in format MAJOR.MINOR
|
|
|
|
// and returns the version in format MAJOR.MINOR.PATCH with the
|
|
|
|
// supported patch version as PATCH.
|
|
|
|
func k8sVersionFromMajorMinor(version string) string {
|
|
|
|
switch version {
|
|
|
|
case semver.MajorMinor(string(V1_26)):
|
|
|
|
return string(V1_26)
|
|
|
|
case semver.MajorMinor(string(V1_27)):
|
|
|
|
return string(V1_27)
|
|
|
|
case semver.MajorMinor(string(V1_28)):
|
|
|
|
return string(V1_28)
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// supportedVersions prints the supported version without v prefix and without patch version.
|
|
|
|
// Should only be used when accepting Kubernetes versions from --kubernetes.
|
|
|
|
func supportedVersions() string {
|
|
|
|
builder := strings.Builder{}
|
|
|
|
for i, version := range SupportedK8sVersions() {
|
|
|
|
if i > 0 {
|
|
|
|
builder.WriteString(" ")
|
|
|
|
}
|
|
|
|
builder.WriteString(strings.TrimPrefix(semver.MajorMinor(version), "v"))
|
|
|
|
}
|
|
|
|
return builder.String()
|
2023-06-05 03:13:02 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// IsSupportedK8sVersion checks if a given Kubernetes minor version is supported by Constellation.
|
|
|
|
// Note: the patch version is not checked!
|
|
|
|
func isSupportedK8sVersion(version string) bool {
|
|
|
|
for _, valid := range SupportedK8sVersions() {
|
|
|
|
if semver.MajorMinor(valid) == semver.MajorMinor(version) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
2022-07-22 09:05:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// IsSupportedK8sVersion checks if a given Kubernetes version is supported by Constellation.
|
2023-06-05 03:13:02 -04:00
|
|
|
func isSupportedK8sVersionStrict(version string) bool {
|
2023-02-22 03:52:47 -05:00
|
|
|
for _, valid := range SupportedK8sVersions() {
|
|
|
|
if valid == version {
|
|
|
|
return true
|
|
|
|
}
|
2022-07-22 09:05:04 -04:00
|
|
|
}
|
2023-02-22 03:52:47 -05:00
|
|
|
return false
|
2022-07-22 09:05:04 -04:00
|
|
|
}
|
|
|
|
|
2022-09-02 08:05:44 -04:00
|
|
|
// IsPreviewK8sVersion checks if a given Kubernetes version is still in preview and not fully supported.
|
2023-03-20 06:03:36 -04:00
|
|
|
func IsPreviewK8sVersion(_ ValidK8sVersion) bool {
|
2022-10-06 04:43:46 -04:00
|
|
|
return false
|
2022-09-02 08:05:44 -04:00
|
|
|
}
|
|
|
|
|
2023-09-19 07:50:00 -04:00
|
|
|
// hasPatchVersion returns if the given version has specified a patch version.
|
|
|
|
func hasPatchVersion(version string) bool {
|
|
|
|
return semver.MajorMinor(version) != version
|
2023-07-12 06:42:51 -04:00
|
|
|
}
|
|
|
|
|
2022-07-21 08:41:07 -04:00
|
|
|
const (
|
2022-11-09 09:57:54 -05:00
|
|
|
//
|
2022-07-21 08:41:07 -04:00
|
|
|
// Constellation images.
|
|
|
|
// These images are built in a way that they support all versions currently listed in VersionConfigs.
|
2022-11-09 09:57:54 -05:00
|
|
|
//
|
|
|
|
|
|
|
|
// KonnectivityAgentImage agent image for konnectivity service.
|
2023-03-20 11:35:26 -04:00
|
|
|
KonnectivityAgentImage = "registry.k8s.io/kas-network-proxy/proxy-agent:v0.1.2@sha256:cd3046d253d26ffb5907c625e0d0c2be05c5693c90e12116980851739fc0ead8" // renovate:container
|
2022-11-09 09:57:54 -05:00
|
|
|
// KonnectivityServerImage server image for konnectivity service.
|
2023-03-20 11:35:26 -04:00
|
|
|
KonnectivityServerImage = "registry.k8s.io/kas-network-proxy/proxy-server:v0.1.2@sha256:79933c3779bc30e33bb7509dff913e70f6ba78ad441f4827f0f3e840ce5f3ddb" // renovate:container
|
2022-11-09 09:57:54 -05:00
|
|
|
// GcpGuestImage image for GCP guest agent.
|
2022-10-07 11:50:59 -04:00
|
|
|
// Check for new versions at https://github.com/GoogleCloudPlatform/guest-agent/releases and update in /.github/workflows/build-gcp-guest-agent.yml.
|
2023-10-23 04:37:37 -04:00
|
|
|
GcpGuestImage = "ghcr.io/edgelesssys/gcp-guest-agent:v20231016.0.0@sha256:c51ebfc2b67f5a39daba88039e7f8f171d7084656c49c092cc53b0a2318209b2" // renovate:container
|
2022-11-21 04:35:40 -05:00
|
|
|
// NodeMaintenanceOperatorImage is the image for the node maintenance operator.
|
2023-07-19 09:37:17 -04:00
|
|
|
NodeMaintenanceOperatorImage = "quay.io/medik8s/node-maintenance-operator:v0.15.0@sha256:8cb8dad93283268282c30e75c68f4bd76b28def4b68b563d2f9db9c74225d634" // renovate:container
|
2022-11-17 09:25:25 -05:00
|
|
|
// LogstashImage is the container image of logstash, used for log collection by debugd.
|
2023-10-20 10:55:24 -04:00
|
|
|
LogstashImage = "ghcr.io/edgelesssys/constellation/logstash-debugd:v2.13.0-pre.0.20231017104710-b2f3f72488db@sha256:4a589fe1a8bd91e333ef525cd5933a62362b0be3161b5c11ffb0976b5c6c0752" // renovate:container
|
2022-11-17 09:25:25 -05:00
|
|
|
// FilebeatImage is the container image of filebeat, used for log collection by debugd.
|
2023-10-20 10:55:24 -04:00
|
|
|
FilebeatImage = "ghcr.io/edgelesssys/constellation/filebeat-debugd:v2.13.0-pre.0.20231017104710-b2f3f72488db@sha256:fc0ad266c9af8ab152568847952533b1df325c16f693f5b5be821eb3141a8fd2" // renovate:container
|
2023-09-27 10:17:31 -04:00
|
|
|
// MetricbeatImage is the container image of filebeat, used for log collection by debugd.
|
2023-10-20 10:55:24 -04:00
|
|
|
MetricbeatImage = "ghcr.io/edgelesssys/constellation/metricbeat-debugd:v2.13.0-pre.0.20231017104710-b2f3f72488db@sha256:60f9b7fa4b01966ddccf39ba1a32f3797804f03e38476cfe2fa336e74dc0c060" // renovate:container
|
2022-11-17 09:25:25 -05:00
|
|
|
|
2022-07-22 09:05:04 -04:00
|
|
|
// currently supported versions.
|
2022-10-05 09:02:46 -04:00
|
|
|
//nolint:revive
|
2023-09-18 07:17:43 -04:00
|
|
|
V1_26 ValidK8sVersion = "v1.26.9" // renovate:kubernetes-release
|
2023-05-05 07:22:53 -04:00
|
|
|
//nolint:revive
|
2023-09-18 07:17:43 -04:00
|
|
|
V1_27 ValidK8sVersion = "v1.27.6" // renovate:kubernetes-release
|
2023-08-18 05:13:24 -04:00
|
|
|
//nolint:revive
|
2023-09-18 07:17:43 -04:00
|
|
|
V1_28 ValidK8sVersion = "v1.28.2" // renovate:kubernetes-release
|
2022-10-05 09:02:46 -04:00
|
|
|
|
2022-11-09 09:57:54 -05:00
|
|
|
// Default k8s version deployed by Constellation.
|
2023-08-18 05:13:24 -04:00
|
|
|
Default ValidK8sVersion = V1_27
|
2022-07-21 08:41:07 -04:00
|
|
|
)
|
|
|
|
|
2022-11-10 09:20:10 -05:00
|
|
|
// Regenerate the hashes by running go generate.
|
|
|
|
// To add another Kubernetes version, add a new entry to the VersionConfigs map below and fill the Hash field with an empty string.
|
2023-03-29 07:58:37 -04:00
|
|
|
//go:generate hash-generator
|
2022-11-10 09:20:10 -05:00
|
|
|
|
2022-11-09 09:57:54 -05:00
|
|
|
// VersionConfigs holds download URLs for all required kubernetes components for every supported version.
|
2022-10-05 09:02:46 -04:00
|
|
|
var VersionConfigs = map[ValidK8sVersion]KubernetesVersion{
|
2023-08-18 05:13:24 -04:00
|
|
|
V1_26: {
|
2023-09-18 07:17:43 -04:00
|
|
|
ClusterVersion: "v1.26.9", // renovate:kubernetes-release
|
2023-01-06 06:04:36 -05:00
|
|
|
KubernetesComponents: components.Components{
|
2022-11-14 13:09:49 -05:00
|
|
|
{
|
2023-08-18 05:13:24 -04:00
|
|
|
URL: "https://github.com/containernetworking/plugins/releases/download/v1.3.0/cni-plugins-linux-amd64-v1.3.0.tgz", // renovate:cni-plugins-release
|
|
|
|
Hash: "sha256:754a71ed60a4bd08726c3af705a7d55ee3df03122b12e389fdba4bea35d7dd7e",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.CniPluginsDir,
|
|
|
|
Extract: true,
|
|
|
|
},
|
|
|
|
{
|
2023-08-18 05:13:24 -04:00
|
|
|
URL: "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.28.0/crictl-v1.28.0-linux-amd64.tar.gz", // renovate:crictl-release
|
|
|
|
Hash: "sha256:8dc78774f7cbeaf787994d386eec663f0a3cf24de1ea4893598096cb39ef2508",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.BinDir,
|
|
|
|
Extract: true,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.26.9/bin/linux/amd64/kubelet", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:baa2b021ab2f90c342518e2b8981a18de7e1e6b33f11c57e3ff23d40364877a8",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.KubeletPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.26.9/bin/linux/amd64/kubeadm", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:73e128821dd1f799a75c922218d12f6c4618b8e29cc7dae2a7390fb80092d3d9",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.KubeadmPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.26.9/bin/linux/amd64/kubectl", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:98ea4a13895e54ba24f57e0d369ff6be0d3906895305d5390197069b1da12ae2",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.KubectlPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
2022-11-10 09:20:10 -05:00
|
|
|
},
|
2022-10-24 10:13:26 -04:00
|
|
|
// CloudControllerManagerImageAWS is the CCM image used on AWS.
|
2023-08-18 05:13:24 -04:00
|
|
|
CloudControllerManagerImageAWS: "registry.k8s.io/provider-aws/cloud-controller-manager:v1.26.6@sha256:33445ab57f48938fe989ffe311dacee0044b82f2bd23cb7f7b563275926f0ce9", // renovate:container
|
2022-07-26 11:08:57 -04:00
|
|
|
// CloudControllerManagerImageAzure is the CCM image used on Azure.
|
2023-05-05 07:22:53 -04:00
|
|
|
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
|
2023-10-17 07:15:08 -04:00
|
|
|
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.26.16@sha256:92abc79a8a339cc7ab47abae35075b4f9771e5a25a9ada7c5040b1b3c7c7046e", // renovate:container
|
2022-07-26 11:08:57 -04:00
|
|
|
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
|
2023-05-05 07:22:53 -04:00
|
|
|
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
|
2023-10-17 07:15:08 -04:00
|
|
|
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.26.16@sha256:82ae9ba5483c4dd900f65c008cbeb390f62d93983374ec601f269d3597d4da8b", // renovate:container
|
2023-03-17 04:44:30 -04:00
|
|
|
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
2023-06-01 06:33:06 -04:00
|
|
|
// TODO(3u13r): use newer "cloud-provider-gcp" from https://github.com/kubernetes/cloud-provider-gcp when newer releases are available.
|
2023-08-23 05:22:17 -04:00
|
|
|
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v26.4.0@sha256:dbe983cceabb3df98112b083d844229c85a1bbdfef2060c79f4cd49afe2a07f3", // renovate:container
|
2023-03-17 04:44:30 -04:00
|
|
|
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
|
2023-10-17 04:47:48 -04:00
|
|
|
CloudControllerManagerImageOpenStack: "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0", // renovate:container
|
2022-07-26 11:08:57 -04:00
|
|
|
// External service image. Depends on k8s version.
|
2023-05-05 07:22:53 -04:00
|
|
|
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
|
2023-08-18 05:13:24 -04:00
|
|
|
ClusterAutoscalerImage: "registry.k8s.io/autoscaling/cluster-autoscaler:v1.26.4@sha256:f771284ff54ecfedf40c7af70c5450600786c98989aeb69cdcf7e7bb7ac5a20d", // renovate:container
|
2022-07-26 11:08:57 -04:00
|
|
|
},
|
2023-08-18 05:13:24 -04:00
|
|
|
V1_27: {
|
2023-09-18 07:17:43 -04:00
|
|
|
ClusterVersion: "v1.27.6", // renovate:kubernetes-release
|
2023-01-06 06:04:36 -05:00
|
|
|
KubernetesComponents: components.Components{
|
2022-11-14 13:09:49 -05:00
|
|
|
{
|
2023-08-18 05:13:24 -04:00
|
|
|
URL: "https://github.com/containernetworking/plugins/releases/download/v1.3.0/cni-plugins-linux-amd64-v1.3.0.tgz", // renovate:cni-plugins-release
|
|
|
|
Hash: "sha256:754a71ed60a4bd08726c3af705a7d55ee3df03122b12e389fdba4bea35d7dd7e",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.CniPluginsDir,
|
|
|
|
Extract: true,
|
|
|
|
},
|
|
|
|
{
|
2023-08-18 05:13:24 -04:00
|
|
|
URL: "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.28.0/crictl-v1.28.0-linux-amd64.tar.gz", // renovate:crictl-release
|
|
|
|
Hash: "sha256:8dc78774f7cbeaf787994d386eec663f0a3cf24de1ea4893598096cb39ef2508",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.BinDir,
|
|
|
|
Extract: true,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.27.6/bin/linux/amd64/kubelet", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:daa42f9b6f5e2176bbce0d24d89a05613000630bcddec1fafd2a8d42a523ce9d",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.KubeletPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.27.6/bin/linux/amd64/kubeadm", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:2bcdd68957ec25d0689bb56f32b4ec86e38463d2691d5ea21cd109c7afa3aa7c",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.KubeadmPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.27.6/bin/linux/amd64/kubectl", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:2b7adb71c8630904da1b94e262c8c3c477e9609b3c0ed8ae1213a1e156ae38dd",
|
2022-11-14 13:09:49 -05:00
|
|
|
InstallPath: constants.KubectlPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
2022-11-10 09:20:10 -05:00
|
|
|
},
|
2022-10-24 10:13:26 -04:00
|
|
|
// CloudControllerManagerImageAWS is the CCM image used on AWS.
|
2023-08-18 05:13:24 -04:00
|
|
|
CloudControllerManagerImageAWS: "registry.k8s.io/provider-aws/cloud-controller-manager:v1.27.2@sha256:42be09a2b13b4e69b42905639d6b005ebe1ca490aabefad427256abf2cc892c7", // renovate:container
|
2022-12-09 10:30:21 -05:00
|
|
|
// CloudControllerManagerImageAzure is the CCM image used on Azure.
|
|
|
|
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
|
2023-10-17 07:15:08 -04:00
|
|
|
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.27.10@sha256:3366e0e51c56643968c7e607cb27c2545948cfab5bff3bed85e314d93a689d8e", // renovate:container
|
2022-12-09 10:30:21 -05:00
|
|
|
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
|
|
|
|
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
|
2023-10-17 07:15:08 -04:00
|
|
|
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.27.10@sha256:754d4eb709d0c5955af8bc46f5beccf0fa8c09551855a3810145b09af27d6656", // renovate:container
|
2023-03-17 04:44:30 -04:00
|
|
|
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
2023-06-01 06:33:06 -04:00
|
|
|
// TODO(3u13r): use newer "cloud-provider-gcp" from https://github.com/kubernetes/cloud-provider-gcp when newer releases are available.
|
2023-08-23 05:22:17 -04:00
|
|
|
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v27.1.6@sha256:b097b4e5382ea1987db5996a9eaffb94fa224639b3464876f0b1b17f64509ac4", // renovate:container
|
2023-03-17 04:44:30 -04:00
|
|
|
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
|
2023-10-17 04:47:48 -04:00
|
|
|
CloudControllerManagerImageOpenStack: "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0", // renovate:container
|
2022-12-09 10:30:21 -05:00
|
|
|
// External service image. Depends on k8s version.
|
|
|
|
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
|
2023-08-18 05:13:24 -04:00
|
|
|
ClusterAutoscalerImage: "registry.k8s.io/autoscaling/cluster-autoscaler:v1.27.3@sha256:0e1ab1bfeb1beaa82f59356ef36364503df22aeb8f8d0d7383bac449b4e808fb", // renovate:container
|
2022-12-09 10:30:21 -05:00
|
|
|
},
|
2023-08-18 05:13:24 -04:00
|
|
|
V1_28: {
|
2023-09-18 07:17:43 -04:00
|
|
|
ClusterVersion: "v1.28.2", // renovate:kubernetes-release
|
2023-01-06 06:04:36 -05:00
|
|
|
KubernetesComponents: components.Components{
|
2022-12-09 10:30:21 -05:00
|
|
|
{
|
2023-08-18 05:13:24 -04:00
|
|
|
URL: "https://github.com/containernetworking/plugins/releases/download/v1.3.0/cni-plugins-linux-amd64-v1.3.0.tgz", // renovate:cni-plugins-release
|
|
|
|
Hash: "sha256:754a71ed60a4bd08726c3af705a7d55ee3df03122b12e389fdba4bea35d7dd7e",
|
2022-12-09 10:30:21 -05:00
|
|
|
InstallPath: constants.CniPluginsDir,
|
|
|
|
Extract: true,
|
|
|
|
},
|
|
|
|
{
|
2023-08-18 05:13:24 -04:00
|
|
|
URL: "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.28.0/crictl-v1.28.0-linux-amd64.tar.gz", // renovate:crictl-release
|
|
|
|
Hash: "sha256:8dc78774f7cbeaf787994d386eec663f0a3cf24de1ea4893598096cb39ef2508",
|
2022-12-09 10:30:21 -05:00
|
|
|
InstallPath: constants.BinDir,
|
|
|
|
Extract: true,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.28.2/bin/linux/amd64/kubelet", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:17edb866636f14eceaad58c56eab12af7ab3be3c78400aff9680635d927f1185",
|
2022-12-09 10:30:21 -05:00
|
|
|
InstallPath: constants.KubeletPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.28.2/bin/linux/amd64/kubeadm", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:6a4808230661c69431143db2e200ea2d021c7f1b1085e6353583075471310d00",
|
2022-12-09 10:30:21 -05:00
|
|
|
InstallPath: constants.KubeadmPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 07:17:43 -04:00
|
|
|
URL: "https://storage.googleapis.com/kubernetes-release/release/v1.28.2/bin/linux/amd64/kubectl", // renovate:kubernetes-release
|
|
|
|
Hash: "sha256:c922440b043e5de1afa3c1382f8c663a25f055978cbc6e8423493ec157579ec5",
|
2022-12-09 10:30:21 -05:00
|
|
|
InstallPath: constants.KubectlPath,
|
|
|
|
Extract: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// CloudControllerManagerImageAWS is the CCM image used on AWS.
|
2023-10-25 03:01:52 -04:00
|
|
|
CloudControllerManagerImageAWS: "registry.k8s.io/provider-aws/cloud-controller-manager:v1.28.1@sha256:79b423ac8bc52d00f932b40de11fc3047a5ed1cbec47cda23bcf8f45ef583ed1", // renovate:container
|
2022-09-02 08:05:44 -04:00
|
|
|
// CloudControllerManagerImageAzure is the CCM image used on Azure.
|
2022-10-06 05:18:23 -04:00
|
|
|
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
|
2023-10-17 07:15:08 -04:00
|
|
|
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.27.10@sha256:3366e0e51c56643968c7e607cb27c2545948cfab5bff3bed85e314d93a689d8e", // renovate:container
|
2022-09-02 08:05:44 -04:00
|
|
|
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
|
2022-10-06 05:18:23 -04:00
|
|
|
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
|
2023-10-17 07:15:08 -04:00
|
|
|
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.27.10@sha256:754d4eb709d0c5955af8bc46f5beccf0fa8c09551855a3810145b09af27d6656", // renovate:container
|
2023-03-17 04:44:30 -04:00
|
|
|
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
2023-06-01 06:33:06 -04:00
|
|
|
// TODO(3u13r): use newer "cloud-provider-gcp" from https://github.com/kubernetes/cloud-provider-gcp when newer releases are available.
|
2023-08-23 05:22:17 -04:00
|
|
|
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v27.1.6@sha256:b097b4e5382ea1987db5996a9eaffb94fa224639b3464876f0b1b17f64509ac4", // renovate:container
|
2023-03-17 04:44:30 -04:00
|
|
|
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
|
2023-10-17 04:47:48 -04:00
|
|
|
CloudControllerManagerImageOpenStack: "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0", // renovate:container
|
2022-09-02 08:05:44 -04:00
|
|
|
// External service image. Depends on k8s version.
|
2022-10-06 05:18:23 -04:00
|
|
|
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
|
2023-08-10 13:56:59 -04:00
|
|
|
ClusterAutoscalerImage: "registry.k8s.io/autoscaling/cluster-autoscaler:v1.27.3@sha256:0e1ab1bfeb1beaa82f59356ef36364503df22aeb8f8d0d7383bac449b4e808fb", // renovate:container
|
2022-09-02 08:05:44 -04:00
|
|
|
},
|
2022-07-21 08:41:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// KubernetesVersion bundles download URLs to all version-releated binaries necessary for installing/deploying a particular Kubernetes version.
|
|
|
|
type KubernetesVersion struct {
|
2023-03-17 04:44:30 -04:00
|
|
|
ClusterVersion string
|
|
|
|
KubernetesComponents components.Components
|
|
|
|
CloudControllerManagerImageAWS string // k8s version dependency.
|
|
|
|
CloudControllerManagerImageAzure string // k8s version dependency.
|
|
|
|
CloudControllerManagerImageGCP string // Using self-built image until resolved: https://github.com/kubernetes/cloud-provider-gcp/issues/289
|
|
|
|
CloudControllerManagerImageOpenStack string // k8s version dependency.
|
|
|
|
CloudNodeManagerImageAzure string // k8s version dependency. Same version as above.
|
|
|
|
ClusterAutoscalerImage string // Matches k8s versioning scheme.
|
2022-11-14 13:09:49 -05:00
|
|
|
}
|
|
|
|
|
2022-10-06 06:58:56 -04:00
|
|
|
// versionFromDockerImage returns the version tag from the image name, e.g. "v1.22.2" from "foocr.io/org/repo:v1.22.2@sha256:3009fj0...".
|
|
|
|
func versionFromDockerImage(imageName string) string {
|
|
|
|
beforeAt, _, _ := strings.Cut(imageName, "@")
|
|
|
|
_, version, ok := strings.Cut(beforeAt, ":")
|
|
|
|
if !ok {
|
|
|
|
panic(fmt.Errorf("failed to extract version from image name, no ':' found in %s", imageName))
|
|
|
|
}
|
|
|
|
return version
|
|
|
|
}
|