From 05da749e60dd919441d0cdc9791fa7532d91fd4c Mon Sep 17 00:00:00 2001 From: "Mengye (Max) Gong" <8364575+gongmax@users.noreply.github.com> Date: Mon, 12 Dec 2022 16:55:48 -0800 Subject: [PATCH] Introduce the Source field in GameServerAllocationStatus to indicate the allocation source (#2860) * Introduce the Source field in GameServerAllocationStatus to indicate the allocation source * fix indent * ignore space check for the new added line * fix markdown * apply gofmt formatting --- pkg/allocation/converters/converter.go | 4 +- pkg/allocation/converters/converter_test.go | 16 +- pkg/allocation/go/allocation.pb.go | 180 +- pkg/allocation/go/allocation.swagger.json | 3 + .../allocation/v1/gameserverallocation.go | 3 + pkg/gameserverallocations/allocator.go | 7 +- pkg/gameserverallocations/metrics.go | 2 +- pkg/gameserverallocations/metrics_test.go | 119 + proto/allocation/allocation.proto | 1 + .../docs/Advanced/multi-cluster-allocation.md | 5 +- .../Reference/agones_crd_api_reference.html | 4807 +++++++++-------- 11 files changed, 2655 insertions(+), 2492 deletions(-) create mode 100644 pkg/gameserverallocations/metrics_test.go diff --git a/pkg/allocation/converters/converter.go b/pkg/allocation/converters/converter.go index 170770f0fe..d4f5f669f1 100644 --- a/pkg/allocation/converters/converter.go +++ b/pkg/allocation/converters/converter.go @@ -242,11 +242,12 @@ func ConvertGSAToAllocationResponse(in *allocationv1.GameServerAllocation) (*pb. Address: in.Status.Address, NodeName: in.Status.NodeName, Ports: convertGSAAgonesPortsToAllocationPorts(in.Status.Ports), + Source: in.Status.Source, }, nil } // ConvertAllocationResponseToGSA converts AllocationResponse to GameServerAllocation V1 (GSA) -func ConvertAllocationResponseToGSA(in *pb.AllocationResponse) *allocationv1.GameServerAllocation { +func ConvertAllocationResponseToGSA(in *pb.AllocationResponse, rs string) *allocationv1.GameServerAllocation { if in == nil { return nil } @@ -258,6 +259,7 @@ func ConvertAllocationResponseToGSA(in *pb.AllocationResponse) *allocationv1.Gam Address: in.Address, NodeName: in.NodeName, Ports: convertAllocationPortsToGSAAgonesPorts(in.Ports), + Source: rs, }, } out.SetGroupVersionKind(allocationv1.SchemeGroupVersion.WithKind("GameServerAllocation")) diff --git a/pkg/allocation/converters/converter_test.go b/pkg/allocation/converters/converter_test.go index 01c4bee602..da312b805d 100644 --- a/pkg/allocation/converters/converter_test.go +++ b/pkg/allocation/converters/converter_test.go @@ -523,6 +523,7 @@ func TestConvertGSAToAllocationResponse(t *testing.T) { }, Address: "address", NodeName: "node-name", + Source: "local", }, }, want: &pb.AllocationResponse{ @@ -537,6 +538,7 @@ func TestConvertGSAToAllocationResponse(t *testing.T) { Name: "port-name", }, }, + Source: "local", }, }, { @@ -629,7 +631,11 @@ func TestConvertGSAToAllocationResponse(t *testing.T) { } if !tc.skipConvertToGSA { - gsa := ConvertAllocationResponseToGSA(tc.want) + source := "" + if tc.in != nil { + source = tc.in.Status.Source + } + gsa := ConvertAllocationResponseToGSA(tc.want, source) if !assert.Equal(t, tc.in, gsa) { t.Errorf("mismatch with input after double conversion \"%s\"", tc.name) } @@ -647,7 +653,8 @@ func TestConvertAllocationResponseToGSA(t *testing.T) { { name: "Empty fields", in: &pb.AllocationResponse{ - Ports: []*pb.AllocationResponse_GameServerStatusPort{}, + Ports: []*pb.AllocationResponse_GameServerStatusPort{}, + Source: "33.188.237.156:443", }, want: &allocationv1.GameServerAllocation{ TypeMeta: metav1.TypeMeta{ @@ -655,7 +662,8 @@ func TestConvertAllocationResponseToGSA(t *testing.T) { APIVersion: "allocation.agones.dev/v1", }, Status: allocationv1.GameServerAllocationStatus{ - State: allocationv1.GameServerAllocationAllocated, + State: allocationv1.GameServerAllocationAllocated, + Source: "33.188.237.156:443", }, }, }, @@ -665,7 +673,7 @@ func TestConvertAllocationResponseToGSA(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - out := ConvertAllocationResponseToGSA(tc.in) + out := ConvertAllocationResponseToGSA(tc.in, tc.in.Source) if !assert.Equal(t, tc.want, out) { t.Errorf("mismatch with want after conversion: \"%s\"", tc.name) } diff --git a/pkg/allocation/go/allocation.pb.go b/pkg/allocation/go/allocation.pb.go index eb2eb59eb8..d05038a8e1 100644 --- a/pkg/allocation/go/allocation.pb.go +++ b/pkg/allocation/go/allocation.pb.go @@ -280,6 +280,7 @@ type AllocationResponse struct { Ports []*AllocationResponse_GameServerStatusPort `protobuf:"bytes,3,rep,name=ports,proto3" json:"ports,omitempty"` Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` NodeName string `protobuf:"bytes,5,opt,name=nodeName,proto3" json:"nodeName,omitempty"` + Source string `protobuf:"bytes,6,opt,name=source,proto3" json:"source,omitempty"` } func (x *AllocationResponse) Reset() { @@ -342,6 +343,13 @@ func (x *AllocationResponse) GetNodeName() string { return "" } +func (x *AllocationResponse) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + // Specifies settings for multi-cluster allocation. type MultiClusterSetting struct { state protoimpl.MessageState @@ -735,7 +743,7 @@ var file_proto_allocation_allocation_proto_rawDesc = []byte{ 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x10, 0x01, 0x22, - 0xfd, 0x01, 0x0a, 0x12, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x95, 0x02, 0x0a, 0x12, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x67, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x67, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x49, @@ -746,90 +754,92 @@ var file_proto_allocation_allocation_proto_rawDesc = []byte{ 0x72, 0x74, 0x52, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x1a, - 0x3e, 0x0a, 0x14, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, - 0x81, 0x01, 0x0a, 0x13, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x0d, 0x92, 0x41, 0x0a, 0xa2, 0x02, 0x07, - 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x12, 0x41, 0x0a, 0x0e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x52, 0x0e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x22, 0x8b, 0x02, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x50, 0x61, 0x74, 0x63, - 0x68, 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, - 0x65, 0x74, 0x61, 0x50, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x48, 0x0a, 0x0b, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, - 0x65, 0x74, 0x61, 0x50, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x9d, 0x01, 0x0a, 0x0d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x12, 0x4c, 0x0a, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0xe4, 0x02, 0x0a, 0x12, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x51, 0x0a, 0x0b, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, - 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x58, 0x0a, 0x0f, 0x67, - 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x0f, 0x67, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2b, 0x0a, 0x0f, 0x47, - 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x09, - 0x0a, 0x05, 0x52, 0x45, 0x41, 0x44, 0x59, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x4c, 0x4c, - 0x4f, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x22, 0x58, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x69, - 0x6e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x22, - 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x32, 0x80, 0x01, 0x0a, 0x11, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x08, 0x41, 0x6c, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x67, 0x61, - 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x42, 0x6e, 0x5a, 0x0c, 0x2e, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x92, 0x41, 0x5d, 0x12, 0x34, 0x0a, 0x21, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x6c, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x0f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x65, 0x74, 0x2a, 0x01, - 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, - 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x3e, 0x0a, 0x14, 0x47, 0x61, 0x6d, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x6f, 0x72, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x13, 0x4d, 0x75, 0x6c, 0x74, + 0x69, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, + 0x27, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x0d, 0x92, 0x41, 0x0a, 0xa2, 0x02, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x0e, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0e, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x8b, 0x02, 0x0a, 0x09, + 0x4d, 0x65, 0x74, 0x61, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x50, 0x61, 0x74, 0x63, 0x68, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x50, 0x61, 0x74, 0x63, 0x68, + 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, + 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9d, 0x01, 0x0a, 0x0d, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x4c, 0x0a, 0x0b, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe4, 0x02, 0x0a, 0x12, 0x47, 0x61, + 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x12, 0x51, 0x0a, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x12, 0x58, 0x0a, 0x0f, 0x67, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x61, + 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x61, 0x6d, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0f, 0x67, 0x61, + 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, + 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x2b, 0x0a, 0x0f, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x41, 0x44, 0x59, 0x10, + 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x4c, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, + 0x22, 0x58, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x41, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x41, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x61, + 0x78, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x32, 0x80, 0x01, 0x0a, 0x11, 0x41, + 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x6b, 0x0a, 0x08, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x61, + 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x6c, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x42, 0x6e, 0x5a, + 0x0c, 0x2e, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x92, 0x41, 0x5d, + 0x12, 0x34, 0x0a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, + 0x6f, 0x74, 0x20, 0x73, 0x65, 0x74, 0x2a, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/allocation/go/allocation.swagger.json b/pkg/allocation/go/allocation.swagger.json index 5dbcce3ef5..3b99ce22c0 100644 --- a/pkg/allocation/go/allocation.swagger.json +++ b/pkg/allocation/go/allocation.swagger.json @@ -136,6 +136,9 @@ }, "nodeName": { "type": "string" + }, + "source": { + "type": "string" } } }, diff --git a/pkg/apis/allocation/v1/gameserverallocation.go b/pkg/apis/allocation/v1/gameserverallocation.go index efd12ce701..b0c1e7fd16 100644 --- a/pkg/apis/allocation/v1/gameserverallocation.go +++ b/pkg/apis/allocation/v1/gameserverallocation.go @@ -279,6 +279,9 @@ type GameServerAllocationStatus struct { Ports []agonesv1.GameServerStatusPort `json:"ports,omitempty"` Address string `json:"address,omitempty"` NodeName string `json:"nodeName,omitempty"` + // If the allocation is from a remote cluster, Source is the endpoint of the remote agones-allocator. + // Otherwise, Source is "local" + Source string `json:"source"` } // ApplyDefaults applies the default values to this GameServerAllocation diff --git a/pkg/gameserverallocations/allocator.go b/pkg/gameserverallocations/allocator.go index f686bb12af..b5be758310 100644 --- a/pkg/gameserverallocations/allocator.go +++ b/pkg/gameserverallocations/allocator.go @@ -78,6 +78,7 @@ const ( allocatorPort = "443" maxBatchQueue = 100 maxBatchBeforeRefresh = 100 + localAllocationSource = "local" ) var allocationRetry = wait.Backoff{ @@ -281,6 +282,7 @@ func (c *Allocator) allocateFromLocalCluster(ctx context.Context, gsa *allocatio gsa.Status.Ports = gs.Status.Ports gsa.Status.Address = gs.Status.Address gsa.Status.NodeName = gs.Status.NodeName + gsa.Status.Source = localAllocationSource } c.loggerForGameServerAllocation(gsa).Debug("Game server allocation") @@ -356,6 +358,7 @@ func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAlloca ctx, cancel := context.WithTimeout(context.Background(), c.totalRemoteAllocationTimeout) defer cancel() // nolint: errcheck // Retry on remote call failures. + var endpoint string err = Retry(remoteAllocationRetry, func() error { for i, ip := range connectionInfo.AllocationEndpoints { select { @@ -363,7 +366,7 @@ func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAlloca return ErrTotalTimeoutExceeded default: } - endpoint := addPort(ip) + endpoint = addPort(ip) c.loggerForGameServerAllocationKey("remote-allocation").WithField("request", request).WithField("endpoint", endpoint).Debug("forwarding allocation request") allocationResponse, err = c.remoteAllocationCallback(ctx, endpoint, dialOpts, request) if err != nil { @@ -383,7 +386,7 @@ func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAlloca return nil }) - return converters.ConvertAllocationResponseToGSA(allocationResponse), err + return converters.ConvertAllocationResponseToGSA(allocationResponse, endpoint), err } // createRemoteClusterDialOption creates a grpc client dial option with proper certs to make a remote call. diff --git a/pkg/gameserverallocations/metrics.go b/pkg/gameserverallocations/metrics.go index 3ec62bff25..9d881f44c9 100644 --- a/pkg/gameserverallocations/metrics.go +++ b/pkg/gameserverallocations/metrics.go @@ -107,7 +107,7 @@ func (r *metrics) setResponse(o k8sruntime.Object) { r.setStatus(string(out.Status.State)) var tags []tag.Mutator // sets the fleet name tag if possible - if out.Status.State == allocationv1.GameServerAllocationAllocated { + if out.Status.State == allocationv1.GameServerAllocationAllocated && out.Status.Source == localAllocationSource { gs, err := r.gameServerLister.GameServers(out.Namespace).Get(out.Status.GameServerName) if err != nil { r.logger.WithError(err).Warnf("failed to get gameserver:%s namespace:%s", out.Status.GameServerName, out.Namespace) diff --git a/pkg/gameserverallocations/metrics_test.go b/pkg/gameserverallocations/metrics_test.go new file mode 100644 index 0000000000..2189620132 --- /dev/null +++ b/pkg/gameserverallocations/metrics_test.go @@ -0,0 +1,119 @@ +// Copyright 2022 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gameserverallocations + +import ( + "context" + "testing" + "time" + + agonesv1 "agones.dev/agones/pkg/apis/agones/v1" + allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" + gameserverv1 "agones.dev/agones/pkg/client/listers/agones/v1" + "agones.dev/agones/pkg/util/runtime" + "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" +) + +type mockGameServerLister struct { + gameServerNamespaceLister mockGameServerNamespaceLister + gameServersCalled bool +} + +type mockGameServerNamespaceLister struct { + gameServer *agonesv1.GameServer +} + +func (s *mockGameServerLister) List(selector labels.Selector) (ret []*agonesv1.GameServer, err error) { + return ret, nil +} + +func (s *mockGameServerLister) GameServers(namespace string) gameserverv1.GameServerNamespaceLister { + s.gameServersCalled = true + return s.gameServerNamespaceLister +} + +func (s mockGameServerNamespaceLister) Get(name string) (*agonesv1.GameServer, error) { + return s.gameServer, nil +} + +func (s mockGameServerNamespaceLister) List(selector labels.Selector) (ret []*agonesv1.GameServer, err error) { + return ret, nil +} + +func TestSetResponse(t *testing.T) { + subtests := []struct { + name string + gameServer *agonesv1.GameServer + err error + allocation *allocationv1.GameServerAllocation + expectedState allocationv1.GameServerAllocationState + expectedCalled bool + }{ + { + name: "Try to get gs from local cluster for local allocation", + gameServer: &agonesv1.GameServer{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{agonesv1.FleetNameLabel: "fleetName"}, + }, + }, + allocation: &allocationv1.GameServerAllocation{ + Status: allocationv1.GameServerAllocationStatus{ + State: allocationv1.GameServerAllocationAllocated, + GameServerName: "gameServerName", + Source: "local", + }, + }, + expectedCalled: true, + }, + { + name: "Do not try to get gs from local cluster for remote allocation", + gameServer: &agonesv1.GameServer{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{agonesv1.FleetNameLabel: "fleetName"}, + }, + }, + allocation: &allocationv1.GameServerAllocation{ + Status: allocationv1.GameServerAllocationStatus{ + State: allocationv1.GameServerAllocationAllocated, + GameServerName: "gameServerName", + Source: "33.188.237.156:443", + }, + }, + expectedCalled: false, + }, + } + + for _, subtest := range subtests { + gsl := mockGameServerLister{ + gameServerNamespaceLister: mockGameServerNamespaceLister{ + gameServer: subtest.gameServer, + }, + } + + metrics := metrics{ + ctx: context.Background(), + gameServerLister: &gsl, + logger: runtime.NewLoggerWithSource("metrics_test"), + start: time.Now(), + } + + t.Run(subtest.name, func(t *testing.T) { + metrics.setResponse(subtest.allocation) + assert.Equal(t, subtest.expectedCalled, gsl.gameServersCalled) + }) + } +} diff --git a/proto/allocation/allocation.proto b/proto/allocation/allocation.proto index ad3081521b..ea55d2351d 100644 --- a/proto/allocation/allocation.proto +++ b/proto/allocation/allocation.proto @@ -84,6 +84,7 @@ message AllocationResponse { repeated GameServerStatusPort ports = 3; string address = 4; string nodeName = 5; + string source = 6; // The gameserver port info that is allocated. message GameServerStatusPort { diff --git a/site/content/en/docs/Advanced/multi-cluster-allocation.md b/site/content/en/docs/Advanced/multi-cluster-allocation.md index 09ab6496d9..4a4b9e50d6 100644 --- a/site/content/en/docs/Advanced/multi-cluster-allocation.md +++ b/site/content/en/docs/Advanced/multi-cluster-allocation.md @@ -71,7 +71,7 @@ EOF The certificates are base 64 string of the certificate file e.g. `cat ${CERT_FILE} | base64 -w 0` -Agones recommends using [cert-manager.io](https://cert-manager.io/) solution for generating client certificates. +Agones recommends using [cert-manager.io](https://cert-manager.io/) solution for generating client certificates. 2.Add client CA to the list of authorized client certificates by agones-allocator in the targeted cluster. @@ -93,9 +93,10 @@ EOF ## Allocate multi-cluster -To enable multi-cluster allocation, set `multiClusterSetting.enabled` to `true` in {{< ghlink href="proto/allocation/allocation.proto" >}}allocation.proto{{< /ghlink >}} and send allocation requests. For more information visit [agones-allocator]({{< relref "allocator-service.md">}}). In the following, using {{< ghlink href="examples/allocator-client/main.go" >}}allocator-client sample{{< /ghlink >}}, a multi-cluster allocation request is sent to the agones-allocator service. +To enable multi-cluster allocation, set `multiClusterSetting.enabled` to `true` in {{< ghlink href="proto/allocation/allocation.proto" >}}allocation.proto{{< /ghlink >}} and send allocation requests. For more information visit [agones-allocator]({{< relref "allocator-service.md">}}). In the following, using {{< ghlink href="examples/allocator-client/main.go" >}}allocator-client sample{{< /ghlink >}}, a multi-cluster allocation request is sent to the agones-allocator service. If the allocation succeeds, the AllocationResponse will contain a {{< ghlink href="proto/allocation/allocation.proto" >}}Source{{< /ghlink >}} field which indicates the endpoint of the remote agones-allocator. Set the environment variables and store the client secrets before allocating using gRPC or REST APIs + ```bash #!/bin/bash diff --git a/site/content/en/docs/Reference/agones_crd_api_reference.html b/site/content/en/docs/Reference/agones_crd_api_reference.html index ff39890f93..b474dd5796 100644 --- a/site/content/en/docs/Reference/agones_crd_api_reference.html +++ b/site/content/en/docs/Reference/agones_crd_api_reference.html @@ -3,10 +3,13 @@ description="Detailed list of Agones Custom Resource Definitions available" +++ -{{% feature expiryVersion="1.26.0" %}} +{{% feature expiryVersion="1.29.0" %}}

Packages:

-

autoscaling.agones.dev/v1

+

allocation.agones.dev/v1

Package v1 is the v1 version of the API.

Resource Types: -

FleetAutoscaler +

GameServerAllocation

-

FleetAutoscaler is the data structure for a FleetAutoscaler resource

+

GameServerAllocation is the data structure for allocating against a set of +GameServers, defined selectors selectors

@@ -46,7 +47,7 @@

FleetAutoscaler string

@@ -55,13 +56,13 @@

FleetAutoscaler kind
string -

+ @@ -86,132 +87,117 @@

FleetAutoscaler

-autoscaling.agones.dev/v1 +allocation.agones.dev/v1
FleetAutoscalerGameServerAllocation
metadata
- + Kubernetes meta/v1.ObjectMeta @@ -75,8 +76,8 @@

FleetAutoscaler

spec
- -FleetAutoscalerSpec + +GameServerAllocationSpec
- -
-fleetName
+multiClusterSetting
-string + +MultiClusterSetting +
+

MultiClusterPolicySelector if specified, multi-cluster policies are applied. +Otherwise, allocation will happen locally.

-policy
+required
- -FleetAutoscalerPolicy + +GameServerSelector
-

Autoscaling policy

+

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. +Required is the GameServer selector from which to choose GameServers from. +Defaults to all GameServers.

-sync
+preferred
- -FleetAutoscalerSync + +[]GameServerSelector
-(Optional) -

[Stage:Beta] -[FeatureFlag:CustomFasSyncInterval] -Sync defines when FleetAutoscalers runs autoscaling

-
+

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. +Preferred is an ordered list of preferred GameServer selectors +that are optional to be fulfilled, but will be searched before the required selector. +If the first selector is not matched, the selection attempts the second selector, and so on. +If any of the preferred selectors are matched, the required selector is not considered. +This is useful for things like smoke testing of new game servers.

-status
+selectors
- -FleetAutoscalerStatus + +[]GameServerSelector +

Ordered list of GameServer label selectors. +If the first selector is not matched, the selection attempts the second selector, and so on. +This is useful for things like smoke testing of new game servers. +Note: This field can only be set if neither Required or Preferred is set.

- - -

BufferPolicy -

-

-(Appears on: -FleetAutoscalerPolicy) -

-

-

BufferPolicy controls the desired behavior of the buffer policy.

-

- - - - - - - - + +
FieldDescription
-maxReplicas
+scheduling
-int32 +agones.dev/agones/pkg/apis.SchedulingStrategy
-

MaxReplicas is the maximum amount of replicas that the fleet may have. -It must be bigger than both MinReplicas and BufferSize

+

Scheduling strategy. Defaults to “Packed”.

-minReplicas
+metadata
-int32 + +MetaPatch +
-

MinReplicas is the minimum amount of replicas that the fleet must have -If zero, it is ignored. -If non zero, it must be smaller than MaxReplicas and bigger than BufferSize

+

MetaPatch is optional custom metadata that is added to the game server at allocation +You can use this to tell the server necessary session data

+
-bufferSize
+status
-k8s.io/apimachinery/pkg/util/intstr.IntOrString + +GameServerAllocationStatus + -

BufferSize defines how many replicas the autoscaler tries to have ready all the time -Value can be an absolute number (ex: 5) or a percentage of desired gs instances (ex: 15%) -Absolute number is calculated from percentage by rounding up. -Example: when this is set to 20%, the autoscaler will make sure that 20% -of the fleet’s game server replicas are ready. When this is set to 20, -the autoscaler will make sure that there are 20 available game servers -Must be bigger than 0 -Note: by “ready” we understand in this case “non-allocated”; this is done to ensure robustness -and computation stability in different edge case (fleet just created, not enough -capacity in the cluster etc)

-

FixedIntervalSync +

GameServerAllocationSpec

(Appears on: -FleetAutoscalerSync) +GameServerAllocation)

