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

Kubernetes Update template, Release template, and site content change for multiple k8s version support #2980

Merged
merged 9 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 33 additions & 20 deletions .github/ISSUE_TEMPLATE/kubernetes_update.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,51 @@
---
name: Upgrade Kubernetes Version
about: Issue for updating the Kubernetes version (usually decided in community meetings).
title: 'Update Kubernetes to {version}'
name: Upgrade Supported Kubernetes Versions
about: Issue for updating the supported Kubernetes versions.
title: 'Update Supported Kubernetes to {version_1} {version_2} {version_3}'
labels: kind/operations, kind/breaking
assignees: ''

---

List of items to do for upgrading to {version}:
Agones supports and is tested against 3 releases of Kubernetes, targeting the newest version as being the [default version in the GKE Rapid channel](https://cloud.google.com/kubernetes-engine/docs/release-notes#current_versions). The vendored version of client-go will be aligned with the middle of the three supported Kubernetes versions ({version_2}). All the example clusters will use the middle of the three supported Kubernetes versions ({version_2}).

- [ ] Update terraform submodules
- [ ] GKE
- [ ] Azure
- [ ] EKS
- [ ] Update e2e cluster
- [ ] Recreate cluster with new scripts: `cd build/terraform/e2e; terraform apply -var project=agones-images`
- [ ] Update kubectl in dev tooling
List of items to do for upgrading to {version_1} {version_2} {version_3}

- [ ] Update the cluster version of terraform submodules in `install/terraform/modules`
- [ ] Update Kubernetes version of GKE cluster to {version_2}
- [ ] Update Kubernetes version of AKS to the newest supported version in {version_1} {version_2} {version_3}
- [ ] Update Kubernetes version of EKS to the newest supported version in {version_1} {version_2} {version_3}
- [ ] Update kubectl in dev tooling to {version_2}
- [ ] Update kubectl in `build/build-image/Dockerfile`
- [ ] Update kubectl in `build/e2e-image/Dockerfile`
- [ ] Update documentation for creating clusters
- [ ] Config.toml `supported_k8s` and related (do `dev_` before main)
- [ ] Update the dev tooling to create clusters
- [ ] Minikube
- [ ] Kind
- [ ] Update the k8s image used in the helm [pre-delete-hook](https://github.com/googleforgames/agones/blob/main/install/helm/agones/templates/hooks/pre_delete_hook.yaml)
- [ ] Update client-go
- [ ] Update CRD API reference
- [ ] Update the Kubernetes version of the below test clusters to {version_2}
- [ ] Minikube (Get the patch version [here](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md))
- [ ] Kind (Confirm {version_2} is supported and get the patch version [here](https://github.com/kubernetes-sigs/kind/releases))
- [ ] Update the k8s image used in the helm [pre-delete-hook](https://github.com/googleforgames/agones/blob/main/install/helm/agones/templates/hooks/pre_delete_hook.yaml) to {version_2}
- [ ] Update client-go in `go.mod` and `test/terraform/go.mod` to {version_2} by running `go get -u k8s.io/client-go@{CORRESPONDING_VERSION}` and `go get -u k8s.io/apiextensions-apiserver@{CORRESPONDING_VERSION}`, then re-run `go mod tidy` and `go mod vendor`
- [ ] Update CRD API reference to {version_2}
- [ ] 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`
- [ ] Start a cluster with `make gcloud-test-cluster` (this cluster will use Kubernetes {version_2}), uninstall agones using `helm uninstall agones -n agones-system`, and then run `make gen-embedded-openapi` and `make gen-install`
- [ ] Update documentation for creating clusters and k8s API references to align with the above clusters versions and the k8s API version
- [ ] `site/config.toml`
- [ ] `dev_supported_k8s`, which are {version_1} {version_2} {version_3}
- [ ] `dev_k8s_api_version`, which is {version_2}
- [ ] `dev_gke_example_cluster_version`, which is {version_2}
- [ ] `dev_aks_example_cluster_version`, which is the newest AKS supported version in {version_1} {version_2} {version_3}
- [ ] `dev_eks_example_cluster_version`, which is the newest EKS supported version in {version_1} {version_2} {version_3}
- [ ] `dev_minikube_example_cluster_version`, which is {version_2} with the supported patch version
- [ ] If client-go pulled in a new version of gRPC, then also
- [ ] Update the SDK [base image grpc version](https://github.com/googleforgames/agones/blob/main/build/includes/sdk.mk#L30) and rebuild the image. Note that this can take a while and in the past we have had to manually push it to gcr because cloud build doesn't like how long it takes.
- [ ] Regenerate allocated API endpoints: [make gen-allocation-grpc](https://github.com/googleforgames/agones/blob/main/build/includes/allocation.mk#L55)
- [ ] Regenerate all client sdks: [make gen-all-sdk-grpc](https://github.com/googleforgames/agones/blob/main/build/README.md#make-gen-all-sdk-grpc)
- [ ] Update the version number in C++ Cmake scripts [here](https://github.com/googleforgames/agones/blob/main/sdks/cpp/CMakeLists.txt#L100) and [here](https://github.com/googleforgames/agones/blob/main/sdks/cpp/cmake/prerequisites.cmake#L34)
- [ ] Confirm the update works as expected by running e2e tests
- [ ] Update the Kubernetes version of the e2e clusters
- [ ] In `terraform/e2e/module.tf`, update variable `kubernetes_versions_standard` and `kubernetes_versions_autopilot` to the new versions to be supported
- [ ] Recreate cluster with new scripts: `cd build; make GCP_PROJECT=agones-images gcloud-e2e-test-cluster`
- [ ] Update the Cloud Build configuration to run e2e test on the new created clusters
- [ ] Update the `versionsAndRegions` variable to reflect new versions in `cloudbuild.yaml` `submit-e2e-test-cloud-build` step
- [ ] Submit a PR to trigger the e2e tests and verfiy they all pass
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ build system.
See the [Container Builder documentation](https://cloud.google.com/container-builder/docs/) for more details on
how to edit and expand the build process.

## Kubernetes Versions Update
Each version of Agones supports specific versions of Kubernetes by following the [version update policy](https://agones.dev/site/docs/installation/#agones-and-kubernetes-supported-versions). Please follow the steps below to update the Kubernetes versions supported.

1. Create a Issue from the [kubernetes update issue template](../../.github/ISSUE_TEMPLATE/kubernetes_update.md) with the newly supported versions.
2. Complete all items in the issue checklist.
3. Close the issue.


## Community Meetings

Community meetings occur every month, and are open to all who wish to attend!
Expand Down
9 changes: 6 additions & 3 deletions docs/governance/templates/release_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,19 @@ and copy it into a release issue. Fill in relevant values, found inside {}
- [ ] Make a `tag` with the release version.
- [ ] Site updated
- [ ] Copy the draft release content into a new `/site/content/en/blog/releases` content (this will be what you send via email).
- [ ] Add the Agones release version and its supported Kubernetes version to the version matrix in `site/content/en/docs/Installation/_index.md #agones-and-kubernetes-supported-versions`.
- [ ] In `site/content/en/docs/Installation/_index.md #agones-and-kubernetes-supported-versions`, for the current version, replace `{{% k8s-version %}}` with hardcoded Kubernetes versions supported by the current version. And add a row for the Agones release version with `{{% k8s-version %}}` as its supported Kubernetes versions.
- [ ] Review all `link_test` and `data-proofer-ignore` attributes and remove for link testing
- [ ] Review and remove all instances of the `feature` shortcode
- [ ] Add a link to previous version's documentation to nav dropdown.
- [ ] config.toml updates:
- [ ] Update `release_branch` to the new release branch for {version}.
- [ ] Update `release-version` with the new release version {version}.
- [ ] Copy `dev_supported_k8s` to `supported_k8s`.
- [ ] Copy `dev_aks_minor_supported_k8s` to `aks_minor_supported_k8s`.
- [ ] Copy `dev_minikube_minor_supported_k8s` to `minikube_minor_supported_k8s`.
- [ ] Copy `dev_k8s_api_version` to `k8s_api_version`.
- [ ] Copy `dev_gke_example_cluster_version` to `gke_example_cluster_version`.
- [ ] Copy `dev_aks_example_cluster_version` to `aks_example_cluster_version`.
- [ ] Copy `dev_eks_example_cluster_version` to `eks_example_cluster_version`.
- [ ] Copy `dev_minikube_example_cluster_version` to `minikube_example_cluster_version`.
- [ ] Update documentation with updated example images tags.
- [ ] Create PR with these changes, and merge them with an approval.
- [ ] Run `git remote update && git checkout main && git reset --hard upstream/main` to ensure your code is in line
Expand Down
20 changes: 13 additions & 7 deletions site/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,19 @@ release_branch = "release-1.29.0"
release_version = "1.29.0"

# shown for production
supported_k8s = "1.24"
aks_minor_supported_k8s = "6"
minikube_minor_supported_k8s = "9"
# shown in development (or the next version that will be supported)
dev_supported_k8s = "1.24"
dev_aks_minor_supported_k8s = "6"
dev_minikube_minor_supported_k8s = "9"
supported_k8s = ["1.24"]
k8s_api_version = "1.24"
gke_example_cluster_version = "1.24"
aks_example_cluster_version = "1.24.6"
eks_example_cluster_version = "1.24"
minikube_example_cluster_version = "1.24.9"
# shown in development (or the next versions that will be supported)
dev_supported_k8s = ["1.23", "1.24", "1.25"]
dev_k8s_api_version = "1.24"
dev_gke_example_cluster_version = "1.24"
dev_aks_example_cluster_version = "1.24.6"
dev_eks_example_cluster_version = "1.24"
dev_minikube_example_cluster_version = "1.24.9"

# example tag
example_image_tag = "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.14"
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Advanced/limiting-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Kubernetes documentation for more details on "requests" and "limits" to both CPU

## GameServers

Since the `GameServer` specification provides a full [`PodSpecTemplate`]({{% k8s-api href="#podtemplatespec-v1-core" %}}),
Since the `GameServer` specification provides a full [`PodSpecTemplate`]({{% k8s-api-version href="#podtemplatespec-v1-core" %}}),
we can take advantage of both resource limits and requests in our `GameServer` configurations.

For example, to set a CPU limit on our `GameServer` configuration of `250m/0.25` of a CPU,
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/FAQ/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ preferentially over the `ExternalIP` node record.
### How is traffic routed from the allocated Port to the GameServer container?

Traffic is routed to the GameServer Container utilising the `hostPort` field on a
[Pod's Container specification]({{< k8s-api href="#containerport-v1-core" >}}).
[Pod's Container specification]({{< k8s-api-version href="#containerport-v1-core" >}}).

This opens a port on the host Node and routes traffic to the container
via [iptables](https://en.wikipedia.org/wiki/Iptables) or
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/Installation/Creating Cluster/aks.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ az group create --name $AKS_RESOURCE_GROUP --location $AKS_LOCATION

# Create the AKS cluster - this might take some time. Type 'az aks create -h' to see all available options

# The following command will create a four Node AKS cluster. Node size is Standard A1 v1 and Kubernetes version is {{% k8s-version %}}.{{% aks-k8s-minor-version %}}. Plus, SSH keys will be generated for you, use --ssh-key-value to provide your values
az aks create --resource-group $AKS_RESOURCE_GROUP --name $AKS_NAME --node-count 4 --generate-ssh-keys --node-vm-size Standard_A4_v2 --kubernetes-version {{% k8s-version %}}.{{% aks-k8s-minor-version %}} --enable-node-public-ip
# The following command will create a four Node AKS cluster. Node size is Standard A1 v1 and Kubernetes version is {{% aks-example-cluster-version %}}. Plus, SSH keys will be generated for you, use --ssh-key-value to provide your values
az aks create --resource-group $AKS_RESOURCE_GROUP --name $AKS_NAME --node-count 4 --generate-ssh-keys --node-vm-size Standard_A4_v2 --kubernetes-version {{% aks-example-cluster-version %}} --enable-node-public-ip

# Install kubectl
sudo az aks install-cli
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Installation/Creating Cluster/eks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Possible steps are the following:
```bash
eksctl create cluster \
--name prod \
--version {{% k8s-version %}} \
--version {{% eks-example-cluster-version %}} \
--nodegroup-name standard-workers \
--node-type t3.medium \
--nodes 3 \
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Installation/Creating Cluster/gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ gcloud compute firewall-rules create game-server-firewall \
A [cluster][cluster] consists of at least one *control plane* machine and multiple worker machines called *nodes*. In Google Kubernetes Engine, nodes are [Compute Engine virtual machine][vms] instances that run the Kubernetes processes necessary to make them part of the cluster.

```bash
gcloud container clusters create [CLUSTER_NAME] --cluster-version={{% k8s-version %}} \
gcloud container clusters create [CLUSTER_NAME] --cluster-version={{% gke-example-cluster-version %}} \
--tags=game-server \
--scopes=gke-default \
--num-nodes=4 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Optionally, we also recommend starting with an `agones` profile, using `-p` to k
clusters you may have running with Minikube.

```bash
minikube start --kubernetes-version v{{% k8s-version %}}.{{% minikube-k8s-minor-version %}} -p agones
minikube start --kubernetes-version v{{% minikube-example-cluster-version %}} -p agones
```

Check the official [minikube start](https://minikube.sigs.k8s.io/docs/commands/start/) reference for more options that
Expand Down
28 changes: 13 additions & 15 deletions site/content/en/docs/Installation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ description: >
- Game Servers must have the [game server SDK]({{< ref "/docs/Guides/Client SDKs/_index.md" >}}) integrated, to manage Game Server state, health checking, etc.

{{< alert title="Warning" color="warning">}}
Later versions of Kubernetes may work, but this project is tested against {{% k8s-version %}}, and is therefore the supported version.
Agones will update its support to the n-1 version of what is available across the majority of major cloud providers - GKE, EKS and
gongmax marked this conversation as resolved.
Show resolved Hide resolved
AKS, while also ensuring that all Cloud providers can support that version.
This release has been tested against Kubernetes versions {{% k8s-version %}} on GKE. Other versions may work, but are unsupported. It is also likely that not all of these versions are supported by other cloud providers.
{{< /alert >}}

## Supported Container Architectures
Expand All @@ -41,21 +39,21 @@ For all the platforms in Alpha, we would appreciate testing and bug reports on a

## Agones and Kubernetes Supported Versions

Each version of Agones supports a specific version of Kubernetes. When a new version of Agones supports a new version of Kubernetes, it is explicitly called out in the [release notes](https://agones.dev/site/blog/releases/).
Agones will support 3 releases of Kubernetes, targeting the newest version as being the [default version in the GKE Rapid channel](https://cloud.google.com/kubernetes-engine/docs/release-notes#current_versions). However, we will ensure that at least one of the 3 versions chosen for each Agones release is supported by each of the major cloud providers (EKS and AKS). The vendored version of client-go will be aligned with the middle of the three supported Kubernetes versions. When a new version of Agones supports new versions of Kubernetes, it is explicitly called out in the [release notes](https://agones.dev/site/blog/releases/).

gongmax marked this conversation as resolved.
Show resolved Hide resolved
The following table lists recent Agones versions and their corresponding required Kubernetes versions:

| Agones version | Kubernetes version |
| -------------- | ------------------ |
| 1.29 | 1.24 |
| 1.28 | 1.23 |
| 1.27 | 1.23 |
| 1.26 | 1.23 |
| 1.25 | 1.22 |
| 1.24 | 1.22 |
| 1.23 | 1.22 |
| 1.22 | 1.21 |
| 1.21 | 1.21 |
| Agones version | Kubernetes version(s) |
| -------------- | ------------------ |
| 1.29 | {{% k8s-version %}} |
| 1.28 | 1.23 |
| 1.27 | 1.23 |
| 1.26 | 1.23 |
| 1.25 | 1.22 |
| 1.24 | 1.22 |
| 1.23 | 1.22 |
| 1.22 | 1.21 |
| 1.21 | 1.21 |

## Best Practices

Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Reference/fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A full `Fleet` specification is available below and in the {{< ghlink href="exam
apiVersion: "agones.dev/v1"
kind: Fleet
# Fleet Metadata
# {{< k8s-api href="#objectmeta-v1-meta" >}}
# {{< k8s-api-version href="#objectmeta-v1-meta" >}}
metadata:
name: fleet-example
spec:
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Reference/fleetautoscaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A full `FleetAutoscaler` specification is available below and in the
apiVersion: "autoscaling.agones.dev/v1"
kind: FleetAutoscaler
# FleetAutoscaler Metadata
# {{< k8s-api href="#objectmeta-v1-meta" >}}
# {{< k8s-api-version href="#objectmeta-v1-meta" >}}
metadata:
name: fleet-autoscaler-example
spec:
Expand Down
6 changes: 3 additions & 3 deletions site/content/en/docs/Reference/gameserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A full GameServer specification is available below and in the {{< ghlink href="e
apiVersion: "agones.dev/v1"
kind: GameServer
# GameServer Metadata
# {{< k8s-api href="#objectmeta-v1-meta" >}}
# {{< k8s-api-version href="#objectmeta-v1-meta" >}}
metadata:
# generateName: "gds-example" # generate a unique name, with the given prefix
name: "gds-example" # set a fixed name
Expand Down Expand Up @@ -77,7 +77,7 @@ spec:
# # set this GameServer's initial player capacity
# initialCapacity: 10
# Pod template configuration
# {{< k8s-api href="#podtemplate-v1-core" >}}
# {{< k8s-api-version href="#podtemplate-v1-core" >}}
template:
# pod metadata. Name & Namespace is overwritten
metadata:
Expand Down Expand Up @@ -125,7 +125,7 @@ The `spec` field is the actual GameServer specification and it is composed as fo
- `grpcPort` the port that the SDK Server binds to for gRPC connections
- `httpPort` the port that the SDK Server binds to for HTTP gRPC gateway connections
- `players` (Alpha, behind "PlayerTracking" feature gate), sets this GameServer's initial player capacity
- `template` the [pod spec template]({{% k8s-api href="#podtemplatespec-v1-core" %}}) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information.
- `template` the [pod spec template]({{% k8s-api-version href="#podtemplatespec-v1-core" %}}) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information.

{{< alert title="Note" color="info">}}
The GameServer resource does not support updates. If you need to make regular updates to the GameServer spec, consider using a [Fleet]({{< ref "/docs/Reference/fleet.md" >}}).
Expand Down
5 changes: 5 additions & 0 deletions site/layouts/shortcodes/aks-example-cluster-version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{- if or (eq (getenv "HUGO_ENV") "production") (eq (getenv "HUGO_ENV") "snapshot")}}
{{- $.Page.Site.Params.aks_example_cluster_version }}
{{- else }}
{{- $.Page.Site.Params.dev_aks_example_cluster_version }}
{{- end -}}
5 changes: 0 additions & 5 deletions site/layouts/shortcodes/aks-k8s-minor-version.html

This file was deleted.

5 changes: 5 additions & 0 deletions site/layouts/shortcodes/eks-example-cluster-version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{- if or (eq (getenv "HUGO_ENV") "production") (eq (getenv "HUGO_ENV") "snapshot")}}
{{- $.Page.Site.Params.eks_example_cluster_version }}
{{- else }}
{{- $.Page.Site.Params.dev_eks_example_cluster_version }}
{{- end -}}
5 changes: 5 additions & 0 deletions site/layouts/shortcodes/gke-example-cluster-version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{- if or (eq (getenv "HUGO_ENV") "production") (eq (getenv "HUGO_ENV") "snapshot")}}
{{- $.Page.Site.Params.gke_example_cluster_version }}
{{- else }}
{{- $.Page.Site.Params.dev_gke_example_cluster_version }}
{{- end -}}
Loading