Skip to content

Commit

Permalink
Merge pull request #129 from krunalhinguu/v1.27-k8s-march-patches
Browse files Browse the repository at this point in the history
[release v1.27] k8s v1.27.12
  • Loading branch information
kinarashah authored Mar 19, 2024
2 parents e7bd62d + 1de74be commit e4f99c0
Show file tree
Hide file tree
Showing 145 changed files with 4,443 additions and 1,507 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.7
1.21.8
308 changes: 209 additions & 99 deletions CHANGELOG/CHANGELOG-1.27.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/build-image/cross/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.27.0-go1.21.7-bullseye.0
v1.27.0-go1.21.8-bullseye.0
4 changes: 2 additions & 2 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ readonly KUBE_RSYNC_PORT="${KUBE_RSYNC_PORT:-}"
readonly KUBE_CONTAINER_RSYNC_PORT=8730

# These are the default versions (image tags) for their respective base images.
readonly __default_distroless_iptables_version=v0.4.5
readonly __default_go_runner_version=v2.3.1-go1.21.7-bullseye.0
readonly __default_distroless_iptables_version=v0.4.6
readonly __default_go_runner_version=v2.3.1-go1.21.8-bullseye.0
readonly __default_setcap_version=bullseye-v1.4.2

# These are the base images for the Docker-wrapped binaries.
Expand Down
14 changes: 7 additions & 7 deletions build/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies:

# etcd
- name: "etcd"
version: 3.5.10
version: 3.5.12
refPaths:
- path: cluster/gce/manifests/etcd.manifest
match: etcd_docker_tag|etcd_version
Expand All @@ -80,22 +80,22 @@ dependencies:
match: configs\[Etcd\] = Config{list\.GcEtcdRegistry, "etcd", "\d+\.\d+.\d+(-(alpha|beta|rc).\d+)?(-\d+)?"}

- name: "etcd-image"
version: 3.5.10
version: 3.5.12
refPaths:
- path: cluster/images/etcd/Makefile
match: BUNDLED_ETCD_VERSIONS\?|LATEST_ETCD_VERSION\?
- path: cluster/images/etcd/migrate/options.go

# From https://github.com/etcd-io/etcd/blob/main/Makefile
- name: "golang: etcd release version"
version: 1.17.13 # for etcd v3.5.6: https://github.com/etcd-io/etcd/blob/v3.5.6/Makefile#L58 golang version should be 1.16.15, BUT because of newer dependencies in our repository we use newer golang which has `unsafe.Slice`
version: 1.20.13 # https://github.com/etcd-io/etcd/blob/main/CHANGELOG/CHANGELOG-3.5.md
refPaths:
- path: cluster/images/etcd/Makefile
match: 'GOLANG_VERSION := \d+.\d+(alpha|beta|rc)?\.?(\d+)?'

# Golang
- name: "golang: upstream version"
version: 1.21.7
version: 1.21.8
refPaths:
- path: .go-version
- path: build/build-image/cross/VERSION
Expand All @@ -118,7 +118,7 @@ dependencies:
# match: minimum_go_version=go([0-9]+\.[0-9]+)

- name: "registry.k8s.io/kube-cross: dependents"
version: v1.27.0-go1.21.7-bullseye.0
version: v1.27.0-go1.21.8-bullseye.0
refPaths:
- path: build/build-image/cross/VERSION

Expand All @@ -140,15 +140,15 @@ dependencies:
match: BASE_IMAGE_VERSION\?=

- name: "registry.k8s.io/distroless-iptables: dependents"
version: v0.4.5
version: v0.4.6
refPaths:
- path: build/common.sh
match: __default_distroless_iptables_version=
- path: test/utils/image/manifest.go
match: configs\[DistrolessIptables\] = Config{list\.BuildImageRegistry, "distroless-iptables", "v([0-9]+)\.([0-9]+)\.([0-9]+)"}