-

FixedIntervalSync controls the desired behavior of the fixed interval based sync.

+

GameServerAllocationSpec is the spec for a GameServerAllocation

@@ -223,93 +209,111 @@

FixedIntervalSync

- -
-seconds
+multiClusterSetting
-int32 + +MultiClusterSetting +
-

Seconds defines how often we run fleet autoscaling in seconds

+

MultiClusterPolicySelector if specified, multi-cluster policies are applied. +Otherwise, allocation will happen locally.

-

FleetAutoscaleRequest -

-

-(Appears on: -FleetAutoscaleReview) -

-

-

FleetAutoscaleRequest defines the request to webhook autoscaler endpoint

-

- - - - + + - -
FieldDescription +required
+ + +GameServerSelector + + +
+

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. +Required is the GameServer selector from which to choose GameServers from. +Defaults to all GameServers.

+
-uid
+preferred
-k8s.io/apimachinery/pkg/types.UID + +[]GameServerSelector +
-

UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are -otherwise identical (parallel requests, requests when earlier requests did not modify etc) -The UID is meant to track the round trip (request/response) between the Autoscaler and the WebHook, not the user request. -It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.

+

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. +Preferred is an ordered list of preferred GameServer selectors +that are optional to be fulfilled, but will be searched before the required selector. +If the first selector is not matched, the selection attempts the second selector, and so on. +If any of the preferred selectors are matched, the required selector is not considered. +This is useful for things like smoke testing of new game servers.

-name
+selectors
-string + +[]GameServerSelector +
-

Name is the name of the Fleet being scaled

+

Ordered list of GameServer label selectors. +If the first selector is not matched, the selection attempts the second selector, and so on. +This is useful for things like smoke testing of new game servers. +Note: This field can only be set if neither Required or Preferred is set.

-namespace
+scheduling
-string +agones.dev/agones/pkg/apis.SchedulingStrategy
-

Namespace is the namespace associated with the request (if any).

+

Scheduling strategy. Defaults to “Packed”.

-status
+metadata
- -FleetStatus + +MetaPatch
-

The Fleet’s status values

+

MetaPatch is optional custom metadata that is added to the game server at allocation +You can use this to tell the server necessary session data

-

FleetAutoscaleResponse +

GameServerAllocationState +(string alias)

+

+(Appears on: +GameServerAllocationStatus) +

+

+

GameServerAllocationState is the Allocation state

+

+

GameServerAllocationStatus

(Appears on: -FleetAutoscaleReview) +GameServerAllocation)

-

FleetAutoscaleResponse defines the response of webhook autoscaler endpoint

+

GameServerAllocationStatus is the status for an GameServerAllocation resource

@@ -321,61 +325,44 @@

FleetAutoscaleResponse

- -
-uid
+state
-k8s.io/apimachinery/pkg/types.UID + +GameServerAllocationState +
-

UID is an identifier for the individual request/response. -This should be copied over from the corresponding FleetAutoscaleRequest.

+

GameServerState is the current state of an GameServerAllocation, e.g. Allocated, or UnAllocated

-scale
+gameServerName
-bool +string
-

Set to false if no scaling should occur to the Fleet

-replicas
+ports
-int32 + +[]GameServerStatusPort +
-

The targeted replica count

-

FleetAutoscaleReview -

-

-

FleetAutoscaleReview is passed to the webhook with a populated Request value, -and then returned with a populated Response.

-

- - - - - - - -
FieldDescription
-request
+address
- -FleetAutoscaleRequest - +string
@@ -383,11 +370,9 @@

FleetAutoscaleReview

-response
+nodeName
- -FleetAutoscaleResponse - +string
@@ -395,14 +380,15 @@

FleetAutoscaleReview

-

FleetAutoscalerPolicy +

GameServerSelector

(Appears on: -FleetAutoscalerSpec) +GameServerAllocationSpec)

-

FleetAutoscalerPolicy describes how to scale a fleet

+

GameServerSelector contains all the filter options for selecting +a GameServer for allocation.

@@ -414,65 +400,62 @@

FleetAutoscalerPolicy

-type
+LabelSelector
- -FleetAutoscalerPolicyType + +Kubernetes meta/v1.LabelSelector
-

Type of autoscaling policy.

+

See: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/

-buffer
+gameServerState
- -BufferPolicy + +GameServerState
(Optional) -

Buffer policy config params. Present only if FleetAutoscalerPolicyType = Buffer.

+

[Stage:Beta] +[FeatureFlag:StateAllocationFilter] +GameServerState specifies which State is the filter to be used when attempting to retrieve a GameServer +via Allocation. Defaults to “Ready”. The only other option is “Allocated”, which can be used in conjunction with +label/annotation/player selectors to retrieve an already Allocated GameServer.

-webhook
+players
- -WebhookPolicy + +PlayerSelector
(Optional) -

Webhook policy config params. Present only if FleetAutoscalerPolicyType = Webhook.

+

[Stage:Alpha] +[FeatureFlag:PlayerAllocationFilter] +Players provides a filter on minimum and maximum values for player capacity when retrieving a GameServer +through Allocation. Defaults to no limits.

-

FleetAutoscalerPolicyType -(string alias)

-

-(Appears on: -FleetAutoscalerPolicy) -

-

-

FleetAutoscalerPolicyType is the policy for autoscaling -for a given Fleet

-

-

FleetAutoscalerSpec +

MetaPatch

(Appears on: -FleetAutoscaler) +GameServerAllocationSpec)

-

FleetAutoscalerSpec is the spec for a Fleet Scaler

+

MetaPatch is the metadata used to patch the GameServer metadata on allocation

@@ -484,53 +467,34 @@

FleetAutoscalerSpec

- - - -
-fleetName
- -string - -
-
-policy
+labels
- -FleetAutoscalerPolicy - +map[string]string
-

Autoscaling policy

-sync
+annotations
- -FleetAutoscalerSync - +map[string]string
-(Optional) -

[Stage:Beta] -[FeatureFlag:CustomFasSyncInterval] -Sync defines when FleetAutoscalers runs autoscaling

-

FleetAutoscalerStatus +

MultiClusterSetting

(Appears on: -FleetAutoscaler) +GameServerAllocationSpec)

-

FleetAutoscalerStatus defines the current status of a FleetAutoscaler

+

MultiClusterSetting specifies settings for multi-cluster allocation.

@@ -542,75 +506,36 @@

FleetAutoscalerStatus

- - - - - - - - - - - -
-currentReplicas
- -int32 - -
-

CurrentReplicas is the current number of gameserver replicas -of the fleet managed by this autoscaler, as last seen by the autoscaler

-
-desiredReplicas
- -int32 - -
-

DesiredReplicas is the desired number of gameserver replicas -of the fleet managed by this autoscaler, as last calculated by the autoscaler

-
-lastScaleTime
- - -Kubernetes meta/v1.Time - - -
-(Optional) -

lastScaleTime is the last time the FleetAutoscaler scaled the attached fleet,

-
-ableToScale
+enabled
bool
-

AbleToScale indicates that we can access the target fleet

-scalingLimited
+policySelector
-bool + +Kubernetes meta/v1.LabelSelector +
-

ScalingLimited indicates that the calculated scale would be above or below the range -defined by MinReplicas and MaxReplicas, and has thus been capped.

-

FleetAutoscalerSync +

PlayerSelector

(Appears on: -FleetAutoscalerSpec) +GameServerSelector)

-

FleetAutoscalerSync describes when to sync a fleet

+

PlayerSelector is the filter options for a GameServer based on player counts

@@ -622,52 +547,39 @@

FleetAutoscalerSync

-type
+minAvailable
- -FleetAutoscalerSyncType - +int64
-

Type of autoscaling sync.

-fixedInterval
+maxAvailable
- -FixedIntervalSync - +int64
-(Optional) -

FixedInterval config params. Present only if FleetAutoscalerSyncType = FixedInterval.

-

FleetAutoscalerSyncType -(string alias)

-

-(Appears on: -FleetAutoscalerSync) -

+
+

autoscaling.agones.dev/v1

-

FleetAutoscalerSyncType is the sync strategy for a given Fleet

+

Package v1 is the v1 version of the API.

-

WebhookPolicy +Resource Types: + +

FleetAutoscaler

-(Appears on: -FleetAutoscalerPolicy) -

-

-

WebhookPolicy controls the desired behavior of the webhook policy. -It contains the description of the webhook autoscaler service -used to form url which is accessible inside the cluster

+

FleetAutoscaler is the data structure for a FleetAutoscaler resource

