Skip to content

Commit

Permalink
Update Kubernetes version to 1.24 (#2895)
Browse files Browse the repository at this point in the history
* Upgrade Agones to Kubernetes 1.24

* Upgrade client-go to 1.24

* Update CRD API reference

* Regenerate Kubernetes resource includes

* Remove the usage of deprecated ClusterName field

* Replay the deprecated types and method to make linter happy

* fix merge conflict

* fix merge conflict
  • Loading branch information
gongmax committed Jan 11, 2023
1 parent f5e8ce5 commit f0d11e4
Show file tree
Hide file tree
Showing 630 changed files with 49,167 additions and 13,493 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/kubernetes_update.md
Expand Up @@ -30,6 +30,7 @@ List of items to do for upgrading to {version}:
- [ ] Update CRD API reference
- [ ] Update links to k8s documentation in `site/assets/templates/crd-doc-config.json`
- [ ] Regenerate crd api reference docs - `make gen-api-docs`
- [ ] Regenerate crd client libraries - `make gen-crd-client`
- [ ] Regenerate Kubernetes resource includes (e.g. ObjectMeta, PodTemplateSpec)
- [ ] Start a cluster with `make gcloud-test-cluster`, uninstall agones using `helm uninstall agones -n agones-system`, and then run `make gen-embedded-openapi` and `make gen-install`
- [ ] If client-go pulled in a new version of gRPC, then also
Expand Down
2 changes: 1 addition & 1 deletion build/build-image/Dockerfile
Expand Up @@ -44,7 +44,7 @@ ENV PATH /usr/local/go/bin:/go/bin:$PATH
RUN go install golang.org/x/tools/cmd/goimports@latest

# the kubernetes version for the file
ENV KUBERNETES_VER 1.23.9
ENV KUBERNETES_VER 1.24.9

# overwrite kubectl as we want a specific version
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VER}/bin/linux/amd64/kubectl && \
Expand Down
2 changes: 1 addition & 1 deletion build/e2e-image/Dockerfile
Expand Up @@ -15,7 +15,7 @@ RUN wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
ENV PATH /usr/local/go/bin:/go/bin:$PATH

# install kubectl without gcloud as we want the last version
ENV KUBECTL_VER 1.23.9
ENV KUBECTL_VER 1.24.9
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VER}/bin/linux/amd64/kubectl && \
chmod go+rx ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl
Expand Down
2 changes: 1 addition & 1 deletion build/includes/kind.mk
Expand Up @@ -26,7 +26,7 @@ kind-test-cluster: DOCKER_RUN_ARGS+=--network=host
kind-test-cluster: $(ensure-build-image)
@if [ -z $$(kind get clusters | grep $(KIND_PROFILE)) ]; then\
echo "Could not find $(KIND_PROFILE) cluster. Creating...";\
kind create cluster --name $(KIND_PROFILE) --image kindest/node:v1.23.6 --wait 5m;\
kind create cluster --name $(KIND_PROFILE) --image kindest/node:v1.24.7 --wait 5m;\
fi

# deletes the kind agones cluster
Expand Down
2 changes: 1 addition & 1 deletion build/includes/minikube.mk
Expand Up @@ -28,7 +28,7 @@ minikube_cert_mount := ~/.minikube:$(HOME)/.minikube
# of the right version.
minikube-test-cluster: DOCKER_RUN_ARGS+=--network=host -v $(minikube_cert_mount)
minikube-test-cluster: $(ensure-build-image)
$(MINIKUBE) start --kubernetes-version v1.23.9 -p $(MINIKUBE_PROFILE) --driver $(MINIKUBE_DRIVER)
$(MINIKUBE) start --kubernetes-version v1.24.9 -p $(MINIKUBE_PROFILE) --driver $(MINIKUBE_DRIVER)