- name: "registry.k8s.io/go-runner: dependents"
version: v2.3.1-go1.21.7-bullseye.0
version: v2.3.1-go1.21.8-bullseye.0
refPaths:
- path: build/common.sh
match: __default_go_runner_version=
Expand Down
4 changes: 2 additions & 2 deletions cluster/gce/manifests/etcd.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
"name": "etcd-container",
{{security_context}}
"image": "{{ pillar.get('etcd_docker_repository', 'registry.k8s.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.5.10-0') }}",
"image": "{{ pillar.get('etcd_docker_repository', 'registry.k8s.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.5.12-0') }}",
"resources": {
"requests": {
"cpu": {{ cpulimit }}
Expand All @@ -34,7 +34,7 @@
"value": "{{ pillar.get('storage_backend', 'etcd3') }}"
},
{ "name": "TARGET_VERSION",
"value": "{{ pillar.get('etcd_version', '3.5.10') }}"
"value": "{{ pillar.get('etcd_version', '3.5.12') }}"
},
{
"name": "DO_NOT_MOVE_BINARIES",
Expand Down
4 changes: 2 additions & 2 deletions cluster/gce/upgrade-aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export KUBE_GCE_ENABLE_IP_ALIASES=true
export SECONDARY_RANGE_NAME="pods-default"
export STORAGE_BACKEND="etcd3"
export STORAGE_MEDIA_TYPE="application/vnd.kubernetes.protobuf"
export ETCD_IMAGE=3.5.10-0
export ETCD_VERSION=3.5.10
export ETCD_IMAGE=3.5.12-0
export ETCD_VERSION=3.5.12

# Upgrade master with updated kube envs
"${KUBE_ROOT}/cluster/gce/upgrade.sh" -M -l
Expand Down
6 changes: 3 additions & 3 deletions cluster/images/etcd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
# Except from etcd-$(version) and etcdctl-$(version) binaries, we also
# need etcd and etcdctl binaries for backward compatibility reasons.
# That binary will be set to the last version from $(BUNDLED_ETCD_VERSIONS).
BUNDLED_ETCD_VERSIONS?=3.0.17 3.1.20 3.2.32 3.3.17 3.4.18 3.5.10
BUNDLED_ETCD_VERSIONS?=3.0.17 3.1.20 3.2.32 3.3.17 3.4.18 3.5.12

# LATEST_ETCD_VERSION identifies the most recent etcd version available.
LATEST_ETCD_VERSION?=3.5.10
LATEST_ETCD_VERSION?=3.5.12

# REVISION provides a version number for this image and all it's bundled
# artifacts. It should start at zero for each LATEST_ETCD_VERSION and increment
Expand Down Expand Up @@ -83,7 +83,7 @@ endif
# This option is for running docker manifest command
export DOCKER_CLI_EXPERIMENTAL := enabled
# golang version should match the golang version of the official build from https://github.com/etcd-io/etcd/releases.
GOLANG_VERSION := 1.17.13
GOLANG_VERSION := 1.20.13
GOARM?=7
TEMP_DIR:=$(shell mktemp -d)

Expand Down
2 changes: 1 addition & 1 deletion cluster/images/etcd/migrate/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

var (
supportedEtcdVersions = []string{"3.0.17", "3.1.20", "3.2.32", "3.3.17", "3.4.18", "3.5.9", "3.5.10"}
supportedEtcdVersions = []string{"3.0.17", "3.1.20", "3.2.32", "3.3.17", "3.4.18", "3.5.9", "3.5.12"}
)

const (
Expand Down
14 changes: 7 additions & 7 deletions cmd/kubeadm/app/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ const (
MinExternalEtcdVersion = "3.2.18"

// DefaultEtcdVersion indicates the default etcd version that kubeadm uses
DefaultEtcdVersion = "3.5.10-0"
DefaultEtcdVersion = "3.5.12-0"

// Etcd defines variable used internally when referring to etcd component
Etcd = "etcd"
Expand Down Expand Up @@ -478,12 +478,12 @@ var (
19: "3.4.13-0",
20: "3.4.13-0",
21: "3.4.13-0",
22: "3.5.7-0",
23: "3.5.7-0",
24: "3.5.7-0",
25: "3.5.7-0",
26: "3.5.7-0",
27: "3.5.10-0",
22: "3.5.12-0",
23: "3.5.12-0",
24: "3.5.12-0",
25: "3.5.12-0",
26: "3.5.12-0",
27: "3.5.12-0",
}

// KubeadmCertsClusterRoleName sets the name for the ClusterRole that allows
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/golang/protobuf v1.5.4
github.com/google/cadvisor v0.47.2
github.com/google/cel-go v0.12.7
github.com/google/gnostic v0.5.7-v3refs
Expand Down Expand Up @@ -88,7 +88,7 @@ require (
google.golang.org/api v0.114.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19
google.golang.org/grpc v1.56.3
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.33.0
gopkg.in/gcfg.v1 v1.2.3
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v2 v2.4.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho=
github.com/golangplus/bytes v1.0.0/go.mod h1:AdRaCFwmc/00ZzELMWb01soso6W1R/++O1XL80yAn+A=
Expand Down Expand Up @@ -1361,8 +1361,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/etcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# A set of helpers for starting/running etcd for tests

ETCD_VERSION=${ETCD_VERSION:-3.5.10}
ETCD_VERSION=${ETCD_VERSION:-3.5.12}
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
ETCD_PORT=${ETCD_PORT:-2379}
# This is intentionally not called ETCD_LOG_LEVEL:
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/disruption/disruption.go
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ func (dc *DisruptionController) updatePdbStatus(ctx context.Context, pdb *policy
DisruptionsAllowed: disruptionsAllowed,
DisruptedPods: disruptedPods,
ObservedGeneration: pdb.Generation,
Conditions: newPdb.Status.Conditions,
}

pdbhelper.UpdateDisruptionAllowedCondition(newPdb)
Expand Down
33 changes: 33 additions & 0 deletions pkg/controller/disruption/disruption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,39 @@ func TestStalePodDisruption(t *testing.T) {
}
}

func TestKeepExistingPDBConditionDuringSync(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

dc, ps := newFakeDisruptionController()

pdb, pdbName := newMinAvailablePodDisruptionBudget(t, intstr.FromInt(3))
pdb.Spec.Selector = &metav1.LabelSelector{}

pdb.Status.Conditions = append(pdb.Status.Conditions, metav1.Condition{
Type: "ExistingTestCondition",
Status: metav1.ConditionTrue,
Message: "This is a test condition",
Reason: "Test",
LastTransitionTime: metav1.Now(),
})

add(t, dc.pdbStore, pdb)
if err := dc.sync(ctx, pdbName); err != nil {
t.Fatalf("Failed to sync PDB: %v", err)
}
ps.VerifyPdbStatus(t, pdbName, 0, 0, 3, 0, map[string]metav1.Time{})

actualPDB := ps.Get(pdbName)
condition := apimeta.FindStatusCondition(actualPDB.Status.Conditions, "ExistingTestCondition")
if len(actualPDB.Status.Conditions) != 2 {
t.Fatalf("Expected 2 conditions, but got %d", len(actualPDB.Status.Conditions))
}
if condition == nil {
t.Fatalf("Expected ExistingTestCondition condition, but didn't find it")
}
}

// waitForCacheCount blocks until the given cache store has the desired number
// of items in it. This will return an error if the condition is not met after a
// 10 second timeout.
Expand Down
8 changes: 5 additions & 3 deletions pkg/kubelet/kubelet_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ func (kl *Kubelet) newVolumeMounterFromPlugins(spec *volume.Spec, pod *v1.Pod, o
// removeOrphanedPodVolumeDirs attempts to remove the pod volumes directory and
// its subdirectories. There should be no files left under normal conditions
// when this is called, so it effectively does a recursive rmdir instead of
// RemoveAll to ensure it only removes directories and not regular files.
// RemoveAll to ensure it only removes empty directories and files that were
// used as mount points, but not content of the mount points.
func (kl *Kubelet) removeOrphanedPodVolumeDirs(uid types.UID) []error {
orphanVolumeErrors := []error{}

Expand All @@ -136,15 +137,16 @@ func (kl *Kubelet) removeOrphanedPodVolumeDirs(uid types.UID) []error {
}
}

// If there are any volume-subpaths, attempt to rmdir them
// If there are any volume-subpaths, attempt to remove them
subpathVolumePaths, err := kl.getPodVolumeSubpathListFromDisk(uid)
if err != nil {
orphanVolumeErrors = append(orphanVolumeErrors, fmt.Errorf("orphaned pod %q found, but error occurred during reading of volume-subpaths dir from disk: %v", uid, err))
return orphanVolumeErrors
}
if len(subpathVolumePaths) > 0 {
for _, subpathVolumePath := range subpathVolumePaths {
if err := syscall.Rmdir(subpathVolumePath); err != nil {
// Remove both files and empty directories here, as the subpath may have been a bind-mount of a file or a directory.
if err := os.Remove(subpathVolumePath); err != nil {
orphanVolumeErrors = append(orphanVolumeErrors, fmt.Errorf("orphaned pod %q found, but failed to rmdir() subpath at path %v: %v", uid, subpathVolumePath, err))
} else {
klog.InfoS("Cleaned up orphaned volume subpath from pod", "podUID", uid, "path", subpathVolumePath)
Expand Down
3 changes: 2 additions & 1 deletion pkg/kubelet/winstats/perfcounter_nodestats.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ func (p *perfCounterNodeStatsClient) convertCPUValue(cpuCores int, cpuValue uint

func (p *perfCounterNodeStatsClient) getCPUUsageNanoCores() uint64 {
cachePeriodSeconds := uint64(defaultCachePeriod / time.Second)
cpuUsageNanoCores := (p.cpuUsageCoreNanoSecondsCache.latestValue - p.cpuUsageCoreNanoSecondsCache.previousValue) / cachePeriodSeconds
perfCounterUpdatePeriodSeconds := uint64(perfCounterUpdatePeriod / time.Second)
cpuUsageNanoCores := ((p.cpuUsageCoreNanoSecondsCache.latestValue - p.cpuUsageCoreNanoSecondsCache.previousValue) * perfCounterUpdatePeriodSeconds) / cachePeriodSeconds
return cpuUsageNanoCores
}

Expand Down
6 changes: 4 additions & 2 deletions pkg/kubelet/winstats/perfcounter_nodestats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,16 @@ func TestConvertCPUValue(t *testing.T) {
}

func TestGetCPUUsageNanoCores(t *testing.T) {
// Scaled expected unit test values by the frequency the CPU perf counters are polled.
perfCounterUpdatePeriodSeconds := uint64(perfCounterUpdatePeriod / time.Second)
testCases := []struct {
latestValue uint64
previousValue uint64
expected uint64
}{
{latestValue: uint64(0), previousValue: uint64(0), expected: uint64(0)},
{latestValue: uint64(2000000000), previousValue: uint64(0), expected: uint64(200000000)},
{latestValue: uint64(5000000000), previousValue: uint64(2000000000), expected: uint64(300000000)},
{latestValue: uint64(2000000000), previousValue: uint64(0), expected: uint64(200000000 * perfCounterUpdatePeriodSeconds)},
{latestValue: uint64(5000000000), previousValue: uint64(2000000000), expected: uint64(300000000 * perfCounterUpdatePeriodSeconds)},
}

for _, tc := range testCases {
Expand Down
8 changes: 4 additions & 4 deletions pkg/printers/internalversion/printers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6517,7 +6517,7 @@ func TestPrintIPAddressList(t *testing.T) {
{
ObjectMeta: metav1.ObjectMeta{
Name: "192.168.2.2",
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-10, 0, 0)},
CreationTimestamp: metav1.Time{},
},
Spec: networking.IPAddressSpec{
ParentRef: &networking.ParentReference{
Expand All @@ -6530,7 +6530,7 @@ func TestPrintIPAddressList(t *testing.T) {
}, {
ObjectMeta: metav1.ObjectMeta{
Name: "2001:db8::2",
CreationTimestamp: metav1.Time{Time: time.Now().AddDate(-5, 0, 0)},
CreationTimestamp: metav1.Time{},
},
Spec: networking.IPAddressSpec{
ParentRef: &networking.ParentReference{
Expand All @@ -6545,8 +6545,8 @@ func TestPrintIPAddressList(t *testing.T) {
}
// Columns: Name, ParentRef, Age
expected := []metav1.TableRow{
{Cells: []interface{}{"192.168.2.2", "myresource.mygroup/mynamespace/myname", "10y"}},
{Cells: []interface{}{"2001:db8::2", "myresource2.mygroup2/mynamespace2/myname2", "5y1d"}},
{Cells: []interface{}{"192.168.2.2", "myresource.mygroup/mynamespace/myname", "<unknown>"}},
{Cells: []interface{}{"2001:db8::2", "myresource2.mygroup2/mynamespace2/myname2", "<unknown>"}},
}

rows, err := printIPAddressList(&ipList, printers.GenerateOptions{})
Expand Down
Loading

0 comments on commit e4f99c0

Please sign in to comment.