@@ -679,177 +591,112 @@

WebhookPolicy

+ + + + - - -
-url
- -string - +apiVersion
+string
+ +autoscaling.agones.dev/v1 +
-(Optional) -

url gives the location of the webhook, in standard URL form -(scheme://host:port/path). Exactly one of url or service -must be specified.

-

The host should not refer to a service running in the cluster; use -the service field instead. The host might be resolved via external -DNS in some apiservers (e.g., kube-apiserver cannot resolve -in-cluster DNS as that would be a layering violation). host may -also be an IP address.

-

Please note that using localhost or 127.0.0.1 as a host is -risky unless you take great care to run this webhook on all hosts -which run an apiserver which might need to make calls to this -webhook. Such installs are likely to be non-portable, i.e., not easy -to turn up in a new cluster.

-

The scheme must be “https”; the URL must begin with “https://”.

-

A path is optional, and if present may be any string permissible in -a URL. You may use the path to pass an arbitrary string to the -webhook, for example, a cluster identifier.

-

Attempting to use a user or basic auth e.g. “user:password@” is not -allowed. Fragments (“#…”) and query parameters (“?…”) are not -allowed, either.

+kind
+string
FleetAutoscaler
-service
+metadata
- -Kubernetes admissionregistration/v1.ServiceReference + +Kubernetes meta/v1.ObjectMeta
-(Optional) -

service is a reference to the service for this webhook. Either -service or url must be specified.

-

If the webhook is running within the cluster, then you should use service.

+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-caBundle
+spec
-[]byte + +FleetAutoscalerSpec +
-(Optional) -

caBundle is a PEM encoded CA bundle which will be used to validate the webhook’s server certificate. -If unspecified, system trust roots on the apiserver are used.

-
-
-

multicluster.agones.dev/v1

-

-

Package v1 is the v1 version of the API.

-

-Resource Types: - -

GameServerAllocationPolicy -

-

-

GameServerAllocationPolicy is the Schema for the gameserverallocationpolicies API

-

+
+
- - - - - - - - - - - -
FieldDescription
-apiVersion
-string
- -multicluster.agones.dev/v1 - +fleetName
+ +string +
-kind
-string
GameServerAllocationPolicy
-metadata
+policy
- -Kubernetes meta/v1.ObjectMeta + +FleetAutoscalerPolicy
-Refer to the Kubernetes API documentation for the fields of the -metadata field. +

Autoscaling policy

-spec
+sync
- -GameServerAllocationPolicySpec + +FleetAutoscalerSync
-
-
- - - - - - -
-priority
- -int32 - -
+(Optional) +

[Stage:Beta] +[FeatureFlag:CustomFasSyncInterval] +Sync defines when FleetAutoscalers runs autoscaling

-weight
- -int - -
+
-connectionInfo
+status
- -ClusterConnectionInfo + +FleetAutoscalerStatus
- - -

ClusterConnectionInfo +

BufferPolicy

(Appears on: -GameServerAllocationPolicySpec) +FleetAutoscalerPolicy)

-

ClusterConnectionInfo defines the connection information for a cluster

+

BufferPolicy controls the desired behavior of the buffer policy.

@@ -861,67 +708,89 @@

ClusterConnectionInfo

+ +
-clusterName
+maxReplicas
-string +int32
-

Optional: the name of the targeted cluster

+

MaxReplicas is the maximum amount of replicas that the fleet may have. +It must be bigger than both MinReplicas and BufferSize

-allocationEndpoints
+minReplicas
-[]string +int32
-

The endpoints for the allocator service in the targeted cluster. -If the AllocationEndpoints is not set, the allocation happens on local cluster. -If there are multiple endpoints any of the endpoints that can handle allocation request should suffice

+

MinReplicas is the minimum amount of replicas that the fleet must have +If zero, it is ignored. +If non zero, it must be smaller than MaxReplicas and bigger than BufferSize

-secretName
+bufferSize
-string +k8s.io/apimachinery/pkg/util/intstr.IntOrString
-

The name of the secret that contains TLS client certificates to connect the allocator server in the targeted cluster

+

BufferSize defines how many replicas the autoscaler tries to have ready all the time +Value can be an absolute number (ex: 5) or a percentage of desired gs instances (ex: 15%) +Absolute number is calculated from percentage by rounding up. +Example: when this is set to 20%, the autoscaler will make sure that 20% +of the fleet’s game server replicas are ready. When this is set to 20, +the autoscaler will make sure that there are 20 available game servers +Must be bigger than 0 +Note: by “ready” we understand in this case “non-allocated”; this is done to ensure robustness +and computation stability in different edge case (fleet just created, not enough +capacity in the cluster etc)

+

FixedIntervalSync +

+

+(Appears on: +FleetAutoscalerSync) +

+

+

FixedIntervalSync controls the desired behavior of the fixed interval based sync.

+

+ + - - + + + +
-namespace
- -string - -
-

The cluster namespace from which to allocate gameservers

-
FieldDescription
-serverCa
+seconds
-[]byte +int32
-

The PEM encoded server CA, used by the allocator client to authenticate the remote server.

+

Seconds defines how often we run fleet autoscaling in seconds

-

ConnectionInfoIterator +

FleetAutoscaleRequest

-

ConnectionInfoIterator an iterator on ClusterConnectionInfo

+(Appears on: +FleetAutoscaleReview) +

+

+

FleetAutoscaleRequest defines the request to webhook autoscaler endpoint

@@ -933,58 +802,63 @@

ConnectionInfoIterato

-currPriority
+uid
-int +k8s.io/apimachinery/pkg/types.UID
-

currPriority Current priority index from the orderedPriorities

+

UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are +otherwise identical (parallel requests, requests when earlier requests did not modify etc) +The UID is meant to track the round trip (request/response) between the Autoscaler and the WebHook, not the user request. +It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.

-orderedPriorities
+name
-[]int32 +string
-

orderedPriorities list of ordered priorities

+

Name is the name of the Fleet being scaled

-priorityToCluster
+namespace
-map[int32]map[string][]*agones.dev/agones/pkg/apis/multicluster/v1.GameServerAllocationPolicy +string
-

priorityToCluster Map of priority to cluster-policies map

+

Namespace is the namespace associated with the request (if any).

-clusterBlackList
+status
-map[string]bool + +FleetStatus +
-

clusterBlackList the cluster blacklist for the clusters that has already returned

+

The Fleet’s status values

-

GameServerAllocationPolicySpec +

FleetAutoscaleResponse

(Appears on: -GameServerAllocationPolicy) +FleetAutoscaleReview)

-

GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy

+

FleetAutoscaleResponse defines the response of webhook autoscaler endpoint

@@ -996,55 +870,45 @@

GameServerAll

-priority
+uid
-int32 +k8s.io/apimachinery/pkg/types.UID
+

UID is an identifier for the individual request/response. +This should be copied over from the corresponding FleetAutoscaleRequest.

-weight
+scale
-int +bool
+

Set to false if no scaling should occur to the Fleet

-connectionInfo
+replicas
- -ClusterConnectionInfo - +int32
+

The targeted replica count

-
-

agones.dev/v1

-

-

Package v1 is the v1 version of the API.

-

-Resource Types: - -

Fleet +

FleetAutoscaleReview

-

Fleet is the data structure for a Fleet resource

+

FleetAutoscaleReview is passed to the webhook with a populated Request value, +and then returned with a populated Response.

@@ -1056,121 +920,108 @@

Fleet

+request
+ + +FleetAutoscaleRequest + + + - - - - - - - +
-apiVersion
-string
- -agones.dev/v1 -
-kind
-string -
Fleet
-metadata
+response
- -Kubernetes meta/v1.ObjectMeta + +FleetAutoscaleResponse
-Refer to the Kubernetes API documentation for the fields of the -metadata field.
-spec
- - -FleetSpec - - -
-
-
+
+

FleetAutoscalerPolicy +

+

+(Appears on: +FleetAutoscalerSpec) +

+

+

FleetAutoscalerPolicy describes how to scale a fleet

+

+ - - + + + + - - - - - -
-replicas
- -int32 - -
-

Replicas are the number of GameServers that should be in this set. Defaults to 0.

-
FieldDescription
-strategy
+type
- -Kubernetes apps/v1.DeploymentStrategy + +FleetAutoscalerPolicyType
-

Deployment strategy

-
-scheduling
- -agones.dev/agones/pkg/apis.SchedulingStrategy - -
-

Scheduling strategy. Defaults to “Packed”.

+

Type of autoscaling policy.

-template
+buffer
- -GameServerTemplateSpec + +BufferPolicy
-

Template the GameServer template to apply for this Fleet

-
+(Optional) +

Buffer policy config params. Present only if FleetAutoscalerPolicyType = Buffer.

-status
+webhook
- -FleetStatus + +WebhookPolicy +(Optional) +

Webhook policy config params. Present only if FleetAutoscalerPolicyType = Webhook.

-

GameServer +

FleetAutoscalerPolicyType +(string alias)

+

+(Appears on: +FleetAutoscalerPolicy) +

+

+

FleetAutoscalerPolicyType is the policy for autoscaling +for a given Fleet

+

+

FleetAutoscalerSpec

-

GameServer is the data structure for a GameServer resource. -It is worth noting that while there is a GameServerStatus Status entry for the GameServer, it is not -defined as a subresource - unlike Fleet and other Agones resources. -This is so that we can retain the ability to change multiple aspects of a GameServer in a single atomic operation, -which is particularly useful for operations such as allocation.

+(Appears on: +FleetAutoscaler) +

+

+

FleetAutoscalerSpec is the spec for a Fleet Scaler

@@ -1182,160 +1033,274 @@

GameServer

- - - - + + +
-apiVersion
-string
- -agones.dev/v1 - +fleetName
+ +string +
-kind
-string
GameServer
-metadata
+policy
- -Kubernetes meta/v1.ObjectMeta + +FleetAutoscalerPolicy
-Refer to the Kubernetes API documentation for the fields of the -metadata field. +

Autoscaling policy

-spec
+sync
- -GameServerSpec + +FleetAutoscalerSync
-
-
+(Optional) +

[Stage:Beta] +[FeatureFlag:CustomFasSyncInterval] +Sync defines when FleetAutoscalers runs autoscaling

+
+

FleetAutoscalerStatus +

+

+(Appears on: +FleetAutoscaler) +

+

+

FleetAutoscalerStatus defines the current status of a FleetAutoscaler

+

+ + + + + + + + +
FieldDescription
-container
+currentReplicas
-string +int32
-

Container specifies which Pod container is the game server. Only required if there is more than one -container defined

+

CurrentReplicas is the current number of gameserver replicas +of the fleet managed by this autoscaler, as last seen by the autoscaler

-ports
+desiredReplicas
- -[]GameServerPort - +int32
-

Ports are the array of ports that can be exposed via the game server

+

DesiredReplicas is the desired number of gameserver replicas +of the fleet managed by this autoscaler, as last calculated by the autoscaler

-health
+lastScaleTime
- -Health + +Kubernetes meta/v1.Time
-

Health configures health checking

+(Optional) +

lastScaleTime is the last time the FleetAutoscaler scaled the attached fleet,

-scheduling
+ableToScale
-agones.dev/agones/pkg/apis.SchedulingStrategy +bool
-

Scheduling strategy. Defaults to “Packed”

+

AbleToScale indicates that we can access the target fleet

-sdkServer
+scalingLimited
- -SdkServer - +bool
-

SdkServer specifies parameters for the Agones SDK Server sidecar container

+

ScalingLimited indicates that the calculated scale would be above or below the range +defined by MinReplicas and MaxReplicas, and has thus been capped.

+

FleetAutoscalerSync +

+

+(Appears on: +FleetAutoscalerSpec) +

+

+

FleetAutoscalerSync describes when to sync a fleet

+

+ + - - + + + + - -
-template
- - -Kubernetes core/v1.PodTemplateSpec - - -
-

Template describes the Pod that will be created for the GameServer

-
FieldDescription
-players
+type
- -PlayersSpec + +FleetAutoscalerSyncType
-(Optional) -

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

-
+

Type of autoscaling sync.

-status
+fixedInterval
- -GameServerStatus + +FixedIntervalSync +(Optional) +

FixedInterval config params. Present only if FleetAutoscalerSyncType = FixedInterval.

-

GameServerSet -

+

FleetAutoscalerSyncType +(string alias)

-

GameServerSet is the data structure for a set of GameServers. -This matches philosophically with the relationship between -Deployments and ReplicaSets

+(Appears on: +FleetAutoscalerSync) +

+

+

FleetAutoscalerSyncType is the sync strategy for a given Fleet

+

+

WebhookPolicy +

+

+(Appears on: +FleetAutoscalerPolicy) +

+

+

WebhookPolicy controls the desired behavior of the webhook policy. +It contains the description of the webhook autoscaler service +used to form url which is accessible inside the cluster

+

+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+url
+ +string + +
+(Optional) +

url gives the location of the webhook, in standard URL form +(scheme://host:port/path). Exactly one of url or service +must be specified.

+

The host should not refer to a service running in the cluster; use +the service field instead. The host might be resolved via external +DNS in some apiservers (e.g., kube-apiserver cannot resolve +in-cluster DNS as that would be a layering violation). host may +also be an IP address.

+

Please note that using localhost or 127.0.0.1 as a host is +risky unless you take great care to run this webhook on all hosts +which run an apiserver which might need to make calls to this +webhook. Such installs are likely to be non-portable, i.e., not easy +to turn up in a new cluster.

+

The scheme must be “https”; the URL must begin with “https://”.

+

A path is optional, and if present may be any string permissible in +a URL. You may use the path to pass an arbitrary string to the +webhook, for example, a cluster identifier.

+

Attempting to use a user or basic auth e.g. “user:password@” is not +allowed. Fragments (“#…”) and query parameters (“?…”) are not +allowed, either.

+
+service
+ + +Kubernetes admissionregistration/v1.ServiceReference + + +
+(Optional) +

service is a reference to the service for this webhook. Either +service or url must be specified.

+

If the webhook is running within the cluster, then you should use service.

+
+caBundle
+ +[]byte + +
+(Optional) +

caBundle is a PEM encoded CA bundle which will be used to validate the webhook’s server certificate. +If unspecified, system trust roots on the apiserver are used.

+
+
+

multicluster.agones.dev/v1

+

+

Package v1 is the v1 version of the API.

+

+Resource Types: + +

GameServerAllocationPolicy +

+

+

GameServerAllocationPolicy is the Schema for the gameserverallocationpolicies API

@@ -1351,7 +1316,7 @@

GameServerSet string

@@ -1360,13 +1325,13 @@

GameServerSet kind
string -

+ @@ -1391,65 +1356,49 @@

GameServerSet

-agones.dev/v1 +multicluster.agones.dev/v1
GameServerSetGameServerAllocationPolicy
metadata
- + Kubernetes meta/v1.ObjectMeta @@ -1380,8 +1345,8 @@

GameServerSet

spec
- -GameServerSetSpec + +GameServerAllocationPolicySpec
-replicas
+priority
int32
-

Replicas are the number of GameServers that should be in this set

-scheduling
+weight
-agones.dev/agones/pkg/apis.SchedulingStrategy +int
-

Scheduling strategy. Defaults to “Packed”.

-template
+connectionInfo
- -GameServerTemplateSpec + +ClusterConnectionInfo
-

Template the GameServer template to apply for this GameServerSet

- - -status
- - -GameServerSetStatus - - - - - - -

AggregatedPlayerStatus +

ClusterConnectionInfo

(Appears on: -FleetStatus, -GameServerSetStatus) +GameServerAllocationPolicySpec)

-

AggregatedPlayerStatus stores total player tracking values

+

ClusterConnectionInfo defines the connection information for a cluster

@@ -1461,34 +1410,67 @@

AggregatedPlayerStatus

+ + + + + + + + + + + +
-count
+clusterName
-int64 +string
+

Optional: the name of the targeted cluster

-capacity
+allocationEndpoints
-int64 +[]string + +
+

The endpoints for the allocator service in the targeted cluster. +If the AllocationEndpoints is not set, the allocation happens on local cluster. +If there are multiple endpoints any of the endpoints that can handle allocation request should suffice

+
+secretName
+ +string + +
+

The name of the secret that contains TLS client certificates to connect the allocator server in the targeted cluster

+
+namespace
+ +string + +
+

The cluster namespace from which to allocate gameservers

+
+serverCa
+ +[]byte
+

The PEM encoded server CA, used by the allocator client to authenticate the remote server.

-

FleetSpec +

ConnectionInfoIterator

-(Appears on: -Fleet) -

-

-

FleetSpec is the spec for a Fleet

+

ConnectionInfoIterator an iterator on ClusterConnectionInfo

@@ -1500,63 +1482,58 @@

FleetSpec

-replicas
+currPriority
-int32 +int
-

Replicas are the number of GameServers that should be in this set. Defaults to 0.

+

currPriority Current priority index from the orderedPriorities

-strategy
+orderedPriorities
- -Kubernetes apps/v1.DeploymentStrategy - +[]int32
-

Deployment strategy

+

orderedPriorities list of ordered priorities

-scheduling
+priorityToCluster
-agones.dev/agones/pkg/apis.SchedulingStrategy +map[int32]map[string][]*agones.dev/agones/pkg/apis/multicluster/v1.GameServerAllocationPolicy
-

Scheduling strategy. Defaults to “Packed”.

+

priorityToCluster Map of priority to cluster-policies map

-template
+clusterBlackList
- -GameServerTemplateSpec - +map[string]bool
-

Template the GameServer template to apply for this Fleet

+

clusterBlackList the cluster blacklist for the clusters that has already returned

-

FleetStatus +

GameServerAllocationPolicySpec

(Appears on: -Fleet, -FleetAutoscaleRequest) +GameServerAllocationPolicy)

