Skip to content

Commit

Permalink
Move the stable api group and promote it to v1 (#894)
Browse files Browse the repository at this point in the history
* Rename the "core agones" API from stable -> agones and promote the
version from v1alpha1 -> v1.

* Code updated for the new agones core api import path.

* Run `make gen-crd-client`.

* Force a rebuild of the build image.

* Run `make gen-api-docs`.

* Update the examples directory for the new allocation api version.

* Update the install/helm directory for the new allocation api version.

* Run `make gen-install`.

* Update the build directory for the new allocation api version.

* Updates to the sdk proto. Also ran `make gen-sdk-grpc`.

* Run `make gen-all-sdk-grpc`.

* Manual fixes to the cpp sdk.

* Update website docs.

* Update the version of the simple-udp container image to pick up the
changes to the SDK.
  • Loading branch information
roberthbailey authored and markmandel committed Jul 17, 2019
1 parent 187e816 commit d6cb007
Show file tree
Hide file tree
Showing 162 changed files with 5,064 additions and 4,289 deletions.
2 changes: 1 addition & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ KIND_PROFILE ?= agones
KIND_CONTAINER_NAME=kind-$(KIND_PROFILE)-control-plane

# Game Server image to use while doing end-to-end tests
GS_TEST_IMAGE ?= gcr.io/agones-images/udp-server:0.11
GS_TEST_IMAGE ?= gcr.io/agones-images/udp-server:0.12

# Directory that this Makefile is in.
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
Expand Down
2 changes: 1 addition & 1 deletion build/build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# ForceUpdate 10 -- change here if you need to force a rebuild
# ForceUpdate 11 -- change here if you need to force a rebuild

FROM debian:stretch

Expand Down
2 changes: 1 addition & 1 deletion build/build-image/gen-crd-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ rsync -r /go/src/agones.dev/agones/vendor/k8s.io/ /go/src/k8s.io/
cd /go/src/k8s.io/code-generator
./generate-groups.sh "all" \
agones.dev/agones/pkg/client \
agones.dev/agones/pkg/apis "allocation:v1 stable:v1alpha1 multicluster:v1alpha1 autoscaling:v1" \
agones.dev/agones/pkg/apis "allocation:v1 agones:v1 multicluster:v1alpha1 autoscaling:v1" \
--go-header-file=/go/src/agones.dev/agones/build/boilerplate.go.txt

8 changes: 4 additions & 4 deletions build/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ resource "google_container_cluster" "primary" {
"https://www.googleapis.com/auth/trace.append",
]
labels = {
"stable.agones.dev/agones-system" = "true"
"agones.dev/agones-system" = "true"
}
taint = {
key = "stable.agones.dev/agones-system"
key = "agones.dev/agones-system"
value = "true"
effect = "NO_EXECUTE"
}
Expand All @@ -152,10 +152,10 @@ resource "google_container_cluster" "primary" {
"https://www.googleapis.com/auth/trace.append",
]
labels = {
"stable.agones.dev/agones-metrics" = "true"
"agones.dev/agones-metrics" = "true"
}
taint = {
key = "stable.agones.dev/agones-metrics"
key = "agones.dev/agones-metrics"
value = "true"
effect = "NO_EXECUTE"
}
Expand Down
8 changes: 4 additions & 4 deletions build/gke-test-cluster/cluster.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ resources:
- https://www.googleapis.com/auth/servicecontrol
- https://www.googleapis.com/auth/trace.append
labels:
stable.agones.dev/agones-system: "true"
agones.dev/agones-system: "true"
taints:
- key: "stable.agones.dev/agones-system"
- key: "agones.dev/agones-system"
value: "true"
effect: "NO_EXECUTE"
- name: "agones-metrics"
Expand All @@ -65,9 +65,9 @@ resources:
- https://www.googleapis.com/auth/servicecontrol
- https://www.googleapis.com/auth/trace.append
labels:
stable.agones.dev/agones-metrics: "true"
agones.dev/agones-metrics: "true"
taints:
- key: "stable.agones.dev/agones-metrics"
- key: "agones.dev/agones-metrics"
value: "true"
effect: "NO_EXECUTE"
- name: game-server-firewall
Expand Down
4 changes: 2 additions & 2 deletions build/grafana.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
service:
port: 3000
tolerations:
- key: "stable.agones.dev/agones-metrics"
- key: "agones.dev/agones-metrics"
operator: "Equal"
value: "true"
effect: "NoExecute"
Expand All @@ -11,7 +11,7 @@ affinity:
- weight: 1
preference:
matchExpressions:
- key: stable.agones.dev/agones-metrics
- key: agones.dev/agones-metrics
operator: Exists
sidecar:
dashboards:
Expand Down
2 changes: 1 addition & 1 deletion build/grafana/dashboard-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ data:
"targets": [
{
"$$hashKey": "object:818",
"expr": "(process_start_time_seconds{app=\"agones\",stable_agones_dev_role=\"controller\"}) * 1000",
"expr": "(process_start_time_seconds{app=\"agones\",agones_dev_role=\"controller\"}) * 1000",
"format": "time_series",
"instant": true,
"intervalFactor": 1,
Expand Down
8 changes: 4 additions & 4 deletions build/modules/gke/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ resource "google_container_node_pool" "agones-system" {
"https://www.googleapis.com/auth/trace.append",
]
labels = {
"stable.agones.dev/agones-system" = "true"
"agones.dev/agones-system" = "true"
}
taint = {
key = "stable.agones.dev/agones-system"
key = "agones.dev/agones-system"
value = "true"
effect = "NO_EXECUTE"
}
Expand All @@ -145,10 +145,10 @@ resource "google_container_node_pool" "agones-metrics" {
"https://www.googleapis.com/auth/trace.append",
]
labels = {
"stable.agones.dev/agones-metrics" = "true"
"agones.dev/agones-metrics" = "true"
}
taint = {
key = "stable.agones.dev/agones-metrics"
key = "agones.dev/agones-metrics"
value = "true"
effect = "NO_EXECUTE"
}
Expand Down
4 changes: 2 additions & 2 deletions build/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ server:
memory: 4Gi
cpu: 2
tolerations:
- key: "stable.agones.dev/agones-metrics"
- key: "agones.dev/agones-metrics"
operator: "Equal"
value: "true"
effect: "NoExecute"
Expand All @@ -22,7 +22,7 @@ server:
- weight: 1
preference:
matchExpressions:
- key: stable.agones.dev/agones-metrics
- key: agones.dev/agones-metrics
operator: Exists
serverFiles:
prometheus.yml:
Expand Down
2 changes: 1 addition & 1 deletion examples/allocator-service/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Simple Allocator Service

This service provides an example of using the [Agones API](https://godoc.org/agones.dev/agones/pkg/client/clientset/versioned/typed/stable/v1alpha1) to allocate a GameServer from a Fleet, and is used in the [Create an Allocator Service (Go)](https://agones.dev/site/docs/tutorials/allocator-service-go/) tutorial.
This service provides an example of using the [Agones API](https://godoc.org/agones.dev/agones/pkg/client/clientset/versioned/typed/agones/v1) to allocate a GameServer from a Fleet, and is used in the [Create an Allocator Service (Go)](https://agones.dev/site/docs/tutorials/allocator-service-go/) tutorial.

## Allocator Service
The service exposes an endpoint which allows client calls to AllocationInterface.Create() over a secure connection. It also provides examples of how to create a service account with the least necessary privileges, how to create an Ingress, and how services can use secrets specific to their respective accounts.
Expand Down
6 changes: 3 additions & 3 deletions examples/allocator-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"net/http"

agonesv1 "agones.dev/agones/pkg/apis/agones/v1"
allocationv1 "agones.dev/agones/pkg/apis/allocation/v1"
stablev1alpha1 "agones.dev/agones/pkg/apis/stable/v1alpha1"
"agones.dev/agones/pkg/client/clientset/versioned"
"agones.dev/agones/pkg/util/runtime" // for the logger
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -128,7 +128,7 @@ func handleAddress(w http.ResponseWriter, r *http.Request) {
// Return the number of ready game servers available to this fleet for allocation
func checkReadyReplicas() int32 {
// Get a FleetInterface for this namespace
fleetInterface := agonesClient.StableV1alpha1().Fleets(namespace)
fleetInterface := agonesClient.AgonesV1().Fleets(namespace)
// Get our fleet
fleet, err := fleetInterface.Get(fleetname, metav1.GetOptions{})
if err != nil {
Expand Down Expand Up @@ -160,7 +160,7 @@ func allocate() (allocationv1.GameServerAllocationState, error) {
// Define the allocation using the constants set earlier
gsa := &allocationv1.GameServerAllocation{
Spec: allocationv1.GameServerAllocationSpec{
Required: metav1.LabelSelector{MatchLabels: map[string]string{stablev1alpha1.FleetNameLabel: fleetname}},
Required: metav1.LabelSelector{MatchLabels: map[string]string{agonesv1.FleetNameLabel: fleetname}},
}}

// Create a new allocation
Expand Down
2 changes: 1 addition & 1 deletion examples/allocator-service/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rules:
- apiGroups: ["allocation.agones.dev"]
resources: ["gameserverallocations"]
verbs: ["create"]
- apiGroups: ["stable.agones.dev"]
- apiGroups: ["agones.dev"]
resources: ["fleets"]
verbs: ["get"]

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp-simple/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: Fleet
metadata:
# generate a unique name
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp-simple/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
# generate a unique name
Expand Down
2 changes: 1 addition & 1 deletion examples/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# To allocate a GameServer from a Fleet, use a GameServerAllocation
#

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: Fleet
metadata:
# Fleet Metadata
Expand Down
2 changes: 1 addition & 1 deletion examples/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# and provides a sidecar for this game server that the SDK will connect with.
#

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServer
# GameServer Metadata
# https://v1-8.docs.kubernetes.io/docs/api-reference/v1.8/#objectmeta-v1-meta
Expand Down
4 changes: 2 additions & 2 deletions examples/gameserverallocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ spec:
# This also support `matchExpressions`
preferred:
- matchLabels:
stable.agones.dev/fleet: green-fleet
agones.dev/fleet: green-fleet
- matchLabels:
stable.agones.dev/fleet: blue-fleet
agones.dev/fleet: blue-fleet
# defines how GameServers are organised across the cluster.
# Options include:
# "Packed" (default) is aimed at dynamic Kubernetes clusters, such as cloud providers, wherein we want to bin pack
Expand Down
2 changes: 1 addition & 1 deletion examples/rust-simple/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
# generate a unique name
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ REPOSITORY = gcr.io/agones-images

mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
project_path := $(dir $(mkfile_path))
server_tag = $(REPOSITORY)/udp-server:0.11
server_tag = $(REPOSITORY)/udp-server:0.12
root_path = $(realpath $(project_path)/../..)

# _____ _
Expand Down
4 changes: 2 additions & 2 deletions examples/simple-udp/dev-gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
name: local-simple-udp
generateName: "simple-udp-"
annotations:
# Causes Agones to register your local game server at 192.1.1.2, replace with your server's IP address.
stable.agones.dev/dev-address: "192.1.1.2"
agones.dev/dev-address: "192.1.1.2"
spec:
ports:
- name: default
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/fleet-distributed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# it uses artificially low resource requests to be able to put as many
# pods on a node as possible.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: Fleet
metadata:
name: simple-udp-distributed
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: Fleet
metadata:
name: simple-udp
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/gameserver-passthrough.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
generateName: "simple-udp-"
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
generateName: "simple-udp-"
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/gameserverallocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ spec:
# Below is an example of a GameServer allocated against a given fleet.
required:
matchLabels:
stable.agones.dev/fleet: simple-udp
agones.dev/fleet: simple-udp
2 changes: 1 addition & 1 deletion examples/simple-udp/gameserverset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Usually you would define a Fleet rather than a GameServerSet
# directly. This is here mostly for testing purposes

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServerSet
metadata:
name: simple-udp
Expand Down
2 changes: 1 addition & 1 deletion examples/xonotic/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Usually you would define a Fleet rather than a GameServerSet
# directly. This is here mostly for testing purposes

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: Fleet
metadata:
name: xonotic
Expand Down
2 changes: 1 addition & 1 deletion examples/xonotic/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
name: "xonotic"
Expand Down
2 changes: 1 addition & 1 deletion examples/xonotic/gameserverallocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ spec:
# Below is an example of a GameServer allocated against a given fleet.
required:
matchLabels:
stable.agones.dev/fleet: xonotic
agones.dev/fleet: xonotic
2 changes: 2 additions & 0 deletions install/helm/agones/scripts/delete_agones_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ for ns in $namespaces; do
gs=$(kubectl -n $ns get gs -o jsonpath='{.items[*].metadata.name}')

for g in $gs; do
pod=$(kubectl -n $ns get po -l agones.dev/gameserver=$g -o jsonpath='{.items[*].metadata.name}')
# TODO(roberthbailey): Remove this after we cut Agones 0.12.0
pod=$(kubectl -n $ns get po -l stable.agones.dev/gameserver=$g -o jsonpath='{.items[*].metadata.name}')
pods="$pods $pod"
done
Expand Down
2 changes: 1 addition & 1 deletion install/helm/agones/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Once ready you can create your first GameServer using our examples:

An example GameServer that makes use of the controller:

apiVersion: "stable.agones.dev/v1alpha1"
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
name: "simple-udp"
Expand Down
4 changes: 2 additions & 2 deletions install/helm/agones/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ metadata:
spec:
selector:
matchLabels:
stable.agones.dev/role: controller
agones.dev/role: controller
app: {{ template "agones.name" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand All @@ -46,7 +46,7 @@ spec:
prometheus.io/path: "/metrics"
{{- end }}
labels:
stable.agones.dev/role: controller
agones.dev/role: controller
app: {{ template "agones.name" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand Down
Loading

0 comments on commit d6cb007

Please sign in to comment.