Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Kubernetes 1.27.3 #1609

Merged
merged 31 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
38bbd2d
kubeadm: Use internal etcd client through an interface
dlipovetsky May 8, 2023
a64d660
kubeadm: Add etcd client unit tests
dlipovetsky May 8, 2023
0d5eb41
kubeadm: Make etcd member removal idempotent
dlipovetsky May 2, 2023
f404d1c
Update CHANGELOG/CHANGELOG-1.27.md for v1.27.2
k8s-release-robot May 17, 2023
1ae728f
kubeadm: fix a bug where the static pod changes detection logic is in…
SataQiu May 18, 2023
0bff4e3
Fix waiting for CRD sync at server start
liggitt May 18, 2023
9107eee
Test APIService safe handling at startup
liggitt May 18, 2023
af024b2
Merge pull request #118111 from liggitt/automated-cherry-pick-of-#118…
k8s-ci-robot May 19, 2023
4025005
Merge pull request #118105 from SataQiu/automated-cherry-pick-of-#118…
k8s-ci-robot May 19, 2023
d2bd738
update webhook test to go 1.21
HirazawaUi May 21, 2023
e407c2b
Add DisruptionTarget condition when preempting for critical pod
mimowo Apr 25, 2023
916bc55
Merge pull request #118178 from HirazawaUi/automated-cherry-pick-of-#…
k8s-ci-robot May 24, 2023
f41a169
e2e: apply timeout for CSI Storage Capacity test only to node
pohly May 23, 2023
7888798
e2e framework retry on Service unavailable errors
aojea May 25, 2023
c345ce9
supported version of etcd 3.5.7-0 for Kubernetes v1.27.0-rc.0
tukwila Apr 8, 2023
c48bdec
Merge pull request #118279 from aojea/automated-cherry-pick-of-#11820…
k8s-ci-robot Jun 1, 2023
d71d96a
Merge pull request #118219 from mimowo/automated-cherry-pick-of-#1175…
k8s-ci-robot Jun 1, 2023
d59b91d
Add ephemeralcontainer to imagepolicy securityaccount admission plugin
ritazh May 30, 2023
76f1449
Merge pull request #118281 from aojea/automated-cherry-pick-of-#11825…
k8s-ci-robot Jun 6, 2023
5e00018
Merge pull request #117948 from dlipovetsky/automated-cherry-pick-of-…
k8s-ci-robot Jun 6, 2023
b30e94b
kube-proxy avoid race condition using LocalModeNodeCIDR
aojea Jun 6, 2023
3a77d5a
Merge pull request #118471 from ritazh/automated-cherry-pick-of-#1183…
k8s-ci-robot Jun 6, 2023
e2cc1a3
Merge pull request #118515 from aojea/automated-cherry-pick-of-#11849…
k8s-ci-robot Jun 7, 2023
82b2c5a
releng/go: Update images, dependencies and version to Go 1.20.5
puerco Jun 8, 2023
e0a2a6e
update-vendor: update vendored go.sums
puerco Jun 8, 2023
e13e591
Merge pull request #118307 from SataQiu/automated-cherry-pick-of-#117…
k8s-ci-robot Jun 9, 2023
aae883e
Merge pull request #118553 from puerco/bump-1.27-go1.20.5
k8s-ci-robot Jun 12, 2023
25b4e43
Release commit for Kubernetes v1.27.3
k8s-release-robot Jun 14, 2023
b9f4073
Merge tag 'v1.27.3' into bump-1.27.3
bertinatto Jun 19, 2023
d72ca3b
UPSTREAM: <drop>: manually resolve conflicts
bertinatto Jun 19, 2023
b9512d2
UPSTREAM: <drop>: hack/update-vendor.sh, make update and update image
bertinatto Jun 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.4
1.20.5
240 changes: 191 additions & 49 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.20.4-bullseye.0
v1.27.0-go1.20.5-bullseye.0
2 changes: 1 addition & 1 deletion build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ readonly KUBE_CONTAINER_RSYNC_PORT=8730

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

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

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

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

Expand Down Expand Up @@ -147,7 +147,7 @@ dependencies:
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.20.4-bullseye.0
version: v2.3.1-go1.20.5-bullseye.0
refPaths:
- path: build/common.sh
match: __default_go_runner_version=
Expand Down
9 changes: 6 additions & 3 deletions cmd/kube-apiserver/app/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (

"k8s.io/klog/v2"

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apiextensionsinformers "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -117,7 +116,7 @@ func createAggregatorConfig(
return aggregatorConfig, nil
}