-

FleetStatus is the status of a Fleet

+

GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy

@@ -1568,76 +1545,55 @@

FleetStatus

- - - - - - - -
-replicas
+priority
int32
-

Replicas the total number of current GameServer replicas

-readyReplicas
+weight
-int32 +int
-

ReadyReplicas are the number of Ready GameServer replicas

-reservedReplicas
+connectionInfo
-int32 + +ClusterConnectionInfo +
-

ReservedReplicas are the total number of Reserved GameServer replicas in this fleet. -Reserved instances won’t be deleted on scale down, but won’t cause an autoscaler to scale up.

-
-allocatedReplicas
- -int32 - -
-

AllocatedReplicas are the number of Allocated GameServer replicas

-
-players
- - -AggregatedPlayerStatus - - -
-(Optional) -

[Stage:Alpha] -[FeatureFlag:PlayerTracking] -Players are the current total player capacity and count for this Fleet

-

GameServerPort -

+
+

agones.dev/v1

-(Appears on: -GameServerSpec) +

Package v1 is the v1 version of the API.

+Resource Types: + +

Fleet +

-

GameServerPort defines a set of Ports that -are to be exposed via the GameServer

+

Fleet is the data structure for a Fleet resource

@@ -1649,143 +1605,121 @@

GameServerPort

+apiVersion
+string - + - +
+
+
-name
- -string - -
-

Name is the descriptive name of the port

+ +agones.dev/v1 +
-portPolicy
- - -PortPolicy - - -
-

PortPolicy defines the policy for how the HostPort is populated. -Dynamic port will allocate a HostPort within the selected MIN_PORT and MAX_PORT range passed to the controller -at installation time. -When Static portPolicy is specified, HostPort is required, to specify the port that game clients will -connect to

+kind
+string
Fleet
-container
+metadata
-string + +Kubernetes meta/v1.ObjectMeta +
-(Optional) -

Container is the name of the container on which to open the port. Defaults to the game server container.

+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-containerPort
+spec
-int32 + +FleetSpec +
-

ContainerPort is the port that is being opened on the specified container’s process

-
- -
-hostPort
+replicas
int32
-

HostPort the port exposed on the host for clients to connect to

+

Replicas are the number of GameServers that should be in this set. Defaults to 0.

-protocol
+strategy
- -Kubernetes core/v1.Protocol + +Kubernetes apps/v1.DeploymentStrategy
-

Protocol is the network protocol being used. Defaults to UDP. TCP and TCPUDP are other options.

+

Deployment strategy

-

GameServerSetSpec -

-

-(Appears on: -GameServerSet) -

-

-

GameServerSetSpec the specification for GameServerSet

-

- - - - - - - - + +
FieldDescription
-replicas
+scheduling
-int32 +agones.dev/agones/pkg/apis.SchedulingStrategy
-

Replicas are the number of GameServers that should be in this set

+

Scheduling strategy. Defaults to “Packed”.

-scheduling
+template
-agones.dev/agones/pkg/apis.SchedulingStrategy + +GameServerTemplateSpec +
-

Scheduling strategy. Defaults to “Packed”.

+

Template the GameServer template to apply for this Fleet

+
-template
+status
- -GameServerTemplateSpec + +FleetStatus -

Template the GameServer template to apply for this GameServerSet

-

GameServerSetStatus +

GameServer

-(Appears on: -GameServerSet) -

-

-

GameServerSetStatus is the status of a GameServerSet

+

GameServer is the data structure for a GameServer resource. +It is worth noting that while there is a GameServerStatus Status entry for the GameServer, it is not +defined as a subresource - unlike Fleet and other Agones resources. +This is so that we can retain the ability to change multiple aspects of a GameServer in a single atomic operation, +which is particularly useful for operations such as allocation.

@@ -1797,95 +1731,48 @@

GameServerSetStatus

- - - - - - - - +apiVersion
+string - + - - -
-replicas
- -int32 - -
-

Replicas is the total number of current GameServer replicas

-
-readyReplicas
- -int32 - -
-

ReadyReplicas is the number of Ready GameServer replicas

-
-reservedReplicas
- -int32 - -
-

ReservedReplicas is the number of Reserved GameServer replicas

+ +agones.dev/v1 +
-allocatedReplicas
- -int32 - -
-

AllocatedReplicas is the number of Allocated GameServer replicas

+kind
+string
GameServer
-shutdownReplicas
+metadata
-int32 + +Kubernetes meta/v1.ObjectMeta +
-

ShutdownReplicas is the number of Shutdown GameServers replicas

+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-players
+spec
- -AggregatedPlayerStatus + +GameServerSpec
-(Optional) -

[Stage:Alpha] -[FeatureFlag:PlayerTracking] -Players is the current total player capacity and count for this GameServerSet

-
-

GameServerSpec -

-

-(Appears on: -GameServer, -GameServerTemplateSpec) -

-

-

GameServerSpec is the spec for a GameServer resource

-

+
+
- - - - - - - +
FieldDescription
container
@@ -1952,7 +1839,7 @@

GameServerSpec

template
- + Kubernetes core/v1.PodTemplateSpec @@ -1975,26 +1862,29 @@

GameServerSpec

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

+ + + + +status
+ + +GameServerStatus + + + + + + -

GameServerState -(string alias)

-

-(Appears on: -GameServerSelector, -GameServerStatus) -

-

-

GameServerState is the state for the GameServer

-

-

GameServerStatus +

GameServerSet

-(Appears on: -GameServer) -

-

-

GameServerStatus is the status for a GameServer resource

+

GameServerSet is the data structure for a set of GameServers. +This matches philosophically with the relationship between +Deployments and ReplicaSets

@@ -2006,88 +1896,109 @@

GameServerStatus

+ + + + + + + + - +
+
+
-state
+apiVersion
+string
+ +agones.dev/v1 + +
+kind
+string +
GameServerSet
+metadata
- -GameServerState + +Kubernetes meta/v1.ObjectMeta
-

GameServerState is the current state of a GameServer, e.g. Creating, Starting, Ready, etc

+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-ports
+spec
- -[]GameServerStatusPort + +GameServerSetSpec
-
+ +
-address
+replicas
-string +int32
+

Replicas are the number of GameServers that should be in this set

-nodeName
+scheduling
-string +agones.dev/agones/pkg/apis.SchedulingStrategy
+

Scheduling strategy. Defaults to “Packed”.

-reservedUntil
+template
- -Kubernetes meta/v1.Time + +GameServerTemplateSpec
+

Template the GameServer template to apply for this GameServerSet

+
-players
+status
- -PlayerStatus + +GameServerSetStatus -(Optional) -

[Stage:Alpha] -[FeatureFlag:PlayerTracking]

-

GameServerStatusPort +

AggregatedPlayerStatus

(Appears on: -GameServerAllocationStatus, -GameServerStatus) +FleetStatus, +GameServerSetStatus)

-

GameServerStatusPort shows the port that was allocated to a -GameServer.

+

AggregatedPlayerStatus stores total player tracking values

@@ -2099,9 +2010,9 @@

GameServerStatusPort

-name
+count
-string +int64
@@ -2109,9 +2020,9 @@

GameServerStatusPort

-port
+capacity
-int32 +int64
@@ -2119,15 +2030,14 @@

GameServerStatusPort

-

GameServerTemplateSpec +

FleetSpec

(Appears on: -FleetSpec, -GameServerSetSpec) +Fleet)

-

GameServerTemplateSpec is a template for GameServers

+

FleetSpec is the spec for a Fleet

@@ -2139,133 +2049,144 @@

GameServerTemplateSpec

-metadata
+replicas
- -Kubernetes meta/v1.ObjectMeta - +int32
-Refer to the Kubernetes API documentation for the fields of the -metadata field. +

Replicas are the number of GameServers that should be in this set. Defaults to 0.

-spec
+strategy
- -GameServerSpec + +Kubernetes apps/v1.DeploymentStrategy
-
-
- +

Deployment strategy

+ + + +
-container
+scheduling
-string +agones.dev/agones/pkg/apis.SchedulingStrategy
-

Container specifies which Pod container is the game server. Only required if there is more than one -container defined

+

Scheduling strategy. Defaults to “Packed”.

-ports
+template
- -[]GameServerPort + +GameServerTemplateSpec
-

Ports are the array of ports that can be exposed via the game server

+

Template the GameServer template to apply for this Fleet

+

FleetStatus +

+

+(Appears on: +Fleet, +FleetAutoscaleRequest) +

+

+

FleetStatus is the status of a Fleet

+

+ + + + + + + + - -
FieldDescription
-health
+replicas
- -Health - +int32
-

Health configures health checking

+

Replicas the total number of current GameServer replicas

-scheduling
+readyReplicas
-agones.dev/agones/pkg/apis.SchedulingStrategy +int32
-

Scheduling strategy. Defaults to “Packed”

+

ReadyReplicas are the number of Ready GameServer replicas

-sdkServer
+reservedReplicas
- -SdkServer - +int32
-

SdkServer specifies parameters for the Agones SDK Server sidecar container

+

ReservedReplicas are the total number of Reserved GameServer replicas in this fleet. +Reserved instances won’t be deleted on scale down, but won’t cause an autoscaler to scale up.

-template
+allocatedReplicas
- -Kubernetes core/v1.PodTemplateSpec - +int32
-

Template describes the Pod that will be created for the GameServer

+

AllocatedReplicas are the number of Allocated GameServer replicas

players
- -PlayersSpec + +AggregatedPlayerStatus
(Optional) -

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

-
+

[Stage:Alpha] +[FeatureFlag:PlayerTracking] +Players are the current total player capacity and count for this Fleet

-

Health +

GameServerPort

(Appears on: GameServerSpec)

-

Health configures health checking on the GameServer

+

GameServerPort defines a set of Ports that +are to be exposed via the GameServer

@@ -2277,107 +2198,89 @@

Health

- -
-disabled
+name
-bool +string
-

Disabled is whether health checking is disabled or not

+

Name is the descriptive name of the port

-periodSeconds
+portPolicy
-int32 + +PortPolicy +
-

PeriodSeconds is the number of seconds each health ping has to occur in

+

PortPolicy defines the policy for how the HostPort is populated. +Dynamic port will allocate a HostPort within the selected MIN_PORT and MAX_PORT range passed to the controller +at installation time. +When Static portPolicy is specified, HostPort is required, to specify the port that game clients will +connect to

-failureThreshold
+container
-int32 +string
-

FailureThreshold how many failures in a row constitutes unhealthy

+(Optional) +

Container is the name of the container on which to open the port. Defaults to the game server container.

-initialDelaySeconds
+containerPort
int32
-

InitialDelaySeconds initial delay before checking health

+

ContainerPort is the port that is being opened on the specified container’s process

-

PlayerStatus -

-

-(Appears on: -GameServerStatus) -

-

-

PlayerStatus stores the current player capacity values

-

- - - - - - - - - - - -
FieldDescription
-count
- -int64 - -
-
-capacity
+hostPort
-int64 +int32
+

HostPort the port exposed on the host for clients to connect to

-ids
+protocol
-[]string + +Kubernetes core/v1.Protocol +
+

Protocol is the network protocol being used. Defaults to UDP. TCP and TCPUDP are other options.

-

PlayersSpec +

GameServerSetSpec

(Appears on: -GameServerSpec) +GameServerSet)

-

PlayersSpec tracks the initial player capacity

+

GameServerSetSpec the specification for GameServerSet

@@ -2389,33 +2292,49 @@

PlayersSpec

+ + + + + + + +
-initialCapacity
+replicas
-int64 +int32
+

Replicas are the number of GameServers that should be in this set

+
+scheduling
+ +agones.dev/agones/pkg/apis.SchedulingStrategy + +
+

Scheduling strategy. Defaults to “Packed”.

+
+template
+ + +GameServerTemplateSpec + + +
+

Template the GameServer template to apply for this GameServerSet

-

PortPolicy -(string alias)

-

-(Appears on: -GameServerPort) -

-

-

PortPolicy is the port policy for the GameServer

-

-

SdkServer +

GameServerSetStatus

(Appears on: -GameServerSpec) +GameServerSet)

-

SdkServer specifies parameters for the Agones SDK Server sidecar container

+

GameServerSetStatus is the status of a GameServerSet

@@ -2427,230 +2346,204 @@

SdkServer

- -
-logLevel
+replicas
- -SdkServerLogLevel - +int32
-

LogLevel for SDK server (sidecar) logs. Defaults to “Info”

+

Replicas is the total number of current GameServer replicas

-grpcPort
+readyReplicas
int32
-

GRPCPort is the port on which the SDK Server binds the gRPC server to accept incoming connections

+

ReadyReplicas is the number of Ready GameServer replicas

-httpPort
+reservedReplicas
int32
-

HTTPPort is the port on which the SDK Server binds the HTTP gRPC gateway server to accept incoming connections

+

ReservedReplicas is the number of Reserved GameServer replicas

-

SdkServerLogLevel -(string alias)

-

-(Appears on: -SdkServer) -

-

-

SdkServerLogLevel is the log level for SDK server (sidecar) logs

-

-
-

allocation.agones.dev/v1

-

-

Package v1 is the v1 version of the API.

-

-Resource Types: - -

GameServerAllocation -

-

-

GameServerAllocation is the data structure for allocating against a set of -GameServers, defined selectors selectors

-

- - - - - - - - - - - - + + +
FieldDescription
-apiVersion
-string
- -allocation.agones.dev/v1 - +allocatedReplicas
+ +int32 +
-kind
-string +

AllocatedReplicas is the number of Allocated GameServer replicas

GameServerAllocation
-metadata
+shutdownReplicas
- -Kubernetes meta/v1.ObjectMeta - +int32
-Refer to the Kubernetes API documentation for the fields of the -metadata field. +

ShutdownReplicas is the number of Shutdown GameServers replicas

