2022-09-05 09:06:08 +02:00
/ *
Copyright ( c ) Edgeless Systems GmbH
SPDX - License - Identifier : AGPL - 3.0 - only
* /
2023-01-19 15:57:50 +01: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 14:41:07 +02:00
package versions
2022-10-06 12:58:56 +02:00
import (
"fmt"
2023-12-14 14:51:10 +01:00
"path"
2023-01-31 12:12:19 +01:00
"sort"
2022-10-06 12:58:56 +02:00
"strings"
2022-11-14 19:09:49 +01:00
2023-02-09 17:38:02 +01:00
"github.com/edgelesssys/constellation/v2/internal/compatibility"
2022-11-14 19:09:49 +01:00
"github.com/edgelesssys/constellation/v2/internal/constants"
2023-01-06 12:04:36 +01:00
"github.com/edgelesssys/constellation/v2/internal/versions/components"
2023-01-31 12:12:19 +01:00
"golang.org/x/mod/semver"
2022-10-06 12:58:56 +02:00
)
2022-07-22 15:05:04 +02:00
2023-01-31 12:12:19 +01: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 17:38:02 +01:00
validVersions [ i ] = compatibility . EnsurePrefixV ( conf . ClusterVersion )
2023-01-31 12:12:19 +01:00
i ++
}
validVersionsSorted := semver . ByVersion ( validVersions )
sort . Sort ( validVersionsSorted )
return validVersionsSorted
}
2022-07-22 15:05:04 +02: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 13:50:00 +02:00
// It accepts a full version (e.g. 1.26.7) and validates it.
2023-06-05 09:13:02 +02:00
// Returns an empty string if the given version is invalid.
// strict controls whether the patch version is checked or not.
2023-09-19 13:50:00 +02:00
// If strict is false, the patch version validation is skipped.
2023-06-05 09:13:02 +02:00
func NewValidK8sVersion ( k8sVersion string , strict bool ) ( ValidK8sVersion , error ) {
2023-09-19 13:50:00 +02:00
prefixedVersion := compatibility . EnsurePrefixV ( k8sVersion )
2023-06-05 09:13:02 +02:00
var supported bool
if strict {
2023-09-19 13:50:00 +02:00
supported = isSupportedK8sVersionStrict ( prefixedVersion )
2023-06-05 09:13:02 +02:00
} else {
2023-09-19 13:50:00 +02:00
supported = isSupportedK8sVersion ( prefixedVersion )
2023-06-05 09:13:02 +02:00
}
2023-07-12 12:42:51 +02:00
if ! supported {
2023-09-19 13:50:00 +02:00
return "" , fmt . Errorf ( "invalid Kubernetes version: %s; supported versions are %v" , prefixedVersion , SupportedK8sVersions ( ) )
2023-07-12 12:42:51 +02:00
}
2023-09-19 13:50:00 +02: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 15:05:04 +02:00
}
2023-07-12 12:42:51 +02:00
2023-09-19 13:50:00 +02: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_28 ) ) :
return string ( V1_28 )
2024-01-08 16:53:12 +01:00
case semver . MajorMinor ( string ( V1_29 ) ) :
return string ( V1_29 )
2024-06-19 17:34:34 +02:00
case semver . MajorMinor ( string ( V1_30 ) ) :
return string ( V1_30 )
2023-09-19 13:50:00 +02:00
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 09:13:02 +02: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 15:05:04 +02:00
}
// IsSupportedK8sVersion checks if a given Kubernetes version is supported by Constellation.
2023-06-05 09:13:02 +02:00
func isSupportedK8sVersionStrict ( version string ) bool {
2023-02-22 09:52:47 +01:00
for _ , valid := range SupportedK8sVersions ( ) {
if valid == version {
return true
}
2022-07-22 15:05:04 +02:00
}
2023-02-22 09:52:47 +01:00
return false
2022-07-22 15:05:04 +02:00
}
2022-09-02 14:05:44 +02:00
// IsPreviewK8sVersion checks if a given Kubernetes version is still in preview and not fully supported.
2023-03-20 11:03:36 +01:00
func IsPreviewK8sVersion ( _ ValidK8sVersion ) bool {
2022-10-06 10:43:46 +02:00
return false
2022-09-02 14:05:44 +02:00
}
2023-09-19 13:50:00 +02: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 12:42:51 +02:00
}
2023-12-14 14:51:10 +01:00
// patchFilePath returns the canonical path for kubeadm patch files for the given component.
// See https://pkg.go.dev/k8s.io/kubernetes@v1.27.7/cmd/kubeadm/app/apis/kubeadm/v1beta3#InitConfiguration.
func patchFilePath ( component string ) string {
return path . Join ( constants . KubeadmPatchDir , fmt . Sprintf ( "%s+json.json" , component ) )
}
2022-07-21 14:41:07 +02:00
const (
2022-11-09 15:57:54 +01:00
//
2022-07-21 14:41:07 +02:00
// Constellation images.
// These images are built in a way that they support all versions currently listed in VersionConfigs.
2022-11-09 15:57:54 +01:00
//
// GcpGuestImage image for GCP guest agent.
2022-10-07 17:50:59 +02:00
// Check for new versions at https://github.com/GoogleCloudPlatform/guest-agent/releases and update in /.github/workflows/build-gcp-guest-agent.yml.
2024-08-23 00:30:51 +02:00
GcpGuestImage = "ghcr.io/edgelesssys/gcp-guest-agent:v20240816.0.0@sha256:a6f871346da12d95a1961cb247343ccaa708039f49999ce56d00e35f3f701b97" // renovate:container
2022-11-21 10:35:40 +01:00
// NodeMaintenanceOperatorImage is the image for the node maintenance operator.
2024-10-16 17:07:37 +02:00
NodeMaintenanceOperatorImage = "quay.io/medik8s/node-maintenance-operator:v0.17.0@sha256:bf1c5758b3d266dd6234422d156c67ffdd47f50f70ce17d5cef1de6065030337" // renovate:container
2022-11-17 15:25:25 +01:00
// LogstashImage is the container image of logstash, used for log collection by debugd.
2024-06-28 08:34:08 +02:00
LogstashImage = "ghcr.io/edgelesssys/constellation/logstash-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:d6c5a06049e5c1b9d7ba4b83367fa0c06ba2d1b65e1d299f3e00f465f310642b" // renovate:container
2022-11-17 15:25:25 +01:00
// FilebeatImage is the container image of filebeat, used for log collection by debugd.
2024-06-28 08:34:08 +02:00
FilebeatImage = "ghcr.io/edgelesssys/constellation/filebeat-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:606adccf544a15e6b9ae9e11eec707668660bc1af346ff72559404e36da5baa2" // renovate:container
2023-09-27 16:17:31 +02:00
// MetricbeatImage is the container image of filebeat, used for log collection by debugd.
2024-06-28 08:34:08 +02:00
MetricbeatImage = "ghcr.io/edgelesssys/constellation/metricbeat-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:690b9d36cc334a7f83b58ca905169bb9f1c955b7a436c0044a07f4ce15a90594" // renovate:container
2022-11-17 15:25:25 +01:00
2022-07-22 15:05:04 +02:00
// currently supported versions.
2022-10-05 15:02:46 +02:00
//nolint:revive
2024-12-01 13:13:48 +01:00
V1_28 ValidK8sVersion = "v1.28.15" // renovate:kubernetes-release
2023-08-18 11:13:24 +02:00
//nolint:revive
2024-12-02 14:26:59 +01:00
V1_29 ValidK8sVersion = "v1.29.11" // renovate:kubernetes-release
2024-01-08 16:53:12 +01:00
//nolint:revive
2024-12-02 14:26:59 +01:00
V1_30 ValidK8sVersion = "v1.30.7" // renovate:kubernetes-release
2022-10-05 15:02:46 +02:00
2022-11-09 15:57:54 +01:00
// Default k8s version deployed by Constellation.
2024-06-19 17:34:34 +02:00
Default ValidK8sVersion = V1_29
2022-07-21 14:41:07 +02:00
)
2022-11-10 15:20:10 +01: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 13:58:37 +02:00
//go:generate hash-generator
2022-11-10 15:20:10 +01:00
2022-11-09 15:57:54 +01:00
// VersionConfigs holds download URLs for all required kubernetes components for every supported version.
2022-10-05 15:02:46 +02:00
var VersionConfigs = map [ ValidK8sVersion ] KubernetesVersion {
2024-06-19 17:34:34 +02:00
V1_28 : {
2024-12-01 13:13:48 +01:00
ClusterVersion : "v1.28.15" , // renovate:kubernetes-release
2023-01-06 12:04:36 +01:00
KubernetesComponents : components . Components {
2022-11-14 19:09:49 +01:00
{
2024-10-16 10:28:37 +02:00
Url : "https://github.com/containernetworking/plugins/releases/download/v1.6.0/cni-plugins-linux-amd64-v1.6.0.tgz" , // renovate:cni-plugins-release
Hash : "sha256:682b49ff8933a997a52107161f1745f8312364b4c7f605ccdf7a77499130d89d" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . CniPluginsDir ,
Extract : true ,
} ,
{
2024-10-14 22:11:09 +02:00
Url : "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.31.1/crictl-v1.31.1-linux-amd64.tar.gz" , // renovate:crictl-release
Hash : "sha256:0a03ba6b1e4c253d63627f8d210b2ea07675a8712587e697657b236d06d7d231" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . BinDir ,
Extract : true ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.28.14/bin/linux/amd64/kubelet" , // renovate:kubernetes-release
Hash : "sha256:783b94ac980e9813626c51b0bc92b0b25bc8a61eec447b1c48aa5eaba1016b5f" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . KubeletPath ,
Extract : false ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.28.14/bin/linux/amd64/kubeadm" , // renovate:kubernetes-release
Hash : "sha256:2fd2f8269a3baa8248f598cfbea8d2234291726fd534d17211b55a1ffb6b8c9b" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . KubeadmPath ,
Extract : false ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.28.14/bin/linux/amd64/kubectl" , // renovate:kubernetes-release
Hash : "sha256:e1e8c08f7fc0b47e5d89422e573c3a2e658d95f1ee0c7ea6c8cb38f37140e607" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . KubectlPath ,
Extract : false ,
} ,
2023-12-14 14:51:10 +01:00
{
2024-12-01 13:13:48 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjI4LjE1QHNoYTI1Njo2ZGZhODRmNWQ2YmU3MTFhZTBkMTk3NTgyMDFkMzM3ZTgzNmFiN2RlNzMzMDZmZjE0NzI1Y2VhYTk3OGZlYThmIn1d" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-apiserver" ) ,
} ,
{
2024-12-01 13:13:48 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjI4LjE1QHNoYTI1NjpkYWRkMmEzNzg0NzgzMDE4YTdlZTg1ODhkMTFmNzg3ZmVlNGQ1NDI0ZjJjZGQ2Y2U4OWQzYmExODQ0YTZjMTc1In1d" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-controller-manager" ) ,
} ,
{
2024-12-01 13:13:48 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjI4LjE1QHNoYTI1Njo4MmY0YTQyMzE3NDUwODU4ZDNkNzBmZGU1YjNjMGYyMjE1M2VhMTU1ZmQwNTNmMDk4NjU5OTlhNDY2MWYyZGNhIn1d" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-scheduler" ) ,
} ,
2023-12-21 20:56:55 +01:00
{
2024-10-16 17:35:51 +02:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjE1LTBAc2hhMjU2OmE2ZGM2M2U2ZThjZmEwMzA3ZDc4NTE3NjJmYTZiNjI5YWZiMThmMjhkOGFhM2ZhYjVhNmU5MWI0YWY2MDAyNmEifV0=" ,
2023-12-21 20:56:55 +01:00
InstallPath : patchFilePath ( "etcd" ) ,
} ,
2022-11-10 15:20:10 +01:00
} ,
2022-10-24 16:13:26 +02:00
// CloudControllerManagerImageAWS is the CCM image used on AWS.
2024-06-19 17:34:34 +02:00
// Check for newer versions at https://github.com/kubernetes/cloud-provider-aws/releases.
2024-09-10 11:41:44 +02:00
CloudControllerManagerImageAWS : "registry.k8s.io/provider-aws/cloud-controller-manager:v1.28.9@sha256:168905b591796fbd07cb35cd0e3f206fdb7efb30e325c9bf7fa70d1b48989f73" , // renovate:container
2022-07-26 17:08:57 +02:00
// CloudControllerManagerImageAzure is the CCM image used on Azure.
2023-05-05 13:22:53 +02:00
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
2024-10-11 17:04:08 +02:00
CloudControllerManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.28.13@sha256:8b853f4f54a09c363806714189435933a8575ac6dca27e991976bd685603113e" , // renovate:container
2022-07-26 17:08:57 +02:00
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
2023-05-05 13:22:53 +02:00
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
2024-10-11 17:04:08 +02:00
CloudNodeManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.28.13@sha256:525ca9c8a44bbdfa9acc0a417776bb822a1bbdaaf27d9776b8dcf5b3519c346a" , // renovate:container
2023-03-17 09:44:30 +01:00
// CloudControllerManagerImageGCP is the CCM image used on GCP.
2024-06-19 17:34:34 +02:00
CloudControllerManagerImageGCP : "ghcr.io/edgelesssys/cloud-provider-gcp:v28.10.0@sha256:f3b6fa7faea27b4a303c91b3bc7ee192b050e21e27579e9f3da90ae4ba38e626" , // renovate:container
2023-03-17 09:44:30 +01:00
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
2023-10-17 10:47:48 +02:00
CloudControllerManagerImageOpenStack : "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0" , // renovate:container
2022-07-26 17:08:57 +02:00
// External service image. Depends on k8s version.
2023-05-05 13:22:53 +02:00
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
2024-12-02 13:24:47 +01:00
ClusterAutoscalerImage : "registry.k8s.io/autoscaling/cluster-autoscaler:v1.28.7@sha256:77906954da9171425c8c8d3286091818143b6dcf9039abd49b8f33f1502978a1" , // renovate:container
2022-07-26 17:08:57 +02:00
} ,
2024-06-19 17:34:34 +02:00
V1_29 : {
2024-12-02 14:26:59 +01:00
ClusterVersion : "v1.29.11" , // renovate:kubernetes-release
2023-01-06 12:04:36 +01:00
KubernetesComponents : components . Components {
2022-11-14 19:09:49 +01:00
{
2024-10-16 10:28:37 +02:00
Url : "https://github.com/containernetworking/plugins/releases/download/v1.6.0/cni-plugins-linux-amd64-v1.6.0.tgz" , // renovate:cni-plugins-release
Hash : "sha256:682b49ff8933a997a52107161f1745f8312364b4c7f605ccdf7a77499130d89d" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . CniPluginsDir ,
Extract : true ,
} ,
{
2024-10-14 22:11:09 +02:00
Url : "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.31.1/crictl-v1.31.1-linux-amd64.tar.gz" , // renovate:crictl-release
Hash : "sha256:0a03ba6b1e4c253d63627f8d210b2ea07675a8712587e697657b236d06d7d231" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . BinDir ,
Extract : true ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.29.9/bin/linux/amd64/kubelet" , // renovate:kubernetes-release
Hash : "sha256:1bf6e9e9a5612ea4f6e1a8f541a08be93fdf144b1430147de6916dae363c34a2" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . KubeletPath ,
Extract : false ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.29.9/bin/linux/amd64/kubeadm" , // renovate:kubernetes-release
Hash : "sha256:e313046d79c3f78d487804fc32248c0575af129bc8a31bca74b191efa036e0b1" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . KubeadmPath ,
Extract : false ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.29.9/bin/linux/amd64/kubectl" , // renovate:kubernetes-release
Hash : "sha256:7b0de2466458cc3c12cf8742dc800c77d4fa72e831aa522df65e510d33b329e2" ,
2022-11-14 19:09:49 +01:00
InstallPath : constants . KubectlPath ,
Extract : false ,
} ,
2023-12-14 14:51:10 +01:00
{
2024-12-02 14:26:59 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjI5LjExQHNoYTI1Njo2NTQ1ZjZmNjJjMWYwZjBhZmZmNTM0YzIyNzZiZDI0MmZmZGFjNTRlNzNiMjJjYzEwMzQzNTIyYzcyYjlmNzcxIn1d" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-apiserver" ) ,
} ,
{
2024-12-02 14:26:59 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjI5LjExQHNoYTI1Njo1OTU1NDgyZDg5NWFhNGE0MTNhNzBhZjUwNjcwNjA1OTIzOGIzNjM3ZmQ3MzA1OTRlNTljOTkwOTU0MjIxZjEzIn1d" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-controller-manager" ) ,
} ,
{
2024-12-02 14:26:59 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjI5LjExQHNoYTI1NjpmZTA3OGYyNmJmMTQzMDFmNzk0NjhkNzlhNWQyZDQzMWIzNDZhNGFiYjFjYWI0ZTliMWY5YmE4OTE0OTY0MTYxIn1d" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-scheduler" ) ,
} ,
2023-12-21 20:56:55 +01:00
{
2024-10-16 17:35:51 +02:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjE1LTBAc2hhMjU2OmE2ZGM2M2U2ZThjZmEwMzA3ZDc4NTE3NjJmYTZiNjI5YWZiMThmMjhkOGFhM2ZhYjVhNmU5MWI0YWY2MDAyNmEifV0=" ,
2023-12-21 20:56:55 +01:00
InstallPath : patchFilePath ( "etcd" ) ,
} ,
2022-11-10 15:20:10 +01:00
} ,
2022-10-24 16:13:26 +02:00
// CloudControllerManagerImageAWS is the CCM image used on AWS.
2024-06-19 17:34:34 +02:00
// Check for newer versions at https://github.com/kubernetes/cloud-provider-aws/releases.
2024-09-10 11:41:44 +02:00
CloudControllerManagerImageAWS : "registry.k8s.io/provider-aws/cloud-controller-manager:v1.29.6@sha256:8074b8828a33fb273833e8fd374dda6a0ab10335ae8e19684fbd61eeff7d3594" , // renovate:container
2022-12-09 16:30:21 +01: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.
2024-10-11 17:04:08 +02:00
CloudControllerManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.29.11@sha256:2ecdca660c03b17110a4ee732230424ce0377c5b1756a4408666e40938ee976a" , // renovate:container
2022-12-09 16:30:21 +01: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.
2024-10-11 17:04:08 +02:00
CloudNodeManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.29.11@sha256:17888b0ebaec6735214b85d20bdcc8062f051bc27e835454e9ef89734d34aa4b" , // renovate:container
2023-03-17 09:44:30 +01:00
// CloudControllerManagerImageGCP is the CCM image used on GCP.
2024-09-10 13:16:51 +02:00
CloudControllerManagerImageGCP : "ghcr.io/edgelesssys/cloud-provider-gcp:v29.5.1@sha256:ebbc6f5755725b6c2c81ca1d1580e2feba83572c41608b739c50f85b2e5de936" , // renovate:container
2023-03-17 09:44:30 +01:00
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
2023-10-17 10:47:48 +02:00
CloudControllerManagerImageOpenStack : "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0" , // renovate:container
2022-12-09 16:30:21 +01:00
// External service image. Depends on k8s version.
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
2024-12-02 13:24:47 +01:00
ClusterAutoscalerImage : "registry.k8s.io/autoscaling/cluster-autoscaler:v1.29.5@sha256:76865740be7c965b35ee1524931bb4abfe4c27b5bfad280e84068cd6653ee7bb" , // renovate:container
2022-12-09 16:30:21 +01:00
} ,
2024-06-19 17:34:34 +02:00
V1_30 : {
2024-12-02 14:26:59 +01:00
ClusterVersion : "v1.30.7" , // renovate:kubernetes-release
2023-01-06 12:04:36 +01:00
KubernetesComponents : components . Components {
2022-12-09 16:30:21 +01:00
{
2024-10-16 10:28:37 +02:00
Url : "https://github.com/containernetworking/plugins/releases/download/v1.6.0/cni-plugins-linux-amd64-v1.6.0.tgz" , // renovate:cni-plugins-release
Hash : "sha256:682b49ff8933a997a52107161f1745f8312364b4c7f605ccdf7a77499130d89d" ,
2022-12-09 16:30:21 +01:00
InstallPath : constants . CniPluginsDir ,
Extract : true ,
} ,
{
2024-10-14 22:11:09 +02:00
Url : "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.31.1/crictl-v1.31.1-linux-amd64.tar.gz" , // renovate:crictl-release
Hash : "sha256:0a03ba6b1e4c253d63627f8d210b2ea07675a8712587e697657b236d06d7d231" ,
2022-12-09 16:30:21 +01:00
InstallPath : constants . BinDir ,
Extract : true ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.30.5/bin/linux/amd64/kubelet" , // renovate:kubernetes-release
Hash : "sha256:9b4b8f8b33c988372cc9c67791418028ca2cef4a4b4b8d98ab67d6f21275a11a" ,
2022-12-09 16:30:21 +01:00
InstallPath : constants . KubeletPath ,
Extract : false ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.30.5/bin/linux/amd64/kubeadm" , // renovate:kubernetes-release
Hash : "sha256:b91e32e527d3941369cee016fccb6cb12cd214a120a81d8c5f84c7cbc9e120b2" ,
2022-12-09 16:30:21 +01:00
InstallPath : constants . KubeadmPath ,
Extract : false ,
} ,
{
2024-10-11 19:23:31 +02:00
Url : "https://dl.k8s.io/v1.30.5/bin/linux/amd64/kubectl" , // renovate:kubernetes-release
Hash : "sha256:b8aa921a580c3d8ba473236815de5ce5173d6fbfa2ccff453fa5eef46cc5ee7a" ,
2022-12-09 16:30:21 +01:00
InstallPath : constants . KubectlPath ,
Extract : false ,
} ,
2023-12-14 14:51:10 +01:00
{
2024-12-02 14:26:59 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjMwLjdAc2hhMjU2OjEzZjRmMGY1ODUwYjM5NzQyMTAxYzY1NmIxYmJkNTA5MGVhY2YyNzA4NGFkODliNDg5ZmM4MjRlZjQ4MmVkOWMifV0=" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-apiserver" ) ,
} ,
{
2024-12-02 14:26:59 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjMwLjdAc2hhMjU2OjViOGRjMjZjMDViMjczY2UxOThmYmFmNGViMTc5ZjNiNmQ2OTE5YzZlMjExNmQzNmRjN2Y4MjU1NTM3NGM2ODcifV0=" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-controller-manager" ) ,
} ,
{
2024-12-02 14:26:59 +01:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjMwLjdAc2hhMjU2OjAwYjE2ZGI5OTExMDFiNzM2MWYyZjE4MDM1ZTFjNjUyNmMwY2U2YzlhOTU2ODUyNDgyNGI0YmNjZGYxYWZiZDYifV0=" ,
2023-12-14 14:51:10 +01:00
InstallPath : patchFilePath ( "kube-scheduler" ) ,
} ,
2023-12-21 20:56:55 +01:00
{
2024-10-16 17:35:51 +02:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjE1LTBAc2hhMjU2OmE2ZGM2M2U2ZThjZmEwMzA3ZDc4NTE3NjJmYTZiNjI5YWZiMThmMjhkOGFhM2ZhYjVhNmU5MWI0YWY2MDAyNmEifV0=" ,
2023-12-21 20:56:55 +01:00
InstallPath : patchFilePath ( "etcd" ) ,
} ,
2022-12-09 16:30:21 +01:00
} ,
// CloudControllerManagerImageAWS is the CCM image used on AWS.
2024-06-19 17:34:34 +02:00
// Check for newer versions at https://github.com/kubernetes/cloud-provider-aws/releases.
2024-09-10 11:41:44 +02:00
CloudControllerManagerImageAWS : "registry.k8s.io/provider-aws/cloud-controller-manager:v1.30.3@sha256:30a1758dec30814178c787e2d50f46bb141e9f0bb2e16190ddd19df15f957874" , // renovate:container
2022-09-02 14:05:44 +02:00
// CloudControllerManagerImageAzure is the CCM image used on Azure.
2022-10-06 11:18:23 +02:00
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
2024-10-11 17:04:08 +02:00
CloudControllerManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.30.7@sha256:03b2876f481507781a27b56a6e66c1928b7b93774e787e52a5239aefa41191e4" , // renovate:container
2022-09-02 14:05:44 +02:00
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
2022-10-06 11:18:23 +02:00
// Check for newer versions at https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/README.md.
2024-10-11 17:04:08 +02:00
CloudNodeManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.30.7@sha256:f18feb78e36eef88f0e23d98d798476d2bf6837de11892fe118ab043afdcd497" , // renovate:container
2023-03-17 09:44:30 +01:00
// CloudControllerManagerImageGCP is the CCM image used on GCP.
2024-09-10 13:16:51 +02:00
CloudControllerManagerImageGCP : "ghcr.io/edgelesssys/cloud-provider-gcp:v30.1.0@sha256:64d2d5d4d2b5fb426c307c64ada9a61b64e797b56d9768363f145f2bd957998f" , // renovate:container
2023-03-17 09:44:30 +01:00
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
2023-10-17 10:47:48 +02:00
CloudControllerManagerImageOpenStack : "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0" , // renovate:container
2022-09-02 14:05:44 +02:00
// External service image. Depends on k8s version.
2022-10-06 11:18:23 +02:00
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
2024-12-02 13:24:47 +01:00
ClusterAutoscalerImage : "registry.k8s.io/autoscaling/cluster-autoscaler:v1.30.3@sha256:08fd86ee093760849ac4fd579eb90185b669fc20aa56c156aa34ea7b73dd5e34" , // renovate:container
2022-09-02 14:05:44 +02:00
} ,
2022-07-21 14:41:07 +02:00
}
2023-12-11 08:08:55 +01:00
// KubernetesVersion bundles download Urls to all version-releated binaries necessary for installing/deploying a particular Kubernetes version.
2022-07-21 14:41:07 +02:00
type KubernetesVersion struct {
2023-03-17 09:44:30 +01:00
ClusterVersion string
KubernetesComponents components . Components
CloudControllerManagerImageAWS string // k8s version dependency.
CloudControllerManagerImageAzure string // k8s version dependency.
2024-06-19 17:34:34 +02:00
CloudControllerManagerImageGCP string // Published by .github/workflows/build-ccm-gcp.yml because of https://github.com/kubernetes/cloud-provider-gcp/issues/289.
2023-03-17 09:44:30 +01:00
CloudControllerManagerImageOpenStack string // k8s version dependency.
2024-06-19 17:34:34 +02:00
CloudNodeManagerImageAzure string // k8s version dependency. Same version as Azure's CCM image above.
2023-03-17 09:44:30 +01:00
ClusterAutoscalerImage string // Matches k8s versioning scheme.
2022-11-14 19:09:49 +01:00
}
2022-10-06 12:58:56 +02: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
}