func createAggregatorServer(aggregatorConfig *aggregatorapiserver.Config, delegateAPIServer genericapiserver.DelegationTarget, apiExtensionInformers apiextensionsinformers.SharedInformerFactory) (*aggregatorapiserver.APIAggregator, error) {
func createAggregatorServer(aggregatorConfig *aggregatorapiserver.Config, delegateAPIServer genericapiserver.DelegationTarget, apiExtensionInformers apiextensionsinformers.SharedInformerFactory, crdAPIEnabled bool) (*aggregatorapiserver.APIAggregator, error) {
aggregatorServer, err := aggregatorConfig.Complete().NewWithDelegate(delegateAPIServer)
if err != nil {
return nil, err
Expand Down Expand Up @@ -147,8 +146,12 @@ func createAggregatorServer(aggregatorConfig *aggregatorapiserver.Config, delega
// let the CRD controller process the initial set of CRDs before starting the autoregistration controller.
// this prevents the autoregistration controller's initial sync from deleting APIServices for CRDs that still exist.
// we only need to do this if CRDs are enabled on this server. We can't use discovery because we are the source for discovery.
if aggregatorConfig.GenericConfig.MergedResourceConfig.ResourceEnabled(apiextensionsv1.SchemeGroupVersion.WithResource("customresourcedefinitions")) {
if crdAPIEnabled {
klog.Infof("waiting for initial CRD sync...")
crdRegistrationController.WaitForInitialSync()
klog.Infof("initial CRD sync complete...")
} else {
klog.Infof("CRD API not enabled, starting APIService registration without waiting for initial CRD sync")
}
autoRegistrationController.Run(5, context.StopCh)
}()
Expand Down
4 changes: 3 additions & 1 deletion cmd/kube-apiserver/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
oteltrace "go.opentelemetry.io/otel/trace"

corev1 "k8s.io/api/core/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
extensionsapiserver "k8s.io/apiextensions-apiserver/pkg/apiserver"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
Expand Down Expand Up @@ -232,6 +233,7 @@ func CreateServerChain(completedOptions completedServerRunOptions) (*aggregatora
if err != nil {
return nil, err
}
crdAPIEnabled := apiExtensionsConfig.GenericConfig.MergedResourceConfig.ResourceEnabled(apiextensionsv1.SchemeGroupVersion.WithResource("customresourcedefinitions"))

notFoundHandler := notfoundhandler.New(kubeAPIServerConfig.GenericConfig.Serializer, genericapifilters.NoMuxAndDiscoveryIncompleteKey)
apiExtensionsServer, err := createAPIExtensionsServer(apiExtensionsConfig, genericapiserver.NewEmptyDelegateWithCustomHandler(notFoundHandler))
Expand All @@ -249,7 +251,7 @@ func CreateServerChain(completedOptions completedServerRunOptions) (*aggregatora
if err != nil {
return nil, err
}
aggregatorServer, err := createAggregatorServer(aggregatorConfig, kubeAPIServer.GenericAPIServer, apiExtensionsServer.Informers)
aggregatorServer, err := createAggregatorServer(aggregatorConfig, kubeAPIServer.GenericAPIServer, apiExtensionsServer.Informers, crdAPIEnabled)
if err != nil {
// we don't need special handling for innerStopCh because the aggregator server doesn't create any go routines
return nil, err
Expand Down
59 changes: 32 additions & 27 deletions cmd/kube-apiserver/app/testing/testserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ type TearDownFunc func()

// TestServerInstanceOptions Instance options the TestServer
type TestServerInstanceOptions struct {
// SkipHealthzCheck returns without waiting for the server to become healthy.
// Useful for testing server configurations expected to prevent /healthz from completing.
SkipHealthzCheck bool
// Enable cert-auth for the kube-apiserver
EnableCertAuth bool
// Wrap the storage version interface of the created server's generic server.
Expand Down Expand Up @@ -262,40 +265,42 @@ func StartTestServer(t Logger, instanceOptions *TestServerInstanceOptions, custo
}
}(stopCh)

t.Logf("Waiting for /healthz to be ok...")

client, err := kubernetes.NewForConfig(server.GenericAPIServer.LoopbackClientConfig)
if err != nil {
return result, fmt.Errorf("failed to create a client: %v", err)
}

// wait until healthz endpoint returns ok
err = wait.Poll(100*time.Millisecond, time.Minute, func() (bool, error) {
select {
case err := <-errCh:
return false, err
default:
}
if !instanceOptions.SkipHealthzCheck {
t.Logf("Waiting for /healthz to be ok...")

req := client.CoreV1().RESTClient().Get().AbsPath("/healthz")
// The storage version bootstrap test wraps the storage version post-start
// hook, so the hook won't become health when the server bootstraps
if instanceOptions.StorageVersionWrapFunc != nil {
// We hardcode the param instead of having a new instanceOptions field
// to avoid confusing users with more options.
storageVersionCheck := fmt.Sprintf("poststarthook/%s", apiserver.StorageVersionPostStartHookName)
req.Param("exclude", storageVersionCheck)
}
result := req.Do(context.TODO())
status := 0
result.StatusCode(&status)
if status == 200 {
return true, nil
// wait until healthz endpoint returns ok
err = wait.Poll(100*time.Millisecond, time.Minute, func() (bool, error) {
select {
case err := <-errCh:
return false, err
default:
}

req := client.CoreV1().RESTClient().Get().AbsPath("/healthz")
// The storage version bootstrap test wraps the storage version post-start
// hook, so the hook won't become health when the server bootstraps
if instanceOptions.StorageVersionWrapFunc != nil {
// We hardcode the param instead of having a new instanceOptions field
// to avoid confusing users with more options.
storageVersionCheck := fmt.Sprintf("poststarthook/%s", apiserver.StorageVersionPostStartHookName)
req.Param("exclude", storageVersionCheck)
}
result := req.Do(context.TODO())
status := 0
result.StatusCode(&status)
if status == 200 {
return true, nil
}
return false, nil
})
if err != nil {
return result, fmt.Errorf("failed to wait for /healthz to return ok: %v", err)
}
return false, nil
})
if err != nil {
return result, fmt.Errorf("failed to wait for /healthz to return ok: %v", err)
}

// wait until default namespace is created
Expand Down
3 changes: 2 additions & 1 deletion cmd/kube-proxy/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ type ProxyServer struct {
ConfigSyncPeriod time.Duration
HealthzServer healthcheck.ProxierHealthUpdater
localDetectorMode kubeproxyconfig.LocalMode
podCIDRs []string // only used for LocalModeNodeCIDR
}

// createClients creates a kube client and an event client from the given config and masterOverride.
Expand Down Expand Up @@ -769,7 +770,7 @@ func (s *ProxyServer) Run() error {
nodeConfig := config.NewNodeConfig(currentNodeInformerFactory.Core().V1().Nodes(), s.ConfigSyncPeriod)
// https://issues.k8s.io/111321
if s.localDetectorMode == kubeproxyconfig.LocalModeNodeCIDR {
nodeConfig.RegisterEventHandler(&proxy.NodePodCIDRHandler{})
nodeConfig.RegisterEventHandler(proxy.NewNodePodCIDRHandler(s.podCIDRs))
}
nodeConfig.RegisterEventHandler(s.Proxier)

Expand Down
3 changes: 3 additions & 0 deletions cmd/kube-proxy/app/server_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ func newProxyServer(
}

var nodeInfo *v1.Node
podCIDRs := []string{}
if detectLocalMode == proxyconfigapi.LocalModeNodeCIDR {
klog.InfoS("Watching for node, awaiting podCIDR allocation", "hostname", hostname)
nodeInfo, err = waitForPodCIDR(client, hostname)
if err != nil {
return nil, err
}
podCIDRs = nodeInfo.Spec.PodCIDRs
klog.InfoS("NodeInfo", "podCIDR", nodeInfo.Spec.PodCIDR, "podCIDRs", nodeInfo.Spec.PodCIDRs)
}

Expand Down Expand Up @@ -357,6 +359,7 @@ func newProxyServer(
ConfigSyncPeriod: config.ConfigSyncPeriod.Duration,
HealthzServer: healthzServer,
localDetectorMode: detectLocalMode,
podCIDRs: podCIDRs,
}, nil
}

Expand Down
1 change: 1 addition & 0 deletions cmd/kubeadm/app/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ var (
24: "3.5.7-0",
25: "3.5.7-0",
26: "3.5.7-0",
27: "3.5.7-0",
}

// KubeadmCertsClusterRoleName sets the name for the ClusterRole that allows
Expand Down
4 changes: 4 additions & 0 deletions cmd/kubeadm/app/phases/etcd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ func RemoveStackedEtcdMemberFromCluster(client clientset.Interface, cfg *kubeadm
klog.V(2).Infof("[etcd] get the member id from peer: %s", etcdPeerAddress)
id, err := etcdClient.GetMemberID(etcdPeerAddress)
if err != nil {
if errors.Is(etcdutil.ErrNoMemberIDForPeerURL, err) {
klog.V(5).Infof("[etcd] member was already removed, because no member id exists for peer %s", etcdPeerAddress)
return nil
}
return err
}

Expand Down