-spec
+players
- -GameServerAllocationSpec + +AggregatedPlayerStatus
-
-
+(Optional) +

[Stage:Alpha] +[FeatureFlag:PlayerTracking] +Players is the current total player capacity and count for this GameServerSet

+
+

GameServerSpec +

+

+(Appears on: +GameServer, +GameServerTemplateSpec) +

+

+

GameServerSpec is the spec for a GameServer resource

+

+ + + + + + + - -
FieldDescription
-multiClusterSetting
+container
- -MultiClusterSetting - +string
-

MultiClusterPolicySelector if specified, multi-cluster policies are applied. -Otherwise, allocation will happen locally.

+

Container specifies which Pod container is the game server. Only required if there is more than one +container defined

-required
+ports
- -GameServerSelector + +[]GameServerPort
-

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. -Required is the GameServer selector from which to choose GameServers from. -Defaults to all GameServers.

+

Ports are the array of ports that can be exposed via the game server

-preferred
+health
- -[]GameServerSelector + +Health
-

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. -Preferred is an ordered list of preferred GameServer selectors -that are optional to be fulfilled, but will be searched before the required selector. -If the first selector is not matched, the selection attempts the second selector, and so on. -If any of the preferred selectors are matched, the required selector is not considered. -This is useful for things like smoke testing of new game servers.

+

Health configures health checking

-selectors
+scheduling
- -[]GameServerSelector - +agones.dev/agones/pkg/apis.SchedulingStrategy
-

Ordered list of GameServer label selectors. -If the first selector is not matched, the selection attempts the second selector, and so on. -This is useful for things like smoke testing of new game servers. -Note: This field can only be set if neither Required or Preferred is set.

+

Scheduling strategy. Defaults to “Packed”

-scheduling
+sdkServer
-agones.dev/agones/pkg/apis.SchedulingStrategy + +SdkServer +
-

Scheduling strategy. Defaults to “Packed”.

+

SdkServer specifies parameters for the Agones SDK Server sidecar container

-metadata
+template
- -MetaPatch + +Kubernetes core/v1.PodTemplateSpec
-

MetaPatch is optional custom metadata that is added to the game server at allocation -You can use this to tell the server necessary session data

-
+

Template describes the Pod that will be created for the GameServer

-status
+players
- -GameServerAllocationStatus + +PlayersSpec +(Optional) +

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

-

GameServerAllocationSpec -

+

GameServerState +(string alias)

(Appears on: -GameServerAllocation) +GameServerSelector, +GameServerStatus)

-

GameServerAllocationSpec is the spec for a GameServerAllocation

+

GameServerState is the state for the GameServer

+

+

GameServerStatus +

+

+(Appears on: +GameServer) +

+

+

GameServerStatus is the status for a GameServer resource

@@ -2662,111 +2555,128 @@

GameServerAllocationS

-multiClusterSetting
+state
- -MultiClusterSetting + +GameServerState
-

MultiClusterPolicySelector if specified, multi-cluster policies are applied. -Otherwise, allocation will happen locally.

+

GameServerState is the current state of a GameServer, e.g. Creating, Starting, Ready, etc

-required
+ports
- -GameServerSelector + +[]GameServerStatusPort
-

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. -Required is the GameServer selector from which to choose GameServers from. -Defaults to all GameServers.

-preferred
+address
- -[]GameServerSelector - +string
-

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. -Preferred is an ordered list of preferred GameServer selectors -that are optional to be fulfilled, but will be searched before the required selector. -If the first selector is not matched, the selection attempts the second selector, and so on. -If any of the preferred selectors are matched, the required selector is not considered. -This is useful for things like smoke testing of new game servers.

-selectors
+nodeName
- -[]GameServerSelector - +string
-

Ordered list of GameServer label selectors. -If the first selector is not matched, the selection attempts the second selector, and so on. -This is useful for things like smoke testing of new game servers. -Note: This field can only be set if neither Required or Preferred is set.

-scheduling
+reservedUntil
-agones.dev/agones/pkg/apis.SchedulingStrategy + +Kubernetes meta/v1.Time +
-

Scheduling strategy. Defaults to “Packed”.

-metadata
+players
- -MetaPatch + +PlayerStatus
-

MetaPatch is optional custom metadata that is added to the game server at allocation -You can use this to tell the server necessary session data

+(Optional) +

[Stage:Alpha] +[FeatureFlag:PlayerTracking]

-

GameServerAllocationState -(string alias)

+

GameServerStatusPort +

(Appears on: -GameServerAllocationStatus) +GameServerAllocationStatus, +GameServerStatus)

-

GameServerAllocationState is the Allocation state

+

GameServerStatusPort shows the port that was allocated to a +GameServer.

-

GameServerAllocationStatus + + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+
+port
+ +int32 + +
+
+

GameServerTemplateSpec

(Appears on: -GameServerAllocation) +FleetSpec, +GameServerSetSpec)

-

GameServerAllocationStatus is the status for an GameServerAllocation resource

+

GameServerTemplateSpec is a template for GameServers

@@ -2778,137 +2688,133 @@

GameServerAllocatio

+
-state
+metadata
- -GameServerAllocationState + +Kubernetes meta/v1.ObjectMeta
-

GameServerState is the current state of an GameServerAllocation, e.g. Allocated, or UnAllocated

+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-gameServerName
+spec
+ + +GameServerSpec + + +
+
+
+ + + - -
+container
string
+

Container specifies which Pod container is the game server. Only required if there is more than one +container defined

ports
- -[]GameServerStatusPort + +[]GameServerPort
+

Ports are the array of ports that can be exposed via the game server

-address
+health
-string + +Health +
+

Health configures health checking

-nodeName
+scheduling
-string +agones.dev/agones/pkg/apis.SchedulingStrategy
+

Scheduling strategy. Defaults to “Packed”

-

GameServerSelector -

-

-(Appears on: -GameServerAllocationSpec) -

-

-

GameServerSelector contains all the filter options for selecting -a GameServer for allocation.

-

- - - - - - - - + +
FieldDescription
-LabelSelector
+sdkServer
- -Kubernetes meta/v1.LabelSelector + +SdkServer
-

See: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/

+

SdkServer specifies parameters for the Agones SDK Server sidecar container

-gameServerState
+template
- -GameServerState + +Kubernetes core/v1.PodTemplateSpec
-(Optional) -

[Stage:Beta] -[FeatureFlag:StateAllocationFilter] -GameServerState specifies which State is the filter to be used when attempting to retrieve a GameServer -via Allocation. Defaults to “Ready”. The only other option is “Allocated”, which can be used in conjunction with -label/annotation/player selectors to retrieve an already Allocated GameServer.

+

Template describes the Pod that will be created for the GameServer

players
- -PlayerSelector + +PlayersSpec
(Optional) -

[Stage:Alpha] -[FeatureFlag:PlayerAllocationFilter] -Players provides a filter on minimum and maximum values for player capacity when retrieving a GameServer -through Allocation. Defaults to no limits.

+

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

+
-

MetaPatch +

Health

(Appears on: -GameServerAllocationSpec) +GameServerSpec)

-

MetaPatch is the metadata used to patch the GameServer metadata on allocation

+

Health configures health checking on the GameServer

@@ -2920,75 +2826,58 @@

MetaPatch

- -
-labels
+disabled
-map[string]string +bool
+

Disabled is whether health checking is disabled or not

-annotations
+periodSeconds
-map[string]string +int32
+

PeriodSeconds is the number of seconds each health ping has to occur in

-

MultiClusterSetting -

-

-(Appears on: -GameServerAllocationSpec) -

-

-

MultiClusterSetting specifies settings for multi-cluster allocation.

-

- - - - - - - -
FieldDescription
-enabled
+failureThreshold
-bool +int32
+

FailureThreshold how many failures in a row constitutes unhealthy

-policySelector
+initialDelaySeconds
- -Kubernetes meta/v1.LabelSelector - +int32
+

InitialDelaySeconds initial delay before checking health

-

PlayerSelector +

PlayerStatus

(Appears on: -GameServerSelector) +GameServerStatus)

-

PlayerSelector is the filter options for a GameServer based on player counts

+

PlayerStatus stores the current player capacity values

@@ -3000,7 +2889,7 @@

PlayerSelector

+ + + + + + + +
-minAvailable
+count
int64 @@ -3010,7 +2899,46 @@

PlayerSelector

-maxAvailable
+capacity
+ +int64 + +
+
+ids
+ +[]string + +
+
+

PlayersSpec +

+

+(Appears on: +GameServerSpec) +

+

+

PlayersSpec tracks the initial player capacity

+

+ + + + + + + + + +
FieldDescription
+initialCapacity
int64 @@ -3020,18 +2948,87 @@

PlayerSelector

+

PortPolicy +(string alias)

+

+(Appears on: +GameServerPort) +

+

+

PortPolicy is the port policy for the GameServer

+

+

SdkServer +

+

+(Appears on: +GameServerSpec) +

+

+

SdkServer specifies parameters for the Agones SDK Server sidecar container

+

+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+logLevel
+ + +SdkServerLogLevel + + +
+

LogLevel for SDK server (sidecar) logs. Defaults to “Info”

+
+grpcPort
+ +int32 + +
+

GRPCPort is the port on which the SDK Server binds the gRPC server to accept incoming connections

+
+httpPort
+ +int32 + +
+

HTTPPort is the port on which the SDK Server binds the HTTP gRPC gateway server to accept incoming connections

+
+

SdkServerLogLevel +(string alias)

+

+(Appears on: +SdkServer) +

+

+

SdkServerLogLevel is the log level for SDK server (sidecar) logs

+


Generated with gen-crd-api-reference-docs.

{{% /feature %}} -{{% feature publishVersion="1.26.0" %}} +{{% feature publishVersion="1.29.0" %}}

Packages:

-

allocation.agones.dev/v1

+

autoscaling.agones.dev/v1

Package v1 is the v1 version of the API.

Resource Types: -

GameServerAllocation +

FleetAutoscaler

-

GameServerAllocation is the data structure for allocating against a set of -GameServers, defined selectors selectors

+

FleetAutoscaler is the data structure for a FleetAutoscaler resource

@@ -3069,7 +3068,7 @@

GameServerAllocation string

@@ -3078,7 +3077,7 @@

GameServerAllocation kind
string -

+ @@ -3109,117 +3108,132 @@

GameServerAllocation

-allocation.agones.dev/v1 +autoscaling.agones.dev/v1
GameServerAllocationFleetAutoscaler
@@ -3098,8 +3097,8 @@

GameServerAllocation

spec
- -GameServerAllocationSpec + +FleetAutoscalerSpec
+ +
-multiClusterSetting
+fleetName
- -MultiClusterSetting - +string
-

MultiClusterPolicySelector if specified, multi-cluster policies are applied. -Otherwise, allocation will happen locally.

-required
+policy
- -GameServerSelector + +FleetAutoscalerPolicy
-

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. -Required is the GameServer selector from which to choose GameServers from. -Defaults to all GameServers.

+

Autoscaling policy

-preferred
+sync
- -[]GameServerSelector + +FleetAutoscalerSync
-

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. -Preferred is an ordered list of preferred GameServer selectors -that are optional to be fulfilled, but will be searched before the required selector. -If the first selector is not matched, the selection attempts the second selector, and so on. -If any of the preferred selectors are matched, the required selector is not considered. -This is useful for things like smoke testing of new game servers.

+(Optional) +

[Stage:Beta] +[FeatureFlag:CustomFasSyncInterval] +Sync defines when FleetAutoscalers runs autoscaling

+
-selectors
+status
- -[]GameServerSelector + +FleetAutoscalerStatus -

Ordered list of GameServer label selectors. -If the first selector is not matched, the selection attempts the second selector, and so on. -This is useful for things like smoke testing of new game servers. -Note: This field can only be set if neither Required or Preferred is set.

+ + +

BufferPolicy +

+

+(Appears on: +FleetAutoscalerPolicy) +

+

+

BufferPolicy controls the desired behavior of the buffer policy.

+

+ + + + + + + + - -
FieldDescription
-scheduling
+maxReplicas
-agones.dev/agones/pkg/apis.SchedulingStrategy +int32
-

Scheduling strategy. Defaults to “Packed”.

+

MaxReplicas is the maximum amount of replicas that the fleet may have. +It must be bigger than both MinReplicas and BufferSize

-metadata
+minReplicas
- -MetaPatch - +int32
-

MetaPatch is optional custom metadata that is added to the game server at allocation -You can use this to tell the server necessary session data

-
+

MinReplicas is the minimum amount of replicas that the fleet must have +If zero, it is ignored. +If non zero, it must be smaller than MaxReplicas and bigger than BufferSize

-status
+bufferSize
- -GameServerAllocationStatus - +k8s.io/apimachinery/pkg/util/intstr.IntOrString +

BufferSize defines how many replicas the autoscaler tries to have ready all the time +Value can be an absolute number (ex: 5) or a percentage of desired gs instances (ex: 15%) +Absolute number is calculated from percentage by rounding up. +Example: when this is set to 20%, the autoscaler will make sure that 20% +of the fleet’s game server replicas are ready. When this is set to 20, +the autoscaler will make sure that there are 20 available game servers +Must be bigger than 0 +Note: by “ready” we understand in this case “non-allocated”; this is done to ensure robustness +and computation stability in different edge case (fleet just created, not enough +capacity in the cluster etc)

-

GameServerAllocationSpec +

FixedIntervalSync

(Appears on: -GameServerAllocation) +FleetAutoscalerSync)

-

GameServerAllocationSpec is the spec for a GameServerAllocation

+

FixedIntervalSync controls the desired behavior of the fixed interval based sync.

@@ -3231,111 +3245,93 @@

GameServerAllocationS

+ +
-multiClusterSetting
+seconds
- -MultiClusterSetting - +int32
-

MultiClusterPolicySelector if specified, multi-cluster policies are applied. -Otherwise, allocation will happen locally.

+

Seconds defines how often we run fleet autoscaling in seconds

+

FleetAutoscaleRequest +

+

+(Appears on: +FleetAutoscaleReview) +

+

+

FleetAutoscaleRequest defines the request to webhook autoscaler endpoint

+

+ + - - + + + +
-required
- - -GameServerSelector - - -
-

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. -Required is the GameServer selector from which to choose GameServers from. -Defaults to all GameServers.

-
FieldDescription
-preferred
+uid
- -[]GameServerSelector - +k8s.io/apimachinery/pkg/types.UID
-

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. -Preferred is an ordered list of preferred GameServer selectors -that are optional to be fulfilled, but will be searched before the required selector. -If the first selector is not matched, the selection attempts the second selector, and so on. -If any of the preferred selectors are matched, the required selector is not considered. -This is useful for things like smoke testing of new game servers.

+

UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are +otherwise identical (parallel requests, requests when earlier requests did not modify etc) +The UID is meant to track the round trip (request/response) between the Autoscaler and the WebHook, not the user request. +It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.

-selectors
+name
- -[]GameServerSelector - +string
-

Ordered list of GameServer label selectors. -If the first selector is not matched, the selection attempts the second selector, and so on. -This is useful for things like smoke testing of new game servers. -Note: This field can only be set if neither Required or Preferred is set.

+

Name is the name of the Fleet being scaled

-scheduling
+namespace
-agones.dev/agones/pkg/apis.SchedulingStrategy +string
-

Scheduling strategy. Defaults to “Packed”.

+

Namespace is the namespace associated with the request (if any).

-metadata
+status
- -MetaPatch + +FleetStatus
-

MetaPatch is optional custom metadata that is added to the game server at allocation -You can use this to tell the server necessary session data

+

The Fleet’s status values

-

GameServerAllocationState -(string alias)

-

-(Appears on: -GameServerAllocationStatus) -

-

-

GameServerAllocationState is the Allocation state

-

-

GameServerAllocationStatus +

FleetAutoscaleResponse

