mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
782752080f
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
424 lines
24 KiB
Go
424 lines
24 KiB
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
/*
|
|
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.
|
|
*/
|
|
package versions
|
|
|
|
import (
|
|
"fmt"
|
|
"path"
|
|
"sort"
|
|
"strings"
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/compatibility"
|
|
"github.com/edgelesssys/constellation/v2/internal/constants"
|
|
"github.com/edgelesssys/constellation/v2/internal/versions/components"
|
|
"golang.org/x/mod/semver"
|
|
)
|
|
|
|
// SupportedK8sVersions returns a list (sorted) of supported Kubernetes versions.
|
|
func SupportedK8sVersions() []string {
|
|
validVersions := make([]string, len(VersionConfigs))
|
|
i := 0
|
|
for _, conf := range VersionConfigs {
|
|
validVersions[i] = compatibility.EnsurePrefixV(conf.ClusterVersion)
|
|
i++
|
|
}
|
|
validVersionsSorted := semver.ByVersion(validVersions)
|
|
sort.Sort(validVersionsSorted)
|
|
|
|
return validVersionsSorted
|
|
}
|
|
|
|
// ValidK8sVersion represents any of the three currently supported k8s versions.
|
|
type ValidK8sVersion string
|
|
|
|
// NewValidK8sVersion validates the given string and produces a new ValidK8sVersion object.
|
|
// It accepts a full version (e.g. 1.26.7) and validates it.
|
|
// Returns an empty string if the given version is invalid.
|
|
// strict controls whether the patch version is checked or not.
|
|
// If strict is false, the patch version validation is skipped.
|
|
func NewValidK8sVersion(k8sVersion string, strict bool) (ValidK8sVersion, error) {
|
|
prefixedVersion := compatibility.EnsurePrefixV(k8sVersion)
|
|
var supported bool
|
|
if strict {
|
|
supported = isSupportedK8sVersionStrict(prefixedVersion)
|
|
} else {
|
|
supported = isSupportedK8sVersion(prefixedVersion)
|
|
}
|
|
if !supported {
|
|
return "", fmt.Errorf("invalid Kubernetes version: %s; supported versions are %v", prefixedVersion, SupportedK8sVersions())
|
|
}
|
|
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())
|
|
}
|
|
|
|
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)
|
|
case semver.MajorMinor(string(V1_29)):
|
|
return string(V1_29)
|
|
case semver.MajorMinor(string(V1_30)):
|
|
return string(V1_30)
|
|
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()
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// IsSupportedK8sVersion checks if a given Kubernetes version is supported by Constellation.
|
|
func isSupportedK8sVersionStrict(version string) bool {
|
|
for _, valid := range SupportedK8sVersions() {
|
|
if valid == version {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// IsPreviewK8sVersion checks if a given Kubernetes version is still in preview and not fully supported.
|
|
func IsPreviewK8sVersion(_ ValidK8sVersion) bool {
|
|
return false
|
|
}
|
|
|
|
// hasPatchVersion returns if the given version has specified a patch version.
|
|
func hasPatchVersion(version string) bool {
|
|
return semver.MajorMinor(version) != version
|
|
}
|
|
|
|
// 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))
|
|
}
|
|
|
|
const (
|
|
//
|
|
// Constellation images.
|
|
// These images are built in a way that they support all versions currently listed in VersionConfigs.
|
|
//
|
|
|
|
// GcpGuestImage image for GCP guest agent.
|
|
// Check for new versions at https://github.com/GoogleCloudPlatform/guest-agent/releases and update in /.github/workflows/build-gcp-guest-agent.yml.
|
|
GcpGuestImage = "ghcr.io/edgelesssys/gcp-guest-agent:v20240611.1.0@sha256:e751fda68957a70c8494999115aba2ccbc1e2f31d85986b7e133cbe02187da23" // renovate:container
|
|
// NodeMaintenanceOperatorImage is the image for the node maintenance operator.
|
|
NodeMaintenanceOperatorImage = "quay.io/medik8s/node-maintenance-operator:v0.15.0@sha256:8cb8dad93283268282c30e75c68f4bd76b28def4b68b563d2f9db9c74225d634" // renovate:container
|
|
// LogstashImage is the container image of logstash, used for log collection by debugd.
|
|
LogstashImage = "ghcr.io/edgelesssys/constellation/logstash-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:d6c5a06049e5c1b9d7ba4b83367fa0c06ba2d1b65e1d299f3e00f465f310642b" // renovate:container
|
|
// FilebeatImage is the container image of filebeat, used for log collection by debugd.
|
|
FilebeatImage = "ghcr.io/edgelesssys/constellation/filebeat-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:606adccf544a15e6b9ae9e11eec707668660bc1af346ff72559404e36da5baa2" // renovate:container
|
|
// MetricbeatImage is the container image of filebeat, used for log collection by debugd.
|
|
MetricbeatImage = "ghcr.io/edgelesssys/constellation/metricbeat-debugd:v2.17.0-pre.0.20240627193502-8aed4bb0fe45@sha256:690b9d36cc334a7f83b58ca905169bb9f1c955b7a436c0044a07f4ce15a90594" // renovate:container
|
|
|
|
// currently supported versions.
|
|
//nolint:revive
|
|
V1_28 ValidK8sVersion = "v1.28.11" // renovate:kubernetes-release
|
|
//nolint:revive
|
|
V1_29 ValidK8sVersion = "v1.29.6" // renovate:kubernetes-release
|
|
//nolint:revive
|
|
V1_30 ValidK8sVersion = "v1.30.2" // renovate:kubernetes-release
|
|
|
|
// Default k8s version deployed by Constellation.
|
|
Default ValidK8sVersion = V1_29
|
|
)
|
|
|
|
// 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.
|
|
//go:generate hash-generator
|
|
|
|
// VersionConfigs holds download URLs for all required kubernetes components for every supported version.
|
|
var VersionConfigs = map[ValidK8sVersion]KubernetesVersion{
|
|
V1_28: {
|
|
ClusterVersion: "v1.28.11", // renovate:kubernetes-release
|
|
KubernetesComponents: components.Components{
|
|
{
|
|
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",
|
|
InstallPath: constants.CniPluginsDir,
|
|
Extract: true,
|
|
},
|
|
{
|
|
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",
|
|
InstallPath: constants.BinDir,
|
|
Extract: true,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.28.11/bin/linux/amd64/kubelet", // renovate:kubernetes-release
|
|
Hash: "sha256:230f0634ea42a54a6c96771f12eecd6cadfe0b76ab41c3bc39aa7cbbe4dfb12e",
|
|
InstallPath: constants.KubeletPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.28.11/bin/linux/amd64/kubeadm", // renovate:kubernetes-release
|
|
Hash: "sha256:1f2c7c69736698aa13a59c6705ac26b7b6752d9651330605369357c1ac99c7c6",
|
|
InstallPath: constants.KubeadmPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.28.11/bin/linux/amd64/kubectl", // renovate:kubernetes-release
|
|
Hash: "sha256:1dba63e1a5c9520fc516c6e817924d927b9b83b8e08254c8fe2a2edb65da7a9c",
|
|
InstallPath: constants.KubectlPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjI4LjExQHNoYTI1NjphZWM5ZDE3MDFjMzA0ZWVlODYwN2Q3MjhhMzliYWFhNTExZDY1YmVmNmRkOTg2MTAxMDYxOGY2M2ZiYWRlYjEwIn1d",
|
|
InstallPath: patchFilePath("kube-apiserver"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjI4LjExQHNoYTI1Njo2MDE0YzM1NzJlYzY4Mzg0MWJiYjE2Zjg3Yjk0ZGEyOGVlMDI1NGI5NWUyZGJhMmQxODUwZDYyYmQwMTExZjA5In1d",
|
|
InstallPath: patchFilePath("kube-controller-manager"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjI4LjExQHNoYTI1Njo0NmNmNzQ3NWM4ZGFmZmI3NDNjODU2YTFhZWEwZGRlYTM1ZTVhY2QyNDE4YmUxOGIxZTIyY2Y5OGQ5YzliNDQ1In1d",
|
|
InstallPath: patchFilePath("kube-scheduler"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjEyLTBAc2hhMjU2OjQ0YThlMjRkY2JiYTM0NzBlZTFmZWUyMWQ1ZTg4ZDEyOGM5MzZlOWI1NWQ0YmM1MWZiZWY4MDg2ZjhlZDEyM2IifV0=",
|
|
InstallPath: patchFilePath("etcd"),
|
|
},
|
|
},
|
|
// CloudControllerManagerImageAWS is the CCM image used on AWS.
|
|
// 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
|
|
// 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.
|
|
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.28.9@sha256:7abf813ad41b8f1ed91f50bfefb6f285b367664c57758af0b5a623b65f55b34b", // renovate:container
|
|
// 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.
|
|
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.28.9@sha256:65285c13cc3eced1005a1c6c5f727570d781ac25f421a9e5cf169de8d7e1d6a9", // renovate:container
|
|
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
|
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v28.10.0@sha256:f3b6fa7faea27b4a303c91b3bc7ee192b050e21e27579e9f3da90ae4ba38e626", // renovate:container
|
|
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
|
|
CloudControllerManagerImageOpenStack: "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0", // renovate:container
|
|
// External service image. Depends on k8s version.
|
|
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
|
|
ClusterAutoscalerImage: "registry.k8s.io/autoscaling/cluster-autoscaler:v1.28.5@sha256:d82acf2ae3287227b979fa7068dae7c2db96de22c96295d2e89029065e895bca", // renovate:container
|
|
},
|
|
V1_29: {
|
|
ClusterVersion: "v1.29.6", // renovate:kubernetes-release
|
|
KubernetesComponents: components.Components{
|
|
{
|
|
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",
|
|
InstallPath: constants.CniPluginsDir,
|
|
Extract: true,
|
|
},
|
|
{
|
|
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",
|
|
InstallPath: constants.BinDir,
|
|
Extract: true,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.29.6/bin/linux/amd64/kubelet", // renovate:kubernetes-release
|
|
Hash: "sha256:a946789d4fef64e6f5905dbd7dca01d4c3abd302d0da7958fdaa924fe2729c0b",
|
|
InstallPath: constants.KubeletPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.29.6/bin/linux/amd64/kubeadm", // renovate:kubernetes-release
|
|
Hash: "sha256:8f1e04079e614dd549e36be8114ee7022517d646ea715b5778e7c6ab353eb354",
|
|
InstallPath: constants.KubeadmPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.29.6/bin/linux/amd64/kubectl", // renovate:kubernetes-release
|
|
Hash: "sha256:339553c919874ebe3b719e9e1fcd68b55bc8875f9b5a005cf4c028738d54d309",
|
|
InstallPath: constants.KubectlPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjI5LjZAc2hhMjU2OmY0ZDk5M2IzZDczY2MwZDU5NTU4YmU1ODRiNWI0MDc4NWI0YTk2ODc0YmM3Njg3M2I2OWQxZGQ4MTg0ODVlNzAifV0=",
|
|
InstallPath: patchFilePath("kube-apiserver"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjI5LjZAc2hhMjU2OjY5MmZjM2Y4OGE2MGIzYWZjNzY0OTJhZDM0NzMwNmQzNDA0MjAwMGY1NmYyMzA5NTllOTM2N2ZkNTljNDhiMWUifV0=",
|
|
InstallPath: patchFilePath("kube-controller-manager"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjI5LjZAc2hhMjU2OmI5MWE0ZTQ1ZGViZDBkNTMzNmQ5ZjUzM2FlZmRmNDdkNGIzOWIyNDA3MWZlYjQ1OWU1MjE3MDliOWU0ZWMyNGYifV0=",
|
|
InstallPath: patchFilePath("kube-scheduler"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjEyLTBAc2hhMjU2OjQ0YThlMjRkY2JiYTM0NzBlZTFmZWUyMWQ1ZTg4ZDEyOGM5MzZlOWI1NWQ0YmM1MWZiZWY4MDg2ZjhlZDEyM2IifV0=",
|
|
InstallPath: patchFilePath("etcd"),
|
|
},
|
|
},
|
|
// CloudControllerManagerImageAWS is the CCM image used on AWS.
|
|
// 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
|
|
// 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.
|
|
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.29.7@sha256:01f3e57f0dfed05a940face4f1a543eed613e3bfbfb1983997f75a4a11a6e0bb", // renovate:container
|
|
// 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.
|
|
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.29.7@sha256:79f1ebd0f462713dd20b9630ae177ab1b1dc14f0faae7c8fd4837e8d494d11b9", // renovate:container
|
|
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
|
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v29.5.0@sha256:4b17e16f9b5dfa20c9ff62cb382c3f754b70ed36be7f85cc3f46213dae21ec91", // renovate:container
|
|
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
|
|
CloudControllerManagerImageOpenStack: "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0", // renovate:container
|
|
// External service image. Depends on k8s version.
|
|
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
|
|
ClusterAutoscalerImage: "registry.k8s.io/autoscaling/cluster-autoscaler:v1.29.3@sha256:ea973cf727ff98a0c8c8f770a0787c26a86604182565ce180a5665936f3b38bc", // renovate:container
|
|
},
|
|
V1_30: {
|
|
ClusterVersion: "v1.30.2", // renovate:kubernetes-release
|
|
KubernetesComponents: components.Components{
|
|
{
|
|
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",
|
|
InstallPath: constants.CniPluginsDir,
|
|
Extract: true,
|
|
},
|
|
{
|
|
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",
|
|
InstallPath: constants.BinDir,
|
|
Extract: true,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.30.2/bin/linux/amd64/kubelet", // renovate:kubernetes-release
|
|
Hash: "sha256:6923abe67ef069afca61c71c585023840426e802b198298055af3a82e11a4e52",
|
|
InstallPath: constants.KubeletPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.30.2/bin/linux/amd64/kubeadm", // renovate:kubernetes-release
|
|
Hash: "sha256:672b0cae2accce5eac10a1fe4ea6b166e5b518c79ccf71a2fbe7b53c2ca74062",
|
|
InstallPath: constants.KubeadmPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "https://storage.googleapis.com/kubernetes-release/release/v1.30.2/bin/linux/amd64/kubectl", // renovate:kubernetes-release
|
|
Hash: "sha256:c6e9c45ce3f82c90663e3c30db3b27c167e8b19d83ed4048b61c1013f6a7c66e",
|
|
InstallPath: constants.KubectlPath,
|
|
Extract: false,
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtYXBpc2VydmVyOnYxLjMwLjJAc2hhMjU2OjM0MGFiNGExZDY2YTYwNjMwYTdhMjk4YWEwYjI1NzZmY2Q4MmU1MWVjZGRkYjc1MWNmNjFlNWQzODQ2ZmRlMmQifV0=",
|
|
InstallPath: patchFilePath("kube-apiserver"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtY29udHJvbGxlci1tYW5hZ2VyOnYxLjMwLjJAc2hhMjU2OjRjNDEyYmMxZmM1ODVkZGViYTEwZDM0YTAyZTc1MDdlYTc4N2VjMmM1NzI1NmQ0YzE4ZmQyMzAzNzdhYjA0OGUifV0=",
|
|
InstallPath: patchFilePath("kube-controller-manager"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2t1YmUtc2NoZWR1bGVyOnYxLjMwLjJAc2hhMjU2OjBlZDc1YTMzMzcwNGY1ZDMxNTM5NWM2ZWMwNGQ3YWY3NDA1NzE1NTM3MDY5YjY1ZDQwYjQzZWMxYzhlMDMwYmMifV0=",
|
|
InstallPath: patchFilePath("kube-scheduler"),
|
|
},
|
|
{
|
|
Url: "data:application/json;base64,W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6Ii9zcGVjL2NvbnRhaW5lcnMvMC9pbWFnZSIsInZhbHVlIjoicmVnaXN0cnkuazhzLmlvL2V0Y2Q6My41LjEyLTBAc2hhMjU2OjQ0YThlMjRkY2JiYTM0NzBlZTFmZWUyMWQ1ZTg4ZDEyOGM5MzZlOWI1NWQ0YmM1MWZiZWY4MDg2ZjhlZDEyM2IifV0=",
|
|
InstallPath: patchFilePath("etcd"),
|
|
},
|
|
},
|
|
// CloudControllerManagerImageAWS is the CCM image used on AWS.
|
|
// 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
|
|
// 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.
|
|
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.30.3@sha256:0c74b1d476f30bcd4c68d1bb2cce6957f9dfeae529b7260f21b0059e0a6b4450", // renovate:container
|
|
// 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.
|
|
CloudNodeManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-node-manager:v1.30.3@sha256:7605738917b4f9c55dba985073724de359d97f02688f62e65b4173491b2697ce", // renovate:container
|
|
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
|
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v30.0.0@sha256:529382b3a16cee9d61d4cfd9b8ba74fff51856ae8cbaf1825c075112229284d9", // renovate:container
|
|
// CloudControllerManagerImageOpenStack is the CCM image used on OpenStack.
|
|
CloudControllerManagerImageOpenStack: "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.26.4@sha256:05e846fb13481b6dbe4a1e50491feb219e8f5101af6cf662a086115735624db0", // renovate:container
|
|
// External service image. Depends on k8s version.
|
|
// Check for new versions at https://github.com/kubernetes/autoscaler/releases.
|
|
ClusterAutoscalerImage: "registry.k8s.io/autoscaling/cluster-autoscaler:v1.30.1@sha256:21a0003fa059f679631a301ae09d9369e1cf6a1c063b78978844ccd494dab38a", // renovate:container
|
|
},
|
|
}
|
|
|
|
// KubernetesVersion bundles download Urls to all version-releated binaries necessary for installing/deploying a particular Kubernetes version.
|
|
type KubernetesVersion struct {
|
|
ClusterVersion string
|
|
KubernetesComponents components.Components
|
|
CloudControllerManagerImageAWS string // k8s version dependency.
|
|
CloudControllerManagerImageAzure string // k8s version dependency.
|
|
CloudControllerManagerImageGCP string // Published by .github/workflows/build-ccm-gcp.yml because of https://github.com/kubernetes/cloud-provider-gcp/issues/289.
|
|
CloudControllerManagerImageOpenStack string // k8s version dependency.
|
|
CloudNodeManagerImageAzure string // k8s version dependency. Same version as Azure's CCM image above.
|
|
ClusterAutoscalerImage string // Matches k8s versioning scheme.
|
|
}
|
|
|
|
// 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
|
|
}
|