Skip to content

Commit

Permalink
Added support for K8s v1.25 (#804)
Browse files Browse the repository at this point in the history
Signed-off-by: Dharmjit Singh <[email protected]>
  • Loading branch information
Dharmjit Singh authored Jun 28, 2023
1 parent 3991f05 commit 9a8a2f3
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 37 deletions.
5 changes: 1 addition & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
Expand All @@ -35,17 +34,15 @@ linters:
- misspell
- nakedret
- noctx
- nolintlint
# - nolintlint
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- testpackage
- typecheck
- unconvert
# - unparam
- unused
- varcheck
- whitespace

# don't enable:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ If someone wants to implement their own installer controller then they need to f
- BYOH is currently compatible wth Cluster API v1beta1 (v1.0)

## Supported OS and Kubernetes versions
| Operating System | Architecture | Kubernetes v1.22.* | Kubernetes v1.23.* | Kubernetes v1.24.* |
| ------------------|---------------|:------------------:|:------------------:|:------------------:|
| Ubuntu 20.04.* | amd64 ||||
| Operating System | Architecture | Kubernetes v1.22.* | Kubernetes v1.23.* | Kubernetes v1.24.* | Kubernetes v1.25.* |
| ------------------|---------------|:------------------:|:------------------:|:------------------:|:------------------:|
| Ubuntu 20.04.* | amd64 |||||

**NOTE:** The '*' in OS means that all Ubuntu 20.04 patches are supported.

Expand Down
2 changes: 1 addition & 1 deletion docs/BYOHDockerFileDev
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN echo "Installing kubectl kubeadm kubelet" \
&& curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& apt-get update \
&& apt-get install -y linux-image-$(uname -r) \
&& apt-get install -y kubelet=1.24.2-00 kubeadm=1.24.2-00 kubectl=1.24.2-00 \
&& apt-get install -y kubelet=1.25.11-00 kubeadm=1.25.11-00 kubectl=1.25.11-00 \
&& apt-mark hold containerd kubelet kubeadm kubectl \
&& apt-get clean \
&& systemctl enable kubelet.service \
Expand Down
6 changes: 3 additions & 3 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Generate the cluster.yaml for workload cluster
```shell
CONTROL_PLANE_ENDPOINT_IP=10.10.10.10 clusterctl generate cluster byoh-cluster \
--infrastructure byoh \
--kubernetes-version v1.24.2 \
--kubernetes-version v1.25.11 \
--control-plane-machine-count 1 \
--worker-machine-count 1 > cluster.yaml
```
Expand All @@ -214,7 +214,7 @@ Generate the cluster.yaml for workload cluster
```shell
CONTROL_PLANE_ENDPOINT_IP=10.10.10.10 clusterctl generate cluster byoh-cluster \
--infrastructure byoh \
--kubernetes-version v1.24.2 \
--kubernetes-version v1.25.11 \
--control-plane-machine-count 1 \
--worker-machine-count 1 \
--flavor docker > cluster.yaml
Expand Down Expand Up @@ -253,7 +253,7 @@ after that you should see your nodes turn into ready:
```shell
$ KUBECONFIG=byoh-cluster.kubeconfig kubectl get nodes
NAME STATUS ROLES AGE VERSION
byoh-cluster-8siai8 Ready master 5m v1.24.2
byoh-cluster-8siai8 Ready master 5m v1.25.11
```
## Additional: Running host-agent as a systemd service
Expand Down
5 changes: 5 additions & 0 deletions docs/local_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ Note: It may happen that a specific patch version of a k8s minor release is not
<td>v1.24.*</td>
<td>byoh-bundle-ubuntu_20.04.1_x86-64_k8s:v1.24.*</td>
</tr>
<tr>
<td>Ubuntu_20.04.*_x86-64</td>
<td>v1.25.*</td>
<td>byoh-bundle-ubuntu_20.04.1_x86-64_k8s:v1.25.*</td>
</tr>
</table>
The '*' in OS means that all Ubuntu 20.04 patches will be handled by this BYOH bundle.

Expand Down
2 changes: 1 addition & 1 deletion hack/getting_started.sh
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ manageClusterConfFile="${HOME}/.kube/management-cluster.conf"
kubeConfigFile=/tmp/byoh-cluster-kubeconfig
reposDir=$(dirname $0)/../
byohBinaryFile=${reposDir}/bin/byoh-hostagent-linux-amd64
kubernetesVersion="v1.24.2"
kubernetesVersion="v1.25.11"

readArgs $@
userConfirmation
Expand Down
4 changes: 2 additions & 2 deletions installer/bundle_builder/ingredients/deb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ ARG BASE_IMAGE=ubuntu:20.04
FROM $BASE_IMAGE as build

# Override to download other version
ENV CONTAINERD_VERSION=1.6.8
ENV KUBERNETES_VERSION=1.24.2-00
ENV CONTAINERD_VERSION=1.6.18
ENV KUBERNETES_VERSION=1.25.11-00
ENV ARCH=amd64

RUN apt-get update \
Expand Down
2 changes: 1 addition & 1 deletion installer/bundle_builder/ingredients/deb/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo Download containerd
curl -LOJR https://github.com/containerd/containerd/releases/download/v${CONTAINERD_VERSION}/cri-containerd-cni-${CONTAINERD_VERSION}-linux-amd64.tar.gz

echo Download the Google Cloud public signing key
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://dl.k8s.io/apt/doc/apt-key.gpg

echo Add the Kubernetes apt repository
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
Expand Down
3 changes: 2 additions & 1 deletion installer/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ func GetSupportedRegistry() registry {

// BYOH Bundle Repository. Associate bundle with installer
linuxDistro := "Ubuntu_20.04.1_x86-64"
reg.AddBundleInstaller(linuxDistro, "v1.22.*")
reg.AddBundleInstaller(linuxDistro, "v1.23.*")
reg.AddBundleInstaller(linuxDistro, "v1.24.*")
reg.AddBundleInstaller(linuxDistro, "v1.25.*")

/*
* PLACEHOLDER - ADD MORE K8S VERSIONS HERE
Expand All @@ -127,6 +127,7 @@ func GetSupportedRegistry() registry {
reg.AddK8sFilter("v1.22.*")
reg.AddK8sFilter("v1.23.*")
reg.AddK8sFilter("v1.24.*")
reg.AddK8sFilter("v1.25.*")

// Match concrete os version to repository os version
reg.AddOsFilter("Ubuntu_20.04.*_x86-64", linuxDistro)
Expand Down
2 changes: 1 addition & 1 deletion installer/registry_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var _ = Describe("Byohost Installer Tests", func() {
Expect(osBundles).To(HaveLen(1))

osBundleResult := r.ListK8s("Ubuntu_20.04.1_x86-64")
Expect(osBundleResult).To(ContainElements("v1.22.*", "v1.23.*", "v1.24.*"))
Expect(osBundleResult).To(ContainElements("v1.23.*", "v1.24.*", "v1.25.*"))
Expect(osBundleResult).To(HaveLen(3))
})
})
Expand Down
3 changes: 1 addition & 2 deletions scripts/fetch_ext_bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [[ -n "${TRACE}" ]]; then
set -x
fi

k8s_version=1.24.2
k8s_version=1.25.0
goarch=amd64
goos="unknown"

Expand Down Expand Up @@ -87,7 +87,6 @@ function fetch_tools {

function setup_envs {
header_text "setting up kubebuilder-tools@${k8s_version} env vars"

# Setup env vars
export PATH=${tmp_root}/kubebuilder/bin:$PATH
export TEST_ASSET_KUBECTL=${tmp_root}/kubebuilder/bin/kubectl
Expand Down
15 changes: 8 additions & 7 deletions test/e2e/cluster_upgrade_test.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// Copyright 2022 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//nolint: testpackage
// nolint: testpackage
package e2e

import (
"context"
"fmt"
"os"
"path/filepath"

"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
"os"
"path/filepath"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
"sigs.k8s.io/cluster-api/util"
Expand All @@ -33,10 +34,10 @@ var _ = Describe("Cluster upgrade test [K8s-upgrade]", func() {
dockerClient *client.Client
allbyohostContainerIDs []string
allAgentLogFiles []string
kubernetesVersionUpgradeFrom = "v1.23.5"
kubernetesVersionUpgradeTo = "v1.24.2"
etcdUpgradeVersion = "3.5.1-0"
coreDNSUpgradeVersion = "v1.8.6"
kubernetesVersionUpgradeFrom = "v1.24.2"
kubernetesVersionUpgradeTo = "v1.25.11"
etcdUpgradeVersion = "3.5.6-0"
coreDNSUpgradeVersion = "v1.9.3"
)

BeforeEach(func() {
Expand Down
15 changes: 8 additions & 7 deletions test/e2e/clusterclass_upgrade_test.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// Copyright 2022 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//nolint: testpackage
// nolint: testpackage
package e2e

import (
"context"
"fmt"
"os"
"path/filepath"

"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
"os"
"path/filepath"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
"sigs.k8s.io/cluster-api/util"
Expand All @@ -33,10 +34,10 @@ var _ = Describe("Clusterclass upgrade test [K8s-upgrade]", func() {
dockerClient *client.Client
allbyohostContainerIDs []string
allAgentLogFiles []string
kubernetesVersionUpgradeFrom = "v1.23.5"
kubernetesVersionUpgradeTo = "v1.24.2"
etcdUpgradeVersion = "3.5.1-0"
coreDNSUpgradeVersion = "v1.8.6"
kubernetesVersionUpgradeFrom = "v1.24.2"
kubernetesVersionUpgradeTo = "v1.25.11"
etcdUpgradeVersion = "3.5.6-0"
coreDNSUpgradeVersion = "v1.9.3"
)

BeforeEach(func() {
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/config/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ providers:
variables:
# default variables for the e2e test; those values could be overridden via env variables, thus
# allowing the same e2e config file to be re-used in different prow jobs e.g. each one with a K8s version permutation
KUBERNETES_VERSION: "v1.24.2"
ETCD_VERSION_UPGRADE_TO: "3.4.9-0"
COREDNS_VERSION_UPGRADE_TO: "1.7.0"
KUBERNETES_VERSION: "v1.25.11"
ETCD_VERSION_UPGRADE_TO: "3.5.6-0"
COREDNS_VERSION_UPGRADE_TO: "1.9.3"
KUBERNETES_VERSION_UPGRADE_TO: "v1.22.0"
KUBERNETES_VERSION_UPGRADE_FROM: "v1.18.2"
DOCKER_SERVICE_DOMAIN: "cluster.local"
Expand All @@ -97,7 +97,7 @@ variables:
NODE_DRAIN_TIMEOUT: "60s"
# NOTE: INIT_WITH_BINARY is used only by the clusterctl upgrade test to initialize the management cluster to be upgraded
INIT_WITH_BINARY: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.1.3/clusterctl-{OS}-{ARCH}"
BUNDLE_LOOKUP_TAG: "v1.24.2"
BUNDLE_LOOKUP_TAG: "v1.25.11"
CONTROL_PLANE_ENDPOINT_IP: ""
MANUAL_CSR_APPROVAL: "disable"

Expand Down

0 comments on commit 9a8a2f3

Please sign in to comment.