(Appears on: -GameServerAllocation) +FleetAutoscaleReview)

-

GameServerAllocationStatus is the status for an GameServerAllocation resource

+

FleetAutoscaleResponse defines the response of webhook autoscaler endpoint

@@ -3347,44 +3343,61 @@

GameServerAllocatio

+ +
-state
+uid
- -GameServerAllocationState - +k8s.io/apimachinery/pkg/types.UID
-

GameServerState is the current state of an GameServerAllocation, e.g. Allocated, or UnAllocated

+

UID is an identifier for the individual request/response. +This should be copied over from the corresponding FleetAutoscaleRequest.

-gameServerName
+scale
-string +bool
+

Set to false if no scaling should occur to the Fleet

-ports
+replicas
- -[]GameServerStatusPort - +int32
+

The targeted replica count

+

FleetAutoscaleReview +

+

+

FleetAutoscaleReview is passed to the webhook with a populated Request value, +and then returned with a populated Response.

+

+ + + + + + + +
FieldDescription
-address
+request
-string + +FleetAutoscaleRequest +
@@ -3392,9 +3405,11 @@

GameServerAllocatio

-nodeName
+response
-string + +FleetAutoscaleResponse +
@@ -3402,15 +3417,14 @@

GameServerAllocatio

-

GameServerSelector +

FleetAutoscalerPolicy

(Appears on: -GameServerAllocationSpec) +FleetAutoscalerSpec)

-

GameServerSelector contains all the filter options for selecting -a GameServer for allocation.

+

FleetAutoscalerPolicy describes how to scale a fleet

@@ -3422,62 +3436,65 @@

GameServerSelector

-LabelSelector
+type
- -Kubernetes meta/v1.LabelSelector + +FleetAutoscalerPolicyType
-

See: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/

+

Type of autoscaling policy.

-gameServerState
+buffer
- -GameServerState + +BufferPolicy
(Optional) -

[Stage:Beta] -[FeatureFlag:StateAllocationFilter] -GameServerState specifies which State is the filter to be used when attempting to retrieve a GameServer -via Allocation. Defaults to “Ready”. The only other option is “Allocated”, which can be used in conjunction with -label/annotation/player selectors to retrieve an already Allocated GameServer.

+

Buffer policy config params. Present only if FleetAutoscalerPolicyType = Buffer.

-players
+webhook
- -PlayerSelector + +WebhookPolicy
(Optional) -

[Stage:Alpha] -[FeatureFlag:PlayerAllocationFilter] -Players provides a filter on minimum and maximum values for player capacity when retrieving a GameServer -through Allocation. Defaults to no limits.

+

Webhook policy config params. Present only if FleetAutoscalerPolicyType = Webhook.

-

MetaPatch +

FleetAutoscalerPolicyType +(string alias)

+

+(Appears on: +FleetAutoscalerPolicy) +

+

+

FleetAutoscalerPolicyType is the policy for autoscaling +for a given Fleet

+

+

FleetAutoscalerSpec

(Appears on: -GameServerAllocationSpec) +FleetAutoscaler)

-

MetaPatch is the metadata used to patch the GameServer metadata on allocation

+

FleetAutoscalerSpec is the spec for a Fleet Scaler

@@ -3489,9 +3506,9 @@

MetaPatch

+ + + +
-labels
+fleetName
-map[string]string +string
@@ -3499,24 +3516,43 @@

MetaPatch

-annotations
+policy
-map[string]string + +FleetAutoscalerPolicy + + +
+

Autoscaling policy

+
+sync
+ + +FleetAutoscalerSync +
+(Optional) +

[Stage:Beta] +[FeatureFlag:CustomFasSyncInterval] +Sync defines when FleetAutoscalers runs autoscaling

-

MultiClusterSetting +

FleetAutoscalerStatus

(Appears on: -GameServerAllocationSpec) +FleetAutoscaler)

-

MultiClusterSetting specifies settings for multi-cluster allocation.

+

FleetAutoscalerStatus defines the current status of a FleetAutoscaler

@@ -3528,36 +3564,75 @@

MultiClusterSetting

- -
-enabled
+currentReplicas
-bool +int32
+

CurrentReplicas is the current number of gameserver replicas +of the fleet managed by this autoscaler, as last seen by the autoscaler

-policySelector
+desiredReplicas
- -Kubernetes meta/v1.LabelSelector - +int32
+

DesiredReplicas is the desired number of gameserver replicas +of the fleet managed by this autoscaler, as last calculated by the autoscaler

-

PlayerSelector -

-

-(Appears on: -GameServerSelector) -

-

-

PlayerSelector is the filter options for a GameServer based on player counts

+ + +lastScaleTime
+ + +Kubernetes meta/v1.Time + + + + +(Optional) +

lastScaleTime is the last time the FleetAutoscaler scaled the attached fleet,

+ + + + +ableToScale
+ +bool + + + +

AbleToScale indicates that we can access the target fleet

+ + + + +scalingLimited
+ +bool + + + +

ScalingLimited indicates that the calculated scale would be above or below the range +defined by MinReplicas and MaxReplicas, and has thus been capped.

+ + + + +

FleetAutoscalerSync +

+

+(Appears on: +FleetAutoscalerSpec) +

+

+

FleetAutoscalerSync describes when to sync a fleet

@@ -3569,39 +3644,136 @@

PlayerSelector

+ + + +
-minAvailable
+type
-int64 + +FleetAutoscalerSyncType +
+

Type of autoscaling sync.

-maxAvailable
+fixedInterval
-int64 + +FixedIntervalSync + + +
+(Optional) +

FixedInterval config params. Present only if FleetAutoscalerSyncType = FixedInterval.

+
+

FleetAutoscalerSyncType +(string alias)

+

+(Appears on: +FleetAutoscalerSync) +

+

+

FleetAutoscalerSyncType is the sync strategy for a given Fleet

+

+

WebhookPolicy +

+

+(Appears on: +FleetAutoscalerPolicy) +

+

+

WebhookPolicy controls the desired behavior of the webhook policy. +It contains the description of the webhook autoscaler service +used to form url which is accessible inside the cluster

+

+ + + + + + + + + + + + + + + + + +
FieldDescription
+url
+ +string + +
+(Optional) +

url gives the location of the webhook, in standard URL form +(scheme://host:port/path). Exactly one of url or service +must be specified.

+

The host should not refer to a service running in the cluster; use +the service field instead. The host might be resolved via external +DNS in some apiservers (e.g., kube-apiserver cannot resolve +in-cluster DNS as that would be a layering violation). host may +also be an IP address.

+

Please note that using localhost or 127.0.0.1 as a host is +risky unless you take great care to run this webhook on all hosts +which run an apiserver which might need to make calls to this +webhook. Such installs are likely to be non-portable, i.e., not easy +to turn up in a new cluster.

+

The scheme must be “https”; the URL must begin with “https://”.

+

A path is optional, and if present may be any string permissible in +a URL. You may use the path to pass an arbitrary string to the +webhook, for example, a cluster identifier.

+

Attempting to use a user or basic auth e.g. “user:password@” is not +allowed. Fragments (“#…”) and query parameters (“?…”) are not +allowed, either.

+
+service
+ + +Kubernetes admissionregistration/v1.ServiceReference + + +
+(Optional) +

service is a reference to the service for this webhook. Either +service or url must be specified.

+

If the webhook is running within the cluster, then you should use service.

+
+caBundle
+ +[]byte
+(Optional) +

caBundle is a PEM encoded CA bundle which will be used to validate the webhook’s server certificate. +If unspecified, system trust roots on the apiserver are used.


-

autoscaling.agones.dev/v1

+

multicluster.agones.dev/v1

Package v1 is the v1 version of the API.

Resource Types: -

FleetAutoscaler +

GameServerAllocationPolicy

-

FleetAutoscaler is the data structure for a FleetAutoscaler resource

+

GameServerAllocationPolicy is the Schema for the gameserverallocationpolicies API

@@ -3617,7 +3789,7 @@

FleetAutoscaler string

@@ -3626,7 +3798,7 @@

FleetAutoscaler kind
string -

+ @@ -3657,9 +3829,9 @@

FleetAutoscaler

-autoscaling.agones.dev/v1 +multicluster.agones.dev/v1
FleetAutoscalerGameServerAllocationPolicy
@@ -3646,8 +3818,8 @@

FleetAutoscaler

spec
- -FleetAutoscalerSpec + +GameServerAllocationPolicySpec
-fleetName
+priority
-string +int32
@@ -3667,58 +3839,39 @@

FleetAutoscaler

-policy
+weight
- -FleetAutoscalerPolicy - +int
-

Autoscaling policy

-sync
+connectionInfo
- -FleetAutoscalerSync + +ClusterConnectionInfo
-(Optional) -

[Stage:Beta] -[FeatureFlag:CustomFasSyncInterval] -Sync defines when FleetAutoscalers runs autoscaling

- - -status
- - -FleetAutoscalerStatus - - - - - - -

BufferPolicy +

ClusterConnectionInfo

(Appears on: -FleetAutoscalerPolicy) +GameServerAllocationPolicySpec)

-

BufferPolicy controls the desired behavior of the buffer policy.

+

ClusterConnectionInfo defines the connection information for a cluster

@@ -3730,89 +3883,67 @@

BufferPolicy

- -
-maxReplicas
+clusterName
-int32 +string
-

MaxReplicas is the maximum amount of replicas that the fleet may have. -It must be bigger than both MinReplicas and BufferSize

+

Optional: the name of the targeted cluster

-minReplicas
+allocationEndpoints
-int32 +[]string
-

MinReplicas is the minimum amount of replicas that the fleet must have -If zero, it is ignored. -If non zero, it must be smaller than MaxReplicas and bigger than BufferSize

+

The endpoints for the allocator service in the targeted cluster. +If the AllocationEndpoints is not set, the allocation happens on local cluster. +If there are multiple endpoints any of the endpoints that can handle allocation request should suffice

-bufferSize
+secretName
-k8s.io/apimachinery/pkg/util/intstr.IntOrString +string
-

BufferSize defines how many replicas the autoscaler tries to have ready all the time -Value can be an absolute number (ex: 5) or a percentage of desired gs instances (ex: 15%) -Absolute number is calculated from percentage by rounding up. -Example: when this is set to 20%, the autoscaler will make sure that 20% -of the fleet’s game server replicas are ready. When this is set to 20, -the autoscaler will make sure that there are 20 available game servers -Must be bigger than 0 -Note: by “ready” we understand in this case “non-allocated”; this is done to ensure robustness -and computation stability in different edge case (fleet just created, not enough -capacity in the cluster etc)

+

The name of the secret that contains TLS client certificates to connect the allocator server in the targeted cluster

-

FixedIntervalSync -

-

-(Appears on: -FleetAutoscalerSync) -

-

-

FixedIntervalSync controls the desired behavior of the fixed interval based sync.

-

- - - - - - - + + +
FieldDescription
+namespace
+ +string + +
+

The cluster namespace from which to allocate gameservers

+
-seconds
+serverCa
-int32 +[]byte
-

Seconds defines how often we run fleet autoscaling in seconds

+

The PEM encoded server CA, used by the allocator client to authenticate the remote server.

-

FleetAutoscaleRequest +

ConnectionInfoIterator

-(Appears on: -FleetAutoscaleReview) -

-

-

FleetAutoscaleRequest defines the request to webhook autoscaler endpoint

+

ConnectionInfoIterator an iterator on ClusterConnectionInfo

@@ -3824,63 +3955,58 @@

FleetAutoscaleRequest

-uid
+currPriority
-k8s.io/apimachinery/pkg/types.UID +int
-

UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are -otherwise identical (parallel requests, requests when earlier requests did not modify etc) -The UID is meant to track the round trip (request/response) between the Autoscaler and the WebHook, not the user request. -It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.

+

currPriority Current priority index from the orderedPriorities

-name
+orderedPriorities
-string +[]int32
-

Name is the name of the Fleet being scaled

+

orderedPriorities list of ordered priorities

-namespace
+priorityToCluster
-string +map[int32]map[string][]*agones.dev/agones/pkg/apis/multicluster/v1.GameServerAllocationPolicy
-

Namespace is the namespace associated with the request (if any).

+

priorityToCluster Map of priority to cluster-policies map

-status
+clusterBlackList
- -FleetStatus - +map[string]bool
-

The Fleet’s status values

+

clusterBlackList the cluster blacklist for the clusters that has already returned

-

FleetAutoscaleResponse +

GameServerAllocationPolicySpec

(Appears on: -FleetAutoscaleReview) +GameServerAllocationPolicy)

-

FleetAutoscaleResponse defines the response of webhook autoscaler endpoint

+

GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy

@@ -3892,45 +4018,55 @@

FleetAutoscaleResponse

-uid
+priority
-k8s.io/apimachinery/pkg/types.UID +int32
-

UID is an identifier for the individual request/response. -This should be copied over from the corresponding FleetAutoscaleRequest.

-scale
+weight
-bool +int
-

Set to false if no scaling should occur to the Fleet

-replicas
+connectionInfo
-int32 + +ClusterConnectionInfo +
-

The targeted replica count

-

FleetAutoscaleReview +
+

agones.dev/v1

+

+

Package v1 is the v1 version of the API.

+

+Resource Types: + +

Fleet

-

FleetAutoscaleReview is passed to the webhook with a populated Request value, -and then returned with a populated Response.

+

Fleet is the data structure for a Fleet resource

@@ -3942,166 +4078,121 @@

FleetAutoscaleReview

+ + + + - -
-request
- - -FleetAutoscaleRequest - - +apiVersion
+string
+ +agones.dev/v1 +
+kind
+string
Fleet
-response
+metadata
- -FleetAutoscaleResponse + +Kubernetes meta/v1.ObjectMeta
+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-

FleetAutoscalerPolicy -

-

-(Appears on: -FleetAutoscalerSpec) -

-

-

FleetAutoscalerPolicy describes how to scale a fleet

-

- - - - - - - - - +
+
+
FieldDescription
-type
+spec
- -FleetAutoscalerPolicyType + +FleetSpec
-

Type of autoscaling policy.

-
- -
-buffer
+replicas
- -BufferPolicy - +int32
-(Optional) -

Buffer policy config params. Present only if FleetAutoscalerPolicyType = Buffer.

+

Replicas are the number of GameServers that should be in this set. Defaults to 0.

-webhook
+strategy
- -WebhookPolicy + +Kubernetes apps/v1.DeploymentStrategy
-(Optional) -

Webhook policy config params. Present only if FleetAutoscalerPolicyType = Webhook.

+

Deployment strategy

-

FleetAutoscalerPolicyType -(string alias)

-

-(Appears on: -FleetAutoscalerPolicy) -

-

-

FleetAutoscalerPolicyType is the policy for autoscaling -for a given Fleet

-

-

FleetAutoscalerSpec -

-

-(Appears on: -FleetAutoscaler) -

-

-

FleetAutoscalerSpec is the spec for a Fleet Scaler

-

- - - - - - - - + +
FieldDescription
-fleetName
+scheduling
-string +agones.dev/agones/pkg/apis.SchedulingStrategy
+

Scheduling strategy. Defaults to “Packed”.

-policy
+template
- -FleetAutoscalerPolicy + +GameServerTemplateSpec
-

Autoscaling policy

+

Template the GameServer template to apply for this Fleet

+
-sync
+status
- -FleetAutoscalerSync + +FleetStatus -(Optional) -

[Stage:Beta] -[FeatureFlag:CustomFasSyncInterval] -Sync defines when FleetAutoscalers runs autoscaling

-

FleetAutoscalerStatus +

GameServer

-(Appears on: -FleetAutoscaler) -

-

-

FleetAutoscalerStatus defines the current status of a FleetAutoscaler

+

