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-12-14 08:51:10 -05:00
"path"
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_28 ) ) :
return string ( V1_28 )
2024-01-08 10:53:12 -05:00
case semver . MajorMinor ( string ( V1_29 ) ) :
return string ( V1_29 )
2024-06-19 11:34:34 -04:00
case semver . MajorMinor ( string ( V1_30 ) ) :
return string ( V1_30 )
2023-09-19 07:50:00 -04: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 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
}
2023-12-14 08:51:10 -05: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 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
//
// 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.
2024-08-22 18:30:51 -04:00
GcpGuestImage = "ghcr.io/edgelesssys/gcp-guest-agent:v20240816.0.0@sha256:a6f871346da12d95a1961cb247343ccaa708039f49999ce56d00e35f3f701b97" // 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.
2024-06-28 02:34:08 -04:00
LogstashImage = "ghcr.io/edgelesssys/constellation/logstash-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:d6c5a06049e5c1b9d7ba4b83367fa0c06ba2d1b65e1d299f3e00f465f310642b" // renovate:container
2022-11-17 09:25:25 -05:00
// FilebeatImage is the container image of filebeat, used for log collection by debugd.
2024-06-28 02:34:08 -04:00
FilebeatImage = "ghcr.io/edgelesssys/constellation/filebeat-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:606adccf544a15e6b9ae9e11eec707668660bc1af346ff72559404e36da5baa2" // renovate:container
2023-09-27 10:17:31 -04:00
// MetricbeatImage is the container image of filebeat, used for log collection by debugd.
2024-06-28 02:34:08 -04:00
MetricbeatImage = "ghcr.io/edgelesssys/constellation/metricbeat-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:690b9d36cc334a7f83b58ca905169bb9f1c955b7a436c0044a07f4ce15a90594" // 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
2024-08-26 03:18:56 -04:00
V1_28 ValidK8sVersion = "v1.28.12" // renovate:kubernetes-release
2023-08-18 05:13:24 -04:00
//nolint:revive
2024-08-26 03:18:56 -04:00
V1_29 ValidK8sVersion = "v1.29.7" // renovate:kubernetes-release
2024-01-08 10:53:12 -05:00
//nolint:revive
2024-08-26 03:18:56 -04:00
V1_30 ValidK8sVersion = "v1.30.3" // 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.
2024-06-19 11:34:34 -04:00
Default ValidK8sVersion = V1_29
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 {
2024-06-19 11:34:34 -04:00
V1_28 : {
2024-08-26 03:18:56 -04:00
ClusterVersion : "v1.28.12" , // renovate:kubernetes-release
2023-01-06 06:04:36 -05:00
KubernetesComponents : components . Components {
2022-11-14 13:09:49 -05:00
{
2024-02-21 11:42:48 -05:00
Url : "https://github.com/containernetworking/plugins/releases/download/v1.4.0/cni-plugins-linux-amd64-v1.4.0.tgz" , // renovate:cni-plugins-release
Hash : "sha256:c2485ddb3ffc176578ae30ae58137f0b88e50f7c7f2af7d53a569276b2949a33" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . CniPluginsDir ,
Extract : true ,
} ,
{
2023-12-11 02:08:55 -05: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
2023-08-18 05:13:24 -04:00
Hash : "sha256:8dc78774f7cbeaf787994d386eec663f0a3cf24de1ea4893598096cb39ef2508" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . BinDir ,
Extract : true ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.28.12/bin/linux/amd64/kubelet" , // renovate:kubernetes-release
Hash : "sha256:4648ae155b1ab05ab8dbef417bde4d5acfcd5ad32e8d1e3209006b40c440a56c" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . KubeletPath ,
Extract : false ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.28.12/bin/linux/amd64/kubeadm" , // renovate:kubernetes-release
Hash : "sha256:3ffcf5100c6bca3dd0a6c317c744dd97fe497c7c4aefe468321171f940d34971" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . KubeadmPath ,
Extract : false ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.28.12/bin/linux/amd64/kubectl" , // renovate:kubernetes-release
Hash : "sha256:e8aee7c9206c00062ced394418a17994b58f279a93a1be1143b08afe1758a3a2" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . KubectlPath ,
Extract : false ,
} ,
2023-12-14 08:51:10 -05:00
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjI4LjEyQHNoYTI1NjphYzNiNjg3NmQ5NWZlN2I3NjkxZTY5ZjIxNjFhNTQ2NmFkYmU5ZDcyZDQ0ZjM0MmQ1OTU2NzQzMjFjZTE2ZDIzIn1d" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-apiserver" ) ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjI4LjEyQHNoYTI1Njo5OTZjNjI1OWU0NDA1YWI3OTA4M2ZiYjUyYmNmNTMwMDM2OTFhNTBiNTc5ODYyYmYyOWIzYWJhYTQ2ODQ2MGRiIn1d" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-controller-manager" ) ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjI4LjEyQHNoYTI1NjpkOTNhM2I1OTYxMjQ4ODIwYmViNWVjNmRmYjAzMjBkMTJjMGRiYTgyZmM0ODY5M2QyMGQzNDU3NTQ4ODM1NTFjIn1d" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-scheduler" ) ,
} ,
2023-12-21 14:56:55 -05:00
{
2024-04-25 08:03:24 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjEyLTBAc2hhMjU2OjQ0YThlMjRkY2JiYTM0NzBlZTFmZWUyMWQ1ZTg4ZDEyOGM5MzZlOWI1NWQ0YmM1MWZiZWY4MDg2ZjhlZDEyM2IifV0=" ,
2023-12-21 14:56:55 -05:00
InstallPath : patchFilePath ( "etcd" ) ,
} ,
2022-11-10 09:20:10 -05:00
} ,
2022-10-24 10:13:26 -04:00
// CloudControllerManagerImageAWS is the CCM image used on AWS.
2024-06-19 11:34:34 -04:00
// Check for newer versions at https://github.com/kubernetes/cloud-provider-aws/releases.
CloudControllerManagerImageAWS : "registry.k8s.io/provider-aws/cloud-controller-manager:v1.28.6@sha256:bb42961c336c2dbc736c1354b01208523962b4f4be4ebd582f697391766d510e" , // 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.
2024-08-22 17:42:05 -04:00
CloudControllerManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.28.11@sha256:6fe43ab439e2faef8dd198a84c13e295a4c112cd27ede1016b0f3e2d6c9882dc" , // 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.
2024-08-22 17:42:05 -04:00
CloudNodeManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.28.11@sha256:0d50766bd56f20812073d00a973d64fb49cc6f7b4a23484b521c3e34abe31984" , // renovate:container
2023-03-17 04:44:30 -04:00
// CloudControllerManagerImageGCP is the CCM image used on GCP.
2024-06-19 11:34:34 -04:00
CloudControllerManagerImageGCP : "ghcr.io/edgelesssys/cloud-provider-gcp:v28.10.0@sha256:f3b6fa7faea27b4a303c91b3bc7ee192b050e21e27579e9f3da90ae4ba38e626" , // 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.
2024-08-22 19:17:24 -04:00
ClusterAutoscalerImage : "registry.k8s.io/autoscaling/cluster-autoscaler:v1.28.6@sha256:acfc7fe7543f4cf2fcf8156145925bee76eb6c602bb0b8e155456c6818fe8335" , // renovate:container
2022-07-26 11:08:57 -04:00
} ,
2024-06-19 11:34:34 -04:00
V1_29 : {
2024-08-26 03:18:56 -04:00
ClusterVersion : "v1.29.7" , // renovate:kubernetes-release
2023-01-06 06:04:36 -05:00
KubernetesComponents : components . Components {
2022-11-14 13:09:49 -05:00
{
2024-02-21 11:42:48 -05:00
Url : "https://github.com/containernetworking/plugins/releases/download/v1.4.0/cni-plugins-linux-amd64-v1.4.0.tgz" , // renovate:cni-plugins-release
Hash : "sha256:c2485ddb3ffc176578ae30ae58137f0b88e50f7c7f2af7d53a569276b2949a33" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . CniPluginsDir ,
Extract : true ,
} ,
{
2024-06-19 11:34:34 -04:00
Url : "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.29.0/crictl-v1.29.0-linux-amd64.tar.gz" , // renovate:crictl-release
Hash : "sha256:d16a1ffb3938f5a19d5c8f45d363bd091ef89c0bc4d44ad16b933eede32fdcbb" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . BinDir ,
Extract : true ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.29.7/bin/linux/amd64/kubelet" , // renovate:kubernetes-release
Hash : "sha256:f16329e64f5b2204c1cb906f694abebb7f6869d56e6e8b60b54afa0057006b84" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . KubeletPath ,
Extract : false ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.29.7/bin/linux/amd64/kubeadm" , // renovate:kubernetes-release
Hash : "sha256:7699c6f06fbc8e813766b8237de69a095ad820fe484856ffd921a7894b5af605" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . KubeadmPath ,
Extract : false ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.29.7/bin/linux/amd64/kubectl" , // renovate:kubernetes-release
Hash : "sha256:e3df008ef60ea50286ea93c3c40a020e178a338cea64a185b4e21792d88c75d6" ,
2022-11-14 13:09:49 -05:00
InstallPath : constants . KubectlPath ,
Extract : false ,
} ,
2023-12-14 08:51:10 -05:00
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjI5LjdAc2hhMjU2OjdiMTA0NzcxYzEzYjllMzUzNzg0NmMzZjY5NDkwMDA3ODVlMWZiYzY2ZDA3ZjEyM2ViY2VhMjJjOGViOTE4YjMifV0=" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-apiserver" ) ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjI5LjdAc2hhMjU2OmUzMzU2ZjA3OGY3Y2U3Mjk4NDM4NWQ0Y2E1ZTcyNmE4Y2IwNWNlMzU1ZDZiMTU4ZjQxYWE5YjVkYmFmZjliMTkifV0=" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-controller-manager" ) ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjI5LjdAc2hhMjU2OmM2MjAzZmJjMTAyY2M4MGE3ZDkzNDk0NmI3ZWFjYjc0OTE0ODBhNjVkYjU2ZGIyMDNjYjMwMzVkZWVjYWFhMzkifV0=" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-scheduler" ) ,
} ,
2023-12-21 14:56:55 -05:00
{
2024-04-25 08:03:24 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjEyLTBAc2hhMjU2OjQ0YThlMjRkY2JiYTM0NzBlZTFmZWUyMWQ1ZTg4ZDEyOGM5MzZlOWI1NWQ0YmM1MWZiZWY4MDg2ZjhlZDEyM2IifV0=" ,
2023-12-21 14:56:55 -05:00
InstallPath : patchFilePath ( "etcd" ) ,
} ,
2022-11-10 09:20:10 -05:00
} ,
2022-10-24 10:13:26 -04:00
// CloudControllerManagerImageAWS is the CCM image used on AWS.
2024-06-19 11:34:34 -04:00
// Check for newer versions at https://github.com/kubernetes/cloud-provider-aws/releases.
CloudControllerManagerImageAWS : "registry.k8s.io/provider-aws/cloud-controller-manager:v1.29.3@sha256:26a61ab55d8be6365348b78c3cf691276a7b078c58dd789729704fb56bcaac8c" , // 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.
2024-08-22 17:42:05 -04:00
CloudControllerManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.29.9@sha256:bbeda8d6d36fc12d07314714b88e5f0433c2ae61feb59cd62fbe05d2f3c2aa17" , // 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.
2024-08-22 17:42:05 -04:00
CloudNodeManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.29.9@sha256:175d52f1d48d1b947823974166bcdd403c0644c5bca6f7275a3087d29fe8f36d" , // renovate:container
2023-03-17 04:44:30 -04:00
// CloudControllerManagerImageGCP is the CCM image used on GCP.
2024-06-19 11:34:34 -04:00
CloudControllerManagerImageGCP : "ghcr.io/edgelesssys/cloud-provider-gcp:v29.5.0@sha256:4b17e16f9b5dfa20c9ff62cb382c3f754b70ed36be7f85cc3f46213dae21ec91" , // 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.
2024-08-22 19:17:24 -04:00
ClusterAutoscalerImage : "registry.k8s.io/autoscaling/cluster-autoscaler:v1.29.4@sha256:786728c85787a58c6376b47d2e22cc04db3ecfdd73a52b5b9be20fd869abce2f" , // renovate:container
2022-12-09 10:30:21 -05:00
} ,
2024-06-19 11:34:34 -04:00
V1_30 : {
2024-08-26 03:18:56 -04:00
ClusterVersion : "v1.30.3" , // renovate:kubernetes-release
2023-01-06 06:04:36 -05:00
KubernetesComponents : components . Components {
2022-12-09 10:30:21 -05:00
{
2024-01-08 10:53:12 -05:00
Url : "https://github.com/containernetworking/plugins/releases/download/v1.4.0/cni-plugins-linux-amd64-v1.4.0.tgz" , // renovate:cni-plugins-release
Hash : "sha256:c2485ddb3ffc176578ae30ae58137f0b88e50f7c7f2af7d53a569276b2949a33" ,
2022-12-09 10:30:21 -05:00
InstallPath : constants . CniPluginsDir ,
Extract : true ,
} ,
{
2024-06-19 11:34:34 -04:00
Url : "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.30.0/crictl-v1.30.0-linux-amd64.tar.gz" , // renovate:crictl-release
Hash : "sha256:3dd03954565808eaeb3a7ffc0e8cb7886a64a9aa94b2bfdfbdc6e2ed94842e49" ,
2022-12-09 10:30:21 -05:00
InstallPath : constants . BinDir ,
Extract : true ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.30.3/bin/linux/amd64/kubelet" , // renovate:kubernetes-release
Hash : "sha256:9a37ddd5ea026639b7d85e98fa742e392df7aa5ec917bed0711a451613de3c1c" ,
2022-12-09 10:30:21 -05:00
InstallPath : constants . KubeletPath ,
Extract : false ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.30.3/bin/linux/amd64/kubeadm" , // renovate:kubernetes-release
Hash : "sha256:bb78c2a27027278ee644d523f583ed7fdba48b4fbf31e3cfb0e309b6457dda69" ,
2022-12-09 10:30:21 -05:00
InstallPath : constants . KubeadmPath ,
Extract : false ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "https://storage.googleapis.com/kubernetes-release/release/v1.30.3/bin/linux/amd64/kubectl" , // renovate:kubernetes-release
Hash : "sha256:abd83816bd236b266c3643e6c852b446f068fe260f3296af1a25b550854ec7e5" ,
2022-12-09 10:30:21 -05:00
InstallPath : constants . KubectlPath ,
Extract : false ,
} ,
2023-12-14 08:51:10 -05:00
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjMwLjNAc2hhMjU2OmEzNmQ1NTg4MzVlNDg5NTBmNmQxM2IxZWRiZTIwNjA1YjhkZmJjODFlMDg4ZjU4MjIxNzk2NjMxZTEwNzk2NmMifV0=" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-apiserver" ) ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjMwLjNAc2hhMjU2OmVmZjQzZGE1NWEyOWE1ZTY2ZWM5NDgwZjI4MjMzZDczM2E2YTg0MzNiN2E0NmY2ZThjMDcwODZmYTRlZjY5YjcifV0=" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-controller-manager" ) ,
} ,
{
2024-08-26 03:18:56 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjMwLjNAc2hhMjU2OjIxNDdhYjVkMmM3M2RkODRlMjgzMzJmY2JlZTY4MjZkMTY0OGVlZDMwYTUzMWE1MmE5NjUwMWIzN2Q3ZWU0ZTQifV0=" ,
2023-12-14 08:51:10 -05:00
InstallPath : patchFilePath ( "kube-scheduler" ) ,
} ,
2023-12-21 14:56:55 -05:00
{
2024-04-25 08:03:24 -04:00
Url : "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjEyLTBAc2hhMjU2OjQ0YThlMjRkY2JiYTM0NzBlZTFmZWUyMWQ1ZTg4ZDEyOGM5MzZlOWI1NWQ0YmM1MWZiZWY4MDg2ZjhlZDEyM2IifV0=" ,
2023-12-21 14:56:55 -05:00
InstallPath : patchFilePath ( "etcd" ) ,
} ,
2022-12-09 10:30:21 -05:00
} ,
// CloudControllerManagerImageAWS is the CCM image used on AWS.
2024-06-19 11:34:34 -04:00
// Check for newer versions at https://github.com/kubernetes/cloud-provider-aws/releases.
CloudControllerManagerImageAWS : "registry.k8s.io/provider-aws/cloud-controller-manager:v1.30.1@sha256:ee0e0c0de56e7dace71e2b4a0e45dcdae84e325c78f72c5495b109976fb3362c" , // 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.
2024-08-22 17:42:05 -04:00
CloudControllerManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.30.5@sha256:932215506d0701783dd60e26ebe21ca3381eaa6517cf769aae339a082c2638f7" , // 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.
2024-08-22 17:42:05 -04:00
CloudNodeManagerImageAzure : "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.30.5@sha256:16203c47820604328950e7b7bbf6fd103aec51e1c13c2a3689546e0ba6119b2c" , // renovate:container
2023-03-17 04:44:30 -04:00
// CloudControllerManagerImageGCP is the CCM image used on GCP.
2024-06-19 11:34:34 -04:00
CloudControllerManagerImageGCP : "ghcr.io/edgelesssys/cloud-provider-gcp:v30.0.0@sha256:529382b3a16cee9d61d4cfd9b8ba74fff51856ae8cbaf1825c075112229284d9" , // 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.
2024-08-22 19:17:24 -04:00
ClusterAutoscalerImage : "registry.k8s.io/autoscaling/cluster-autoscaler:v1.30.2@sha256:ef370d1d06a1603c4b1e47e64bb27c3ff51cb20680712dc3d41c34f3fbf7be9f" , // renovate:container
2022-09-02 08:05:44 -04:00
} ,
2022-07-21 08:41:07 -04:00
}
2023-12-11 02:08:55 -05:00
// KubernetesVersion bundles download Urls to all version-releated binaries necessary for installing/deploying a particular Kubernetes version.
2022-07-21 08:41:07 -04:00
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.
2024-06-19 11:34:34 -04: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 04:44:30 -04:00
CloudControllerManagerImageOpenStack string // k8s version dependency.
2024-06-19 11:34:34 -04:00
CloudNodeManagerImageAzure string // k8s version dependency. Same version as Azure's CCM image above.
2023-03-17 04:44:30 -04:00
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
}