# Connecting to minikube requires so enhanced permissions, so use this target
# instead of `make shell` to start an interactive shell for development on minikube.
Expand Down
2 changes: 1 addition & 1 deletion build/terraform/prow/module.tf
Expand Up @@ -31,7 +31,7 @@ resource "google_container_cluster" "prow-build-cluster" {
project = var.project
location = "us-west1-c"
description = "Prow cluster to run tests for Agones"
min_master_version = "1.23"
min_master_version = "1.24"
initial_node_count = 8
node_config {
machine_type = "e2-standard-4"
Expand Down
4 changes: 2 additions & 2 deletions cmd/ping/udp.go
Expand Up @@ -29,8 +29,8 @@ import (

"github.com/sirupsen/logrus"
"golang.org/x/time/rate"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/utils/clock"
)

// udpServer is a rate limited udp server that echos
Expand All @@ -40,7 +40,7 @@ type udpServer struct {
conn net.PacketConn
rateLimit rate.Limit
rateBurst int
clock clock.Clock
clock clock.WithTickerAndDelayedExecution
limitsMutex sync.Mutex
limits map[string]*visitor
healthMutex sync.RWMutex
Expand Down
11 changes: 6 additions & 5 deletions cmd/ping/udp_test.go
Expand Up @@ -21,8 +21,9 @@ import (
"time"

"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/utils/clock"
testclocks "k8s.io/utils/clock/testing"
)

type mockAddr struct {
Expand All @@ -40,7 +41,7 @@ func (m *mockAddr) String() string {
func TestUDPServerVisit(t *testing.T) {
t.Parallel()

fc := clock.NewFakeClock(time.Now())
fc := testclocks.NewFakeClock(time.Now())
u, err := defaultFixture(fc)
assert.Nil(t, err)
defer u.close()
Expand Down Expand Up @@ -72,7 +73,7 @@ func TestUDPServerVisit(t *testing.T) {
func TestUDPServerCleanup(t *testing.T) {
t.Parallel()

fc := clock.NewFakeClock(time.Now())
fc := testclocks.NewFakeClock(time.Now())
u, err := defaultFixture(fc)
assert.Nil(t, err)
defer u.close()
Expand All @@ -99,7 +100,7 @@ func TestUDPServerCleanup(t *testing.T) {
func TestUDPServerHealth(t *testing.T) {
t.Parallel()

fc := clock.NewFakeClock(time.Now())
fc := testclocks.NewFakeClock(time.Now())
u, err := defaultFixture(fc)
assert.Nil(t, err)
defer u.close()
Expand All @@ -120,7 +121,7 @@ func TestUDPServerHealth(t *testing.T) {
assert.Nil(t, err)
}

func defaultFixture(cl clock.Clock) (*udpServer, error) {
func defaultFixture(cl clock.WithTickerAndDelayedExecution) (*udpServer, error) {
u := newUDPServer(5)
u.clock = cl
var err error
Expand Down
45 changes: 24 additions & 21 deletions go.mod
Expand Up @@ -22,23 +22,23 @@ require (
github.com/sirupsen/logrus v1.8.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.7.0
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5
github.com/stretchr/testify v1.8.0
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802
go.opencensus.io v0.23.0
golang.org/x/net v0.1.0
golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
golang.org/x/tools v0.1.12
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a
google.golang.org/grpc v1.50.1
google.golang.org/protobuf v1.28.1
gopkg.in/fsnotify.v1 v1.4.7
gopkg.in/natefinch/lumberjack.v2 v2.0.0
k8s.io/api v0.23.9
k8s.io/apiextensions-apiserver v0.21.5
k8s.io/apimachinery v0.23.9
k8s.io/client-go v0.23.9
k8s.io/utils v0.0.0-20211116205334-6203023598ed
k8s.io/api v0.24.9
k8s.io/apiextensions-apiserver v0.24.9
k8s.io/apimachinery v0.24.9
k8s.io/client-go v0.24.9
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
)

require (
Expand All @@ -48,28 +48,30 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.3 // indirect
github.com/go-openapi/swag v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mailru/easyjson v0.7.0 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
Expand All @@ -85,21 +87,22 @@ require (
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
google.golang.org/api v0.43.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.51.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c // indirect
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect
k8s.io/klog v0.3.0 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

0 comments on commit f0d11e4

Please sign in to comment.