GameServer is the data structure for a GameServer resource. +It is worth noting that while there is a GameServerStatus Status entry for the GameServer, it is not +defined as a subresource - unlike Fleet and other Agones resources. +This is so that we can retain the ability to change multiple aspects of a GameServer in a single atomic operation, +which is particularly useful for operations such as allocation.

@@ -4113,216 +4204,160 @@

FleetAutoscalerStatus

+ + + + - +
+
+
-currentReplicas
- -int32 - +apiVersion
+string
+ +agones.dev/v1 +
-

CurrentReplicas is the current number of gameserver replicas -of the fleet managed by this autoscaler, as last seen by the autoscaler

+kind
+string
GameServer
-desiredReplicas
+metadata
-int32 + +Kubernetes meta/v1.ObjectMeta +
-

DesiredReplicas is the desired number of gameserver replicas -of the fleet managed by this autoscaler, as last calculated by the autoscaler

+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-lastScaleTime
+spec
- -Kubernetes meta/v1.Time + +GameServerSpec
-(Optional) -

lastScaleTime is the last time the FleetAutoscaler scaled the attached fleet,

-
- -
-ableToScale
+container
-bool +string
-

AbleToScale indicates that we can access the target fleet

+

Container specifies which Pod container is the game server. Only required if there is more than one +container defined

-scalingLimited
+ports
-bool + +[]GameServerPort +
-

ScalingLimited indicates that the calculated scale would be above or below the range -defined by MinReplicas and MaxReplicas, and has thus been capped.

+

Ports are the array of ports that can be exposed via the game server

-

FleetAutoscalerSync -

-

-(Appears on: -FleetAutoscalerSpec) -

-

-

FleetAutoscalerSync describes when to sync a fleet

-

- - - - - - - - - -
FieldDescription
-type
+health
- -FleetAutoscalerSyncType + +Health
-

Type of autoscaling sync.

+

Health configures health checking

-fixedInterval
+scheduling
- -FixedIntervalSync - +agones.dev/agones/pkg/apis.SchedulingStrategy
-(Optional) -

FixedInterval config params. Present only if FleetAutoscalerSyncType = FixedInterval.

+

Scheduling strategy. Defaults to “Packed”

-

FleetAutoscalerSyncType -(string alias)

-

-(Appears on: -FleetAutoscalerSync) -

-

-

FleetAutoscalerSyncType is the sync strategy for a given Fleet

-

-

WebhookPolicy -

-

-(Appears on: -FleetAutoscalerPolicy) -

-

-

WebhookPolicy controls the desired behavior of the webhook policy. -It contains the description of the webhook autoscaler service -used to form url which is accessible inside the cluster

-

- - - - - - - - -
FieldDescription
-url
+sdkServer
-string + +SdkServer +
-(Optional) -

url gives the location of the webhook, in standard URL form -(scheme://host:port/path). Exactly one of url or service -must be specified.

-

The host should not refer to a service running in the cluster; use -the service field instead. The host might be resolved via external -DNS in some apiservers (e.g., kube-apiserver cannot resolve -in-cluster DNS as that would be a layering violation). host may -also be an IP address.

-

Please note that using localhost or 127.0.0.1 as a host is -risky unless you take great care to run this webhook on all hosts -which run an apiserver which might need to make calls to this -webhook. Such installs are likely to be non-portable, i.e., not easy -to turn up in a new cluster.

-

The scheme must be “https”; the URL must begin with “https://”.

-

A path is optional, and if present may be any string permissible in -a URL. You may use the path to pass an arbitrary string to the -webhook, for example, a cluster identifier.

-

Attempting to use a user or basic auth e.g. “user:password@” is not -allowed. Fragments (“#…”) and query parameters (“?…”) are not -allowed, either.

+

SdkServer specifies parameters for the Agones SDK Server sidecar container

-service
+template
- -Kubernetes admissionregistration/v1.ServiceReference + +Kubernetes core/v1.PodTemplateSpec
-(Optional) -

service is a reference to the service for this webhook. Either -service or url must be specified.

-

If the webhook is running within the cluster, then you should use service.

+

Template describes the Pod that will be created for the GameServer

-caBundle
+players
-[]byte + +PlayersSpec +
(Optional) -

caBundle is a PEM encoded CA bundle which will be used to validate the webhook’s server certificate. -If unspecified, system trust roots on the apiserver are used.

+

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

-
-

multicluster.agones.dev/v1

-

-

Package v1 is the v1 version of the API.

-

-Resource Types: - -

GameServerAllocationPolicy + + + + +status
+ + +GameServerStatus + + + + + + + + +

GameServerSet

-

GameServerAllocationPolicy is the Schema for the gameserverallocationpolicies API

+

GameServerSet is the data structure for a set of GameServers. +This matches philosophically with the relationship between +Deployments and ReplicaSets

@@ -4338,7 +4373,7 @@

GameServerAllocat string

@@ -4347,7 +4382,7 @@

GameServerAllocat kind
string -

+ @@ -4378,49 +4413,65 @@

GameServerAllocat

-multicluster.agones.dev/v1 +agones.dev/v1
GameServerAllocationPolicyGameServerSet
@@ -4367,8 +4402,8 @@

GameServerAllocat

spec
- -GameServerAllocationPolicySpec + +GameServerSetSpec
-priority
+replicas
int32
+

Replicas are the number of GameServers that should be in this set

-weight
+scheduling
-int +agones.dev/agones/pkg/apis.SchedulingStrategy
+

Scheduling strategy. Defaults to “Packed”.

-connectionInfo
+template
- -ClusterConnectionInfo + +GameServerTemplateSpec
+

Template the GameServer template to apply for this GameServerSet

+ + +status
+ + +GameServerSetStatus + + + + + + -

ClusterConnectionInfo +

AggregatedPlayerStatus

(Appears on: -GameServerAllocationPolicySpec) +FleetStatus, +GameServerSetStatus)

-

ClusterConnectionInfo defines the connection information for a cluster

+

AggregatedPlayerStatus stores total player tracking values

@@ -4432,67 +4483,102 @@

ClusterConnectionInfo

+ + +
-clusterName
+count
-string +int64
-

Optional: the name of the targeted cluster

-allocationEndpoints
+capacity
-[]string +int64
-

The endpoints for the allocator service in the targeted cluster. -If the AllocationEndpoints is not set, the allocation happens on local cluster. -If there are multiple endpoints any of the endpoints that can handle allocation request should suffice

+
+

FleetSpec +

+

+(Appears on: +Fleet) +

+

+

FleetSpec is the spec for a Fleet

+

+ + + + + + + + + + +
FieldDescription
+replicas
+ +int32 + +
+

Replicas are the number of GameServers that should be in this set. Defaults to 0.

-secretName
+strategy
-string + +Kubernetes apps/v1.DeploymentStrategy +
-

The name of the secret that contains TLS client certificates to connect the allocator server in the targeted cluster

+

Deployment strategy

-namespace
+scheduling
-string +agones.dev/agones/pkg/apis.SchedulingStrategy
-

The cluster namespace from which to allocate gameservers

+

Scheduling strategy. Defaults to “Packed”.

-serverCa
+template
-[]byte + +GameServerTemplateSpec +
-

The PEM encoded server CA, used by the allocator client to authenticate the remote server.

+

Template the GameServer template to apply for this Fleet

-

ConnectionInfoIterator +

FleetStatus

-

ConnectionInfoIterator an iterator on ClusterConnectionInfo

+(Appears on: +Fleet, +FleetAutoscaleRequest) +

+

+

FleetStatus is the status of a Fleet

@@ -4504,58 +4590,76 @@

ConnectionInfoIterato

+ + + +
-currPriority
+replicas
-int +int32
-

currPriority Current priority index from the orderedPriorities

+

Replicas the total number of current GameServer replicas

-orderedPriorities
+readyReplicas
-[]int32 +int32
-

orderedPriorities list of ordered priorities

+

ReadyReplicas are the number of Ready GameServer replicas

-priorityToCluster
+reservedReplicas
-map[int32]map[string][]*agones.dev/agones/pkg/apis/multicluster/v1.GameServerAllocationPolicy +int32
-

priorityToCluster Map of priority to cluster-policies map

+

ReservedReplicas are the total number of Reserved GameServer replicas in this fleet. +Reserved instances won’t be deleted on scale down, but won’t cause an autoscaler to scale up.

-clusterBlackList
+allocatedReplicas
-map[string]bool +int32
-

clusterBlackList the cluster blacklist for the clusters that has already returned

+

AllocatedReplicas are the number of Allocated GameServer replicas

+
+players
+ + +AggregatedPlayerStatus + + +
+(Optional) +

[Stage:Alpha] +[FeatureFlag:PlayerTracking] +Players are the current total player capacity and count for this Fleet

-

GameServerAllocationPolicySpec +

GameServerPort

(Appears on: -GameServerAllocationPolicy) +GameServerSpec)

-

GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy

+

GameServerPort defines a set of Ports that +are to be exposed via the GameServer

@@ -4567,55 +4671,89 @@

GameServerAll

+ + + + + + + + + + + +
-priority
+name
+ +string + +
+

Name is the descriptive name of the port

+
+portPolicy
+ + +PortPolicy + + +
+

PortPolicy defines the policy for how the HostPort is populated. +Dynamic port will allocate a HostPort within the selected MIN_PORT and MAX_PORT range passed to the controller +at installation time. +When Static portPolicy is specified, HostPort is required, to specify the port that game clients will +connect to

+
+container
+ +string + +
+(Optional) +

Container is the name of the container on which to open the port. Defaults to the game server container.

+
+containerPort
int32
+

ContainerPort is the port that is being opened on the specified container’s process

-weight
+hostPort
-int +int32
+

HostPort the port exposed on the host for clients to connect to

-connectionInfo
+protocol
- -ClusterConnectionInfo + +Kubernetes core/v1.Protocol
+

Protocol is the network protocol being used. Defaults to UDP. TCP and TCPUDP are other options.

-
-

agones.dev/v1

+

GameServerSetSpec +

-

Package v1 is the v1 version of the API.

+(Appears on: +GameServerSet)

-Resource Types: - -

Fleet -

-

Fleet is the data structure for a Fleet resource

+

GameServerSetSpec the specification for GameServerSet

@@ -4627,48 +4765,58 @@

Fleet

- - - - + - + + +
-apiVersion
-string
- -agones.dev/v1 - -
-kind
-string +replicas
+ +int32 + +
+

Replicas are the number of GameServers that should be in this set

Fleet
-metadata
+scheduling
- -Kubernetes meta/v1.ObjectMeta - +agones.dev/agones/pkg/apis.SchedulingStrategy
-Refer to the Kubernetes API documentation for the fields of the -metadata field. +

Scheduling strategy. Defaults to “Packed”.

-spec
+template
- -FleetSpec + +GameServerTemplateSpec
-
-
+

Template the GameServer template to apply for this GameServerSet

+
+

GameServerSetStatus +

+

+(Appears on: +GameServerSet) +

+

+

GameServerSetStatus is the status of a GameServerSet

+

+ + + + + + + -
FieldDescription
replicas
@@ -4677,71 +4825,80 @@

Fleet

-

Replicas are the number of GameServers that should be in this set. Defaults to 0.

+

Replicas is the total number of current GameServer replicas

-strategy
+readyReplicas
- -Kubernetes apps/v1.DeploymentStrategy - +int32
-

Deployment strategy

+

ReadyReplicas is the number of Ready GameServer replicas

-scheduling
+reservedReplicas
-agones.dev/agones/pkg/apis.SchedulingStrategy +int32
-

Scheduling strategy. Defaults to “Packed”.

+

ReservedReplicas is the number of Reserved GameServer replicas

-template
+allocatedReplicas
- -GameServerTemplateSpec - +int32
-

Template the GameServer template to apply for this Fleet

+

AllocatedReplicas is the number of Allocated GameServer replicas

+ + +shutdownReplicas
+ +int32 + + + +

ShutdownReplicas is the number of Shutdown GameServers replicas

-status
+players
- -FleetStatus + +AggregatedPlayerStatus +(Optional) +

[Stage:Alpha] +[FeatureFlag:PlayerTracking] +Players is the current total player capacity and count for this GameServerSet

-

GameServer +

GameServerSpec

-

GameServer is the data structure for a GameServer resource. -It is worth noting that while there is a GameServerStatus Status entry for the GameServer, it is not -defined as a subresource - unlike Fleet and other Agones resources. -This is so that we can retain the ability to change multiple aspects of a GameServer in a single atomic operation, -which is particularly useful for operations such as allocation.

+(Appears on: +GameServer, +GameServerTemplateSpec) +

+

+

GameServerSpec is the spec for a GameServer resource

@@ -4753,50 +4910,6 @@

GameServer

- - - - - - - - - - - - - - - - - -
-apiVersion
-string
- -agones.dev/v1 - -
-kind
-string -
GameServer
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -GameServerSpec - - -
-
-
- - - -
container
string @@ -4884,29 +4997,26 @@

GameServer

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

-
-status
- - -GameServerStatus - - -
-
-

GameServerSet +

GameServerState +(string alias)

+

+(Appears on: +GameServerSelector, +GameServerStatus) +

+

+

GameServerState is the state for the GameServer

+

+

GameServerStatus

-

GameServerSet is the data structure for a set of GameServers. -This matches philosophically with the relationship between -Deployments and ReplicaSets

+(Appears on: +GameServer) +

+

+

GameServerStatus is the status for a GameServer resource

@@ -4918,109 +5028,88 @@

GameServerSet

- - - - - - - -
-apiVersion
-string
- -agones.dev/v1 - -
-kind
-string -
GameServerSet
-metadata
+state
- -Kubernetes meta/v1.ObjectMeta + +GameServerState
-Refer to the Kubernetes API documentation for the fields of the -metadata field. +

GameServerState is the current state of a GameServer, e.g. Creating, Starting, Ready, etc

-spec
+ports
- -GameServerSetSpec + +[]GameServerStatusPort
-
-
- + + - -
-replicas
+address
-int32 +string
-

Replicas are the number of GameServers that should be in this set

-scheduling
+nodeName
-agones.dev/agones/pkg/apis.SchedulingStrategy +string
-

Scheduling strategy. Defaults to “Packed”.

-template
+reservedUntil
- -GameServerTemplateSpec + +Kubernetes meta/v1.Time
-

Template the GameServer template to apply for this GameServerSet

-
-status
+players
- -GameServerSetStatus + +PlayerStatus
+(Optional) +

[Stage:Alpha] +[FeatureFlag:PlayerTracking]

-

AggregatedPlayerStatus +

GameServerStatusPort

(Appears on: -FleetStatus, -GameServerSetStatus) +GameServerAllocationStatus, +GameServerStatus)

-

AggregatedPlayerStatus stores total player tracking values

+

GameServerStatusPort shows the port that was allocated to a +GameServer.

@@ -5032,9 +5121,9 @@

AggregatedPlayerStatus

-count
+name
-int64 +string
@@ -5042,9 +5131,9 @@

AggregatedPlayerStatus

-capacity
+port
-int64 +int32
@@ -5052,14 +5141,15 @@

AggregatedPlayerStatus

-

FleetSpec +

GameServerTemplateSpec

(Appears on: -Fleet) +FleetSpec, +GameServerSetSpec)

-

FleetSpec is the spec for a Fleet

+

GameServerTemplateSpec is a template for GameServers

@@ -5071,144 +5161,133 @@

FleetSpec

- +
+
+
-replicas
+metadata
-int32 + +Kubernetes meta/v1.ObjectMeta +
-

Replicas are the number of GameServers that should be in this set. Defaults to 0.

+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-strategy
+spec
- -Kubernetes apps/v1.DeploymentStrategy + +GameServerSpec
-

Deployment strategy

-
- -
-scheduling
+container
-agones.dev/agones/pkg/apis.SchedulingStrategy +string
-

Scheduling strategy. Defaults to “Packed”.

+

Container specifies which Pod container is the game server. Only required if there is more than one +container defined

-template
+ports
- -GameServerTemplateSpec + +[]GameServerPort
-

Template the GameServer template to apply for this Fleet

+

Ports are the array of ports that can be exposed via the game server

-

FleetStatus -

-

-(Appears on: -Fleet, -FleetAutoscaleRequest) -

-

-

FleetStatus is the status of a Fleet

-

- - - - - - - - + +
FieldDescription
-replicas
+health
-int32 + +Health +
-

Replicas the total number of current GameServer replicas

+

Health configures health checking

-readyReplicas
+scheduling
-int32 +agones.dev/agones/pkg/apis.SchedulingStrategy
-

ReadyReplicas are the number of Ready GameServer replicas

+

Scheduling strategy. Defaults to “Packed”

-reservedReplicas
+sdkServer
-int32 + +SdkServer +
-

ReservedReplicas are the total number of Reserved GameServer replicas in this fleet. -Reserved instances won’t be deleted on scale down, but won’t cause an autoscaler to scale up.

+

SdkServer specifies parameters for the Agones SDK Server sidecar container

-allocatedReplicas
+template
-int32 + +Kubernetes core/v1.PodTemplateSpec +
-

AllocatedReplicas are the number of Allocated GameServer replicas

+

Template describes the Pod that will be created for the GameServer

players
- -AggregatedPlayerStatus + +PlayersSpec
(Optional) -

[Stage:Alpha] -[FeatureFlag:PlayerTracking] -Players are the current total player capacity and count for this Fleet

+

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

+
-

GameServerPort +

Health

(Appears on: GameServerSpec)

-

GameServerPort defines a set of Ports that -are to be exposed via the GameServer

+

Health configures health checking on the GameServer

@@ -5220,89 +5299,58 @@

GameServerPort

- - - - - - - -
-name
- -string - -
-

Name is the descriptive name of the port

-
-portPolicy
- - -PortPolicy - - -
-

PortPolicy defines the policy for how the HostPort is populated. -Dynamic port will allocate a HostPort within the selected MIN_PORT and MAX_PORT range passed to the controller -at installation time. -When Static portPolicy is specified, HostPort is required, to specify the port that game clients will -connect to

-
-container
+disabled
-string +bool
-(Optional) -

Container is the name of the container on which to open the port. Defaults to the game server container.

+

Disabled is whether health checking is disabled or not

-containerPort
+periodSeconds
int32
-

ContainerPort is the port that is being opened on the specified container’s process

+

PeriodSeconds is the number of seconds each health ping has to occur in

-hostPort
+failureThreshold
int32
-

HostPort the port exposed on the host for clients to connect to

+

FailureThreshold how many failures in a row constitutes unhealthy

-protocol
+initialDelaySeconds
- -Kubernetes core/v1.Protocol - +int32
-

Protocol is the network protocol being used. Defaults to UDP. TCP and TCPUDP are other options.

+

InitialDelaySeconds initial delay before checking health

-

GameServerSetSpec +

PlayerStatus

(Appears on: -GameServerSet) +GameServerStatus)

-

GameServerSetSpec the specification for GameServerSet

+

PlayerStatus stores the current player capacity values

@@ -5314,49 +5362,44 @@

GameServerSetSpec

-replicas
+count
-int32 +int64
-

Replicas are the number of GameServers that should be in this set

-scheduling
+capacity
-agones.dev/agones/pkg/apis.SchedulingStrategy +int64
-

Scheduling strategy. Defaults to “Packed”.

-template
+ids
- -GameServerTemplateSpec - +[]string
-

Template the GameServer template to apply for this GameServerSet

-

GameServerSetStatus +

PlayersSpec

(Appears on: -GameServerSet) +GameServerSpec)

-

GameServerSetStatus is the status of a GameServerSet

+

PlayersSpec tracks the initial player capacity

@@ -5368,86 +5411,102 @@

GameServerSetStatus

- - - - + +
-replicas
- -int32 - -
-

Replicas is the total number of current GameServer replicas

-
-readyReplicas
+initialCapacity
-int32 +int64
-

ReadyReplicas is the number of Ready GameServer replicas

+

PortPolicy +(string alias)

+

+(Appears on: +GameServerPort) +

+

+

PortPolicy is the port policy for the GameServer

+

+

SdkServer +

+

+(Appears on: +GameServerSpec) +

+

+

SdkServer specifies parameters for the Agones SDK Server sidecar container

+

+ + - - + + + +
-reservedReplicas
- -int32 - -
-

ReservedReplicas is the number of Reserved GameServer replicas

-
FieldDescription
-allocatedReplicas
+logLevel
-int32 + +SdkServerLogLevel +
-

AllocatedReplicas is the number of Allocated GameServer replicas

+

LogLevel for SDK server (sidecar) logs. Defaults to “Info”

-shutdownReplicas
+grpcPort
int32
-

ShutdownReplicas is the number of Shutdown GameServers replicas

+

GRPCPort is the port on which the SDK Server binds the gRPC server to accept incoming connections

-players
+httpPort
- -AggregatedPlayerStatus - +int32
-(Optional) -

[Stage:Alpha] -[FeatureFlag:PlayerTracking] -Players is the current total player capacity and count for this GameServerSet

+

HTTPPort is the port on which the SDK Server binds the HTTP gRPC gateway server to accept incoming connections

-

GameServerSpec -

+

SdkServerLogLevel +(string alias)

(Appears on: -GameServer, -GameServerTemplateSpec) +SdkServer)

-

GameServerSpec is the spec for a GameServer resource

+

SdkServerLogLevel is the log level for SDK server (sidecar) logs

+

+
+

allocation.agones.dev/v1

+

+

Package v1 is the v1 version of the API.

+

+Resource Types: + +

GameServerAllocation +

+

+

GameServerAllocation is the data structure for allocating against a set of +GameServers, defined selectors selectors

@@ -5459,113 +5518,161 @@

GameServerSpec

+ + + + + + + +
-container
- +apiVersion
+string
+ +allocation.agones.dev/v1 + +
+kind
string +
GameServerAllocation
+metadata
+ + +Kubernetes meta/v1.ObjectMeta +
-

Container specifies which Pod container is the game server. Only required if there is more than one -container defined

+Refer to the Kubernetes API documentation for the fields of the +metadata field.
-ports
+spec
- -[]GameServerPort + +GameServerAllocationSpec
-

Ports are the array of ports that can be exposed via the game server

+
+
+ + + + + + + + + +
+multiClusterSetting
+ + +MultiClusterSetting + + +
+

MultiClusterPolicySelector if specified, multi-cluster policies are applied. +Otherwise, allocation will happen locally.

-health
+required
- -Health + +GameServerSelector
-

Health configures health checking

+

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. +Required is the GameServer selector from which to choose GameServers from. +Defaults to all GameServers.

-scheduling
+preferred
-agones.dev/agones/pkg/apis.SchedulingStrategy + +[]GameServerSelector +
-

Scheduling strategy. Defaults to “Packed”

+

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. +Preferred is an ordered list of preferred GameServer selectors +that are optional to be fulfilled, but will be searched before the required selector. +If the first selector is not matched, the selection attempts the second selector, and so on. +If any of the preferred selectors are matched, the required selector is not considered. +This is useful for things like smoke testing of new game servers.

-sdkServer
+selectors
- -SdkServer + +[]GameServerSelector
-

SdkServer specifies parameters for the Agones SDK Server sidecar container

+

Ordered list of GameServer label selectors. +If the first selector is not matched, the selection attempts the second selector, and so on. +This is useful for things like smoke testing of new game servers. +Note: This field can only be set if neither Required or Preferred is set.

-template
+scheduling
- -Kubernetes core/v1.PodTemplateSpec +agones.dev/agones/pkg/apis.SchedulingStrategy + +
+

Scheduling strategy. Defaults to “Packed”.

+
+metadata
+ + +MetaPatch
-

Template describes the Pod that will be created for the GameServer

+

MetaPatch is optional custom metadata that is added to the game server at allocation +You can use this to tell the server necessary session data

+
-players
+status
- -PlayersSpec + +GameServerAllocationStatus
-(Optional) -

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

-

GameServerState -(string alias)

-

-(Appears on: -GameServerSelector, -GameServerStatus) -

-

-

GameServerState is the state for the GameServer

-

-

GameServerStatus +

GameServerAllocationSpec

(Appears on: -GameServer) +GameServerAllocation)

-

GameServerStatus is the status for a GameServer resource

+

GameServerAllocationSpec is the spec for a GameServerAllocation

@@ -5577,128 +5684,111 @@

GameServerStatus

- - - - - - - - - - -
-state
+multiClusterSetting
- -GameServerState + +MultiClusterSetting
-

GameServerState is the current state of a GameServer, e.g. Creating, Starting, Ready, etc

+

MultiClusterPolicySelector if specified, multi-cluster policies are applied. +Otherwise, allocation will happen locally.

-ports
+required
- -[]GameServerStatusPort + +GameServerSelector
+

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. +Required is the GameServer selector from which to choose GameServers from. +Defaults to all GameServers.

-address
- -string - -
-
-nodeName
- -string - -
-
-reservedUntil
+preferred
- -Kubernetes meta/v1.Time + +[]GameServerSelector
+

Deprecated: use field Selectors instead. If Selectors is set, this field is ignored. +Preferred is an ordered list of preferred GameServer selectors +that are optional to be fulfilled, but will be searched before the required selector. +If the first selector is not matched, the selection attempts the second selector, and so on. +If any of the preferred selectors are matched, the required selector is not considered. +This is useful for things like smoke testing of new game servers.

-players
+selectors
- -PlayerStatus + +[]GameServerSelector
-(Optional) -

[Stage:Alpha] -[FeatureFlag:PlayerTracking]

-
-

GameServerStatusPort -

-

-(Appears on: -GameServerAllocationStatus, -GameServerStatus) -

-

-

GameServerStatusPort shows the port that was allocated to a -GameServer.

-

- - - - - +

Ordered list of GameServer label selectors. +If the first selector is not matched, the selection attempts the second selector, and so on. +This is useful for things like smoke testing of new game servers. +Note: This field can only be set if neither Required or Preferred is set.

+ - -
FieldDescription
-name
+scheduling
-string +agones.dev/agones/pkg/apis.SchedulingStrategy
+

Scheduling strategy. Defaults to “Packed”.

-port
+metadata
-int32 + +MetaPatch +
+

MetaPatch is optional custom metadata that is added to the game server at allocation +You can use this to tell the server necessary session data

-

GameServerTemplateSpec +

GameServerAllocationState +(string alias)

+

+(Appears on: +GameServerAllocationStatus) +

+

+

GameServerAllocationState is the Allocation state

+

+

GameServerAllocationStatus

(Appears on: -FleetSpec, -GameServerSetSpec) +GameServerAllocation)

-

GameServerTemplateSpec is a template for GameServers

+

GameServerAllocationStatus is the status for an GameServerAllocation resource

@@ -5710,133 +5800,82 @@

GameServerTemplateSpec

-
-metadata
+state
- -Kubernetes meta/v1.ObjectMeta + +GameServerAllocationState
-Refer to the Kubernetes API documentation for the fields of the -metadata field. +

GameServerState is the current state of an GameServerAllocation, e.g. Allocated, or UnAllocated

-spec
- - -GameServerSpec - - -
-
-
- - - - - - - - - - - - -
-container
+gameServerName
string
-

Container specifies which Pod container is the game server. Only required if there is more than one -container defined

ports
- -[]GameServerPort - - -
-

Ports are the array of ports that can be exposed via the game server

-
-health
- - -Health + +[]GameServerStatusPort
-

Health configures health checking

-
-scheduling
- -agones.dev/agones/pkg/apis.SchedulingStrategy - -
-

Scheduling strategy. Defaults to “Packed”

-sdkServer
+address
- -SdkServer - +string
-

SdkServer specifies parameters for the Agones SDK Server sidecar container

-template
+nodeName
- -Kubernetes core/v1.PodTemplateSpec - +string
-

Template describes the Pod that will be created for the GameServer

-players
+source
- -PlayersSpec - +string
-(Optional) -

(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.

-
+

If the allocation is from a remote cluster, Source is the endpoint of the remote agones-allocator. +Otherwise, Source is “local”

-

Health +

GameServerSelector

(Appears on: -GameServerSpec) +GameServerAllocationSpec)

-

Health configures health checking on the GameServer

+

GameServerSelector contains all the filter options for selecting +a GameServer for allocation.

@@ -5848,58 +5887,62 @@

Health

- - - -
-disabled
- -bool - -
-

Disabled is whether health checking is disabled or not

-
-periodSeconds
+LabelSelector
-int32 + +Kubernetes meta/v1.LabelSelector +
-

PeriodSeconds is the number of seconds each health ping has to occur in

+

See: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/

-failureThreshold
+gameServerState
-int32 + +GameServerState +
-

FailureThreshold how many failures in a row constitutes unhealthy

+(Optional) +

[Stage:Beta] +[FeatureFlag:StateAllocationFilter] +GameServerState specifies which State is the filter to be used when attempting to retrieve a GameServer +via Allocation. Defaults to “Ready”. The only other option is “Allocated”, which can be used in conjunction with +label/annotation/player selectors to retrieve an already Allocated GameServer.

-initialDelaySeconds
+players
-int32 + +PlayerSelector +
-

InitialDelaySeconds initial delay before checking health

+(Optional) +

[Stage:Alpha] +[FeatureFlag:PlayerAllocationFilter] +Players provides a filter on minimum and maximum values for player capacity when retrieving a GameServer +through Allocation. Defaults to no limits.

-

PlayerStatus +

MetaPatch

(Appears on: -GameServerStatus) +GameServerAllocationSpec)

-

PlayerStatus stores the current player capacity values

+

MetaPatch is the metadata used to patch the GameServer metadata on allocation

@@ -5911,19 +5954,9 @@

PlayerStatus

- - - -
-count
- -int64 - -
-
-capacity
+labels
-int64 +map[string]string
@@ -5931,9 +5964,9 @@

PlayerStatus

-ids
+annotations
-[]string +map[string]string
@@ -5941,14 +5974,14 @@

PlayerStatus

-

PlayersSpec +

MultiClusterSetting

(Appears on: -GameServerSpec) +GameServerAllocationSpec)

-

PlayersSpec tracks the initial player capacity

+

MultiClusterSetting specifies settings for multi-cluster allocation.

@@ -5960,9 +5993,21 @@

PlayersSpec

+ + + +
-initialCapacity
+enabled
-int64 +bool + +
+
+policySelector
+ + +Kubernetes meta/v1.LabelSelector +
@@ -5970,23 +6015,14 @@

PlayersSpec

-

PortPolicy -(string alias)

-

-(Appears on: -GameServerPort) -

-

-

PortPolicy is the port policy for the GameServer

-

-

SdkServer +

PlayerSelector

(Appears on: -GameServerSpec) +GameServerSelector)

-

SdkServer specifies parameters for the Agones SDK Server sidecar container

+

PlayerSelector is the filter options for a GameServer based on player counts

@@ -5998,52 +6034,29 @@

SdkServer

- - - -
-logLevel
- - -SdkServerLogLevel - - -
-

LogLevel for SDK server (sidecar) logs. Defaults to “Info”

-
-grpcPort
+minAvailable
-int32 +int64
-

GRPCPort is the port on which the SDK Server binds the gRPC server to accept incoming connections

-httpPort
+maxAvailable
-int32 +int64
-

HTTPPort is the port on which the SDK Server binds the HTTP gRPC gateway server to accept incoming connections

-

SdkServerLogLevel -(string alias)

-

-(Appears on: -SdkServer) -

-

-

SdkServerLogLevel is the log level for SDK server (sidecar) logs

-


Generated with gen-crd-api-reference-docs.

{{% /feature %}} +