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:
Package v1 is the v1 version of the API.
Resource Types: --
FleetAutoscaler is the data structure for a FleetAutoscaler resource
+GameServerAllocation is the data structure for allocating against a set of
+GameServers, defined selectors
selectors
-autoscaling.agones.dev/v1
+allocation.agones.dev/v1
|
@@ -55,13 +56,13 @@ FleetAutoscaler |
+GameServerAllocation |
|||||
metadata
-
+
Kubernetes meta/v1.ObjectMeta
@@ -75,8 +76,8 @@ FleetAutoscaler
spec
-
-FleetAutoscalerSpec
+
+GameServerAllocationSpec
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 |
|||||||
-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. |
-(Appears on: -FleetAutoscalerPolicy) -
--
BufferPolicy controls the desired behavior of the buffer policy.
- -Field | -Description | -
---|---|
-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)
(Appears on: -FleetAutoscalerSync) +GameServerAllocation)
-
FixedIntervalSync controls the desired behavior of the fixed interval based sync.
+GameServerAllocationSpec is the spec for a GameServerAllocation
-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. |
-(Appears on: -FleetAutoscaleReview) -
--
FleetAutoscaleRequest defines the request to webhook autoscaler endpoint
- -Field | -Description | +
+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 |
||
-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 |
string
alias)+(Appears on: +GameServerAllocationStatus) +
++
GameServerAllocationState is the Allocation state
+ +(Appears on: -FleetAutoscaleReview) +GameServerAllocation)
-
FleetAutoscaleResponse defines the response of webhook autoscaler endpoint
+GameServerAllocationStatus is the status for an GameServerAllocation resource
-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 is passed to the webhook with a populated Request value, -and then returned with a populated Response.
- -Field | -Description | -
---|---|
-request
+address
-
-FleetAutoscaleRequest
-
+string
|
@@ -383,11 +370,9 @@ FleetAutoscaleReview |
-response
+nodeName
-
-FleetAutoscaleResponse
-
+string
|
@@ -395,14 +380,15 @@ FleetAutoscaleReview |
(Appears on: -FleetAutoscalerSpec) +GameServerAllocationSpec)
-
FleetAutoscalerPolicy describes how to scale a fleet
+GameServerSelector contains all the filter options for selecting +a GameServer for allocation.
-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. |
string
alias)-(Appears on: -FleetAutoscalerPolicy) -
--
FleetAutoscalerPolicyType is the policy for autoscaling -for a given Fleet
- -(Appears on: -FleetAutoscaler) +GameServerAllocationSpec)
-
FleetAutoscalerSpec is the spec for a Fleet Scaler
+MetaPatch is the metadata used to patch the GameServer metadata on allocation
-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 |
(Appears on: -FleetAutoscaler) +GameServerAllocationSpec)
-
FleetAutoscalerStatus defines the current status of a FleetAutoscaler
+MultiClusterSetting specifies settings for multi-cluster allocation.
-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. |
(Appears on: -FleetAutoscalerSpec) +GameServerSelector)
-
FleetAutoscalerSync describes when to sync a fleet
+PlayerSelector is the filter options for a GameServer based on player counts
-type
+minAvailable
-
-FleetAutoscalerSyncType
-
+int64
|
- Type of autoscaling sync. |
-fixedInterval
+maxAvailable
-
-FixedIntervalSync
-
+int64
|
-(Optional)
- FixedInterval config params. Present only if FleetAutoscalerSyncType = FixedInterval. |
string
alias)-(Appears on: -FleetAutoscalerSync) -
+-
FleetAutoscalerSyncType is the sync strategy for a given Fleet
+Package v1 is the v1 version of the API.
--(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
-url
-
-string
-
+apiVersion
+string |
+
+
+autoscaling.agones.dev/v1
+
|
+
-(Optional)
-
The Please note that using 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)
-
If the webhook is running within the cluster, then you should use metadata field.
|
-caBundle
+spec
-[]byte
+
+FleetAutoscalerSpec
+
|
-(Optional)
-
|
-
-
Package v1 is the v1 version of the API.
- -Resource Types: - --
GameServerAllocationPolicy is the Schema for the gameserverallocationpolicies API
- +Field | -Description | -||||
---|---|---|---|---|---|
-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
|
- - -
|
||||
-connectionInfo
+status
-
-ClusterConnectionInfo
+
+FleetAutoscalerStatus
|
(Appears on: -GameServerAllocationPolicySpec) +FleetAutoscalerPolicy)
-
ClusterConnectionInfo defines the connection information for a cluster
+BufferPolicy controls the desired behavior of the buffer policy.
-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) |
+(Appears on: +FleetAutoscalerSync) +
++
FixedIntervalSync controls the desired behavior of the fixed interval based sync.
+ +
-namespace
-
-string
-
- |
-
- The cluster namespace from which to allocate gameservers - |
+Field | +Description |
---|---|---|---|
-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 an iterator on ClusterConnectionInfo
+(Appears on: +FleetAutoscaleReview) + ++
FleetAutoscaleRequest defines the request to webhook autoscaler endpoint
-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 |
(Appears on: -GameServerAllocationPolicy) +FleetAutoscaleReview)
-
GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy
+FleetAutoscaleResponse defines the response of webhook autoscaler endpoint
-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 |
-
Package v1 is the v1 version of the API.
- -Resource Types: --
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.
-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
-
-
- |
-
- - + |
+(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. - |
+Field | +Description |
---|---|---|---|
-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 - |
-
Buffer policy config params. Present only if FleetAutoscalerPolicyType = Buffer.
status
+webhook
-
-FleetStatus
+
+WebhookPolicy
Webhook policy config params. Present only if FleetAutoscalerPolicyType = Webhook.
string
alias)+(Appears on: +FleetAutoscalerPolicy) +
++
FleetAutoscalerPolicyType is the policy for autoscaling +for a given Fleet
+ +-
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.
+
FleetAutoscalerSpec is the spec for a Fleet Scaler
-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 + |
+
+(Appears on: +FleetAutoscaler) +
++
FleetAutoscalerStatus defines the current status of a FleetAutoscaler
+Field | +Description | +
---|---|
-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. |
+(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 - |
+Field | +Description |
---|---|---|---|
-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
FixedInterval config params. Present only if FleetAutoscalerSyncType = FixedInterval.
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
+ ++(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
+ +Field | +Description | +
---|---|
+url
+
+string
+
+ |
+
+(Optional)
+
The Please note that using 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)
+
If the webhook is running within the cluster, then you should use |
+
+caBundle
+
+[]byte
+
+ |
+
+(Optional)
+
|
+
+
Package v1 is the v1 version of the API.
+ +Resource Types: + ++
GameServerAllocationPolicy is the Schema for the gameserverallocationpolicies API
-agones.dev/v1
+multicluster.agones.dev/v1
|
@@ -1360,13 +1325,13 @@ GameServerSet |
+GameServerAllocationPolicy |
|||||
metadata
-
+
Kubernetes meta/v1.ObjectMeta
@@ -1380,8 +1345,8 @@ GameServerSet
spec
-
-GameServerSetSpec
+
+GameServerAllocationPolicySpec
|
|||||||
-status
-
-
-GameServerSetStatus
-
-
- |
-- | -
(Appears on: -FleetStatus, -GameServerSetStatus) +GameServerAllocationPolicySpec)
-
AggregatedPlayerStatus stores total player tracking values
+ClusterConnectionInfo defines the connection information for a cluster
-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. |
-(Appears on: -Fleet) -
--
FleetSpec is the spec for a Fleet
+ConnectionInfoIterator an iterator on ClusterConnectionInfo
-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 |
(Appears on: -Fleet, -FleetAutoscaleRequest) +GameServerAllocationPolicy)
-
FleetStatus is the status of a Fleet
+GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy
-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 |
-(Appears on: -GameServerSpec) +
Package v1 is the v1 version of the API.
+Resource Types: +-
GameServerPort defines a set of Ports that -are to be exposed via the GameServer
+Fleet is the data structure for a Fleet resource
-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 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 |
-(Appears on: -GameServerSet) -
--
GameServerSetSpec the specification for GameServerSet
- -Field | -Description | -
---|---|
-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
-(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.
-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 - |
-
-(Appears on: -GameServer, -GameServerTemplateSpec) -
--
GameServerSpec is the spec for a GameServer resource
- +Field | -Description | -
---|---|
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
+
+
+string
alias)-(Appears on: -GameServerSelector, -GameServerStatus) -
--
GameServerState is the state for the GameServer
- --(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
-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
[Stage:Alpha] -[FeatureFlag:PlayerTracking]
(Appears on: -GameServerAllocationStatus, -GameServerStatus) +FleetStatus, +GameServerSetStatus)
-
GameServerStatusPort shows the port that was allocated to a -GameServer.
+AggregatedPlayerStatus stores total player tracking values
-name
+count
-string
+int64
|
@@ -2109,9 +2020,9 @@ GameServerStatusPort |
-port
+capacity
-int32
+int64
|
@@ -2119,15 +2030,14 @@ GameServerStatusPort |
(Appears on: -FleetSpec, -GameServerSetSpec) +Fleet)
-
GameServerTemplateSpec is a template for GameServers
+FleetSpec is the spec for a Fleet
-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
|
- - -
FleetStatus +++(Appears on: +Fleet, +FleetAutoscaleRequest) + ++ FleetStatus is the status of a Fleet + +
[Stage:Alpha] +[FeatureFlag:PlayerTracking] +Players are the current total player capacity and count for this Fleet |
(Appears on: GameServerSpec)
-
Health configures health checking on the GameServer
+GameServerPort defines a set of Ports that +are to be exposed via the GameServer
-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 |
-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 |
-(Appears on: -GameServerStatus) -
--
PlayerStatus stores the current player capacity values
- -Field | -Description | -
---|---|
-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. |
(Appears on: -GameServerSpec) +GameServerSet)
-
PlayersSpec tracks the initial player capacity
+GameServerSetSpec the specification for GameServerSet
-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 |
string
alias)-(Appears on: -GameServerPort) -
--
PortPolicy is the port policy for the GameServer
- -(Appears on: -GameServerSpec) +GameServerSet)
-
SdkServer specifies parameters for the Agones SDK Server sidecar container
+GameServerSetStatus is the status of a GameServerSet
-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 |
string
alias)-(Appears on: -SdkServer) -
--
SdkServerLogLevel is the log level for SDK server (sidecar) logs
- --
Package v1 is the v1 version of the API.
- -Resource Types: - --
GameServerAllocation is the data structure for allocating against a set of
-GameServers, defined selectors
selectors
Field | -Description | -
---|---|
-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 + |
+
+(Appears on: +GameServer, +GameServerTemplateSpec) +
++
GameServerSpec is the spec for a GameServer resource
+Field | +Description | +
---|---|
-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 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
(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.
string
alias)(Appears on: -GameServerAllocation) +GameServerSelector, +GameServerStatus)
-
GameServerAllocationSpec is the spec for a GameServerAllocation
+GameServerState is the state for the GameServer
+ ++(Appears on: +GameServer) +
++
GameServerStatus is the status for a GameServer resource
-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 |
-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] |
string
alias)(Appears on: -GameServerAllocationStatus) +GameServerAllocationStatus, +GameServerStatus)
-
GameServerAllocationState is the Allocation state
+GameServerStatusPort shows the port that was allocated to a +GameServer.
-Field | +Description | +
---|---|
+name
+
+string
+
+ |
++ | +
+port
+
+int32
+
+ |
++ | +
(Appears on: -GameServerAllocation) +FleetSpec, +GameServerSetSpec)
-
GameServerAllocationStatus is the status for an GameServerAllocation resource
+GameServerTemplateSpec is a template for GameServers
-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
+
+
+ |
+
+ + +
GameServerSelector ---(Appears on: -GameServerAllocationSpec) - -- GameServerSelector contains all the filter options for selecting -a GameServer for allocation. - -
|
(Appears on: -GameServerAllocationSpec) +GameServerSpec)
-
MetaPatch is the metadata used to patch the GameServer metadata on allocation
+Health configures health checking on the GameServer
-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 |
-(Appears on: -GameServerAllocationSpec) -
--
MultiClusterSetting specifies settings for multi-cluster allocation.
- -Field | -Description | -
---|---|
-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 |
(Appears on: -GameServerSelector) +GameServerStatus)
-
PlayerSelector is the filter options for a GameServer based on player counts
+PlayerStatus stores the current player capacity values
-minAvailable
+count
int64
@@ -3010,7 +2899,46 @@ PlayerSelector | |
-maxAvailable
+capacity
+
+int64
+
+ |
++ | +
+ids
+
+[]string
+
+ |
++ | +
+(Appears on: +GameServerSpec) +
++
PlayersSpec tracks the initial player capacity
+ +Field | +Description | +
---|---|
+initialCapacity
int64
@@ -3020,18 +2948,87 @@ PlayerSelector |
string
alias)+(Appears on: +GameServerPort) +
++
PortPolicy is the port policy for the GameServer
+ ++(Appears on: +GameServerSpec) +
++
SdkServer specifies parameters for the Agones SDK Server sidecar container
+ +Field | +Description | +
---|---|
+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 + |
+
string
alias)+(Appears on: +SdkServer) +
++
SdkServerLogLevel is the log level for SDK server (sidecar) logs
+
Generated with gen-crd-api-reference-docs
.
Packages:
Package v1 is the v1 version of the API.
Resource Types: --
GameServerAllocation is the data structure for allocating against a set of
-GameServers, defined selectors
selectors
FleetAutoscaler is the data structure for a FleetAutoscaler resource
-allocation.agones.dev/v1
+autoscaling.agones.dev/v1
|
@@ -3078,7 +3077,7 @@ GameServerAllocation |
+FleetAutoscaler |
|||||
@@ -3098,8 +3097,8 @@ GameServerAllocation
spec
-
-GameServerAllocationSpec
+
+FleetAutoscalerSpec
|
|||||||
-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. |
+(Appears on: +FleetAutoscalerPolicy) +
++
BufferPolicy controls the desired behavior of the buffer policy.
+ +Field | +Description | +
---|---|
-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)
(Appears on: -GameServerAllocation) +FleetAutoscalerSync)
-
GameServerAllocationSpec is the spec for a GameServerAllocation
+FixedIntervalSync controls the desired behavior of the fixed interval based sync.
-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 |
+(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. - |
+Field | +Description |
---|---|---|---|
-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 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 |
string
alias)-(Appears on: -GameServerAllocationStatus) -
--
GameServerAllocationState is the Allocation state
- -(Appears on: -GameServerAllocation) +FleetAutoscaleReview)
-
GameServerAllocationStatus is the status for an GameServerAllocation resource
+FleetAutoscaleResponse defines the response of webhook autoscaler endpoint
-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 is passed to the webhook with a populated Request value, +and then returned with a populated Response.
+ +Field | +Description | +
---|---|
-address
+request
-string
+
+FleetAutoscaleRequest
+
|
@@ -3392,9 +3405,11 @@ GameServerAllocatio |
-nodeName
+response
-string
+
+FleetAutoscaleResponse
+
|
@@ -3402,15 +3417,14 @@ GameServerAllocatio |
(Appears on: -GameServerAllocationSpec) +FleetAutoscalerSpec)
-
GameServerSelector contains all the filter options for selecting -a GameServer for allocation.
+FleetAutoscalerPolicy describes how to scale a fleet
-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. |
string
alias)+(Appears on: +FleetAutoscalerPolicy) +
++
FleetAutoscalerPolicyType is the policy for autoscaling +for a given Fleet
+ +(Appears on: -GameServerAllocationSpec) +FleetAutoscaler)
-
MetaPatch is the metadata used to patch the GameServer metadata on allocation
+FleetAutoscalerSpec is the spec for a Fleet Scaler
-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 |
(Appears on: -GameServerAllocationSpec) +FleetAutoscaler)
-
MultiClusterSetting specifies settings for multi-cluster allocation.
+FleetAutoscalerStatus defines the current status of a FleetAutoscaler
-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 |
-(Appears on: -GameServerSelector) -
--
PlayerSelector is the filter options for a GameServer based on player counts
+lastScaleTime
+
+
+Kubernetes meta/v1.Time
+
+
+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.
++(Appears on: +FleetAutoscalerSpec) +
++
FleetAutoscalerSync describes when to sync a fleet
-minAvailable
+type
-int64
+
+FleetAutoscalerSyncType
+
|
+ Type of autoscaling sync. |
-maxAvailable
+fixedInterval
-int64
+
+FixedIntervalSync
+
+
+ |
+
+(Optional)
+ FixedInterval config params. Present only if FleetAutoscalerSyncType = FixedInterval. + |
+
string
alias)+(Appears on: +FleetAutoscalerSync) +
++
FleetAutoscalerSyncType is the sync strategy for a given Fleet
+ ++(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
+ +Field | +Description | +
---|---|
+url
+
+string
+
+ |
+
+(Optional)
+
The Please note that using 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)
+
If the webhook is running within the cluster, then you should use |
+
+caBundle
+
+[]byte
|
+(Optional)
+
|
Package v1 is the v1 version of the API.
Resource Types: --
FleetAutoscaler is the data structure for a FleetAutoscaler resource
+GameServerAllocationPolicy is the Schema for the gameserverallocationpolicies API
-autoscaling.agones.dev/v1
+multicluster.agones.dev/v1
|
@@ -3626,7 +3798,7 @@ FleetAutoscaler |
+GameServerAllocationPolicy |
|||||
@@ -3646,8 +3818,8 @@ FleetAutoscaler
spec
-
-FleetAutoscalerSpec
+
+GameServerAllocationPolicySpec
|
|||||||
-status
-
-
-FleetAutoscalerStatus
-
-
- |
-- | -
(Appears on: -FleetAutoscalerPolicy) +GameServerAllocationPolicySpec)
-
BufferPolicy controls the desired behavior of the buffer policy.
+ClusterConnectionInfo defines the connection information for a cluster
-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 |
-(Appears on: -FleetAutoscalerSync) -
--
FixedIntervalSync controls the desired behavior of the fixed interval based sync.
- -Field | -Description | -
+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. |
-(Appears on: -FleetAutoscaleReview) -
--
FleetAutoscaleRequest defines the request to webhook autoscaler endpoint
+ConnectionInfoIterator an iterator on ClusterConnectionInfo
-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 |
(Appears on: -FleetAutoscaleReview) +GameServerAllocationPolicy)
-
FleetAutoscaleResponse defines the response of webhook autoscaler endpoint
+GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy
-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 |
+
Package v1 is the v1 version of the API.
+ +Resource Types: +-
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
-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.
|
-(Appears on: -FleetAutoscalerSpec) -
--
FleetAutoscalerPolicy describes how to scale a fleet
- -Field | -Description | -
---|---|
-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 |
string
alias)-(Appears on: -FleetAutoscalerPolicy) -
--
FleetAutoscalerPolicyType is the policy for autoscaling -for a given Fleet
- --(Appears on: -FleetAutoscaler) -
--
FleetAutoscalerSpec is the spec for a Fleet Scaler
- -Field | -Description | -
---|---|
-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
[Stage:Beta] -[FeatureFlag:CustomFasSyncInterval] -Sync defines when FleetAutoscalers runs autoscaling
-(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.
-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 |
-(Appears on: -FleetAutoscalerSpec) -
--
FleetAutoscalerSync describes when to sync a fleet
- -Field | -Description | -
---|---|
-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” |
string
alias)-(Appears on: -FleetAutoscalerSync) -
--
FleetAutoscalerSyncType is the sync strategy for a given Fleet
- --(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
- -Field | -Description | -
---|---|
-url
+sdkServer
-string
+
+SdkServer
+
|
-(Optional)
-
The Please note that using 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)
-
If the webhook is running within the cluster, then you should use Template describes the Pod that will be created for the GameServer |
-caBundle
+players
-[]byte
+
+PlayersSpec
+
|
(Optional)
-
(Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features. |
-
Package v1 is the v1 version of the API.
- -Resource Types: - -status
+
+
+GameServerStatus
+
+
+-
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
-multicluster.agones.dev/v1
+agones.dev/v1
|
@@ -4347,7 +4382,7 @@ GameServerAllocationPolicy |
+GameServerSet |
|||||
@@ -4367,8 +4402,8 @@ GameServerAllocat
spec
-
-GameServerAllocationPolicySpec
+
+GameServerSetSpec
|
|||||||
+status
+
+
+GameServerSetStatus
+
+
+ |
++ | +
(Appears on: -GameServerAllocationPolicySpec) +FleetStatus, +GameServerSetStatus)
-
ClusterConnectionInfo defines the connection information for a cluster
+AggregatedPlayerStatus stores total player tracking values
-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 + |
+
+(Appears on: +Fleet) +
++
FleetSpec is the spec for a Fleet
+ +Field | +Description | +
---|---|
+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 an iterator on ClusterConnectionInfo
+(Appears on: +Fleet, +FleetAutoscaleRequest) + ++
FleetStatus is the status of a Fleet
-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 |
(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
-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 |
+
+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. |
-
Package v1 is the v1 version of the API.
+(Appears on: +GameServerSet) -Resource Types: --
Fleet is the data structure for a Fleet resource
+GameServerSetSpec the specification for GameServerSet
-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 + |
+
+(Appears on: +GameServerSet) +
++
GameServerSetStatus is the status of a GameServerSet
+Field | +Description | +
---|---|
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
[Stage:Alpha] +[FeatureFlag:PlayerTracking] +Players is the current total player capacity and count for this 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.
+
GameServerSpec is the spec for a GameServer resource
-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
-
-
- |
-
- - -
|
-|
-status
-
-
-GameServerStatus
-
-
- |
-- | -
string
alias)+(Appears on: +GameServerSelector, +GameServerStatus) +
++
GameServerState is the state for the GameServer
+ +-
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
-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
|
- - -
|
||||||
-status
+players
-
-GameServerSetStatus
+
+PlayerStatus
|
+(Optional)
+ [Stage:Alpha] +[FeatureFlag:PlayerTracking] |
(Appears on: -FleetStatus, -GameServerSetStatus) +GameServerAllocationStatus, +GameServerStatus)
-
AggregatedPlayerStatus stores total player tracking values
+GameServerStatusPort shows the port that was allocated to a +GameServer.
-count
+name
-int64
+string
|
@@ -5042,9 +5131,9 @@ AggregatedPlayerStatus |
-capacity
+port
-int64
+int32
|
@@ -5052,14 +5141,15 @@ AggregatedPlayerStatus |
(Appears on: -Fleet) +FleetSpec, +GameServerSetSpec)
-
FleetSpec is the spec for a Fleet
+GameServerTemplateSpec is a template for GameServers
-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 |
-(Appears on: -Fleet, -FleetAutoscaleRequest) -
--
FleetStatus is the status of a Fleet
- -Field | -Description | -
---|---|
-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. + |
+
(Appears on: GameServerSpec)
-
GameServerPort defines a set of Ports that -are to be exposed via the GameServer
+Health configures health checking on the GameServer
-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 |
-
-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 |
(Appears on: -GameServerSet) +GameServerStatus)
-
GameServerSetSpec the specification for GameServerSet
+PlayerStatus stores the current player capacity values
-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 |
(Appears on: -GameServerSet) +GameServerSpec)
-
GameServerSetStatus is the status of a GameServerSet
+PlayersSpec tracks the initial player capacity
-replicas
-
-int32
-
- |
-
- Replicas is the total number of current GameServer replicas - |
-
-readyReplicas
+initialCapacity
-int32
+int64
|
- ReadyReplicas is the number of Ready GameServer replicas |
string
alias)+(Appears on: +GameServerPort) +
++
PortPolicy is the port policy for the GameServer
+ ++(Appears on: +GameServerSpec) +
++
SdkServer specifies parameters for the Agones SDK Server sidecar container
+ +
-reservedReplicas
-
-int32
-
- |
-
- ReservedReplicas is the number of Reserved GameServer replicas - |
+Field | +Description |
---|---|---|---|
-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 |
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
+ ++
Package v1 is the v1 version of the API.
+ +Resource Types: + ++
GameServerAllocation is the data structure for allocating against a set of
+GameServers, defined selectors
selectors
-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 ++ +
|
||||||||||||
-players
+status
-
-PlayersSpec
+
+GameServerAllocationStatus
|
-(Optional)
- (Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features. |
string
alias)-(Appears on: -GameServerSelector, -GameServerStatus) -
--
GameServerState is the state for the GameServer
- -(Appears on: -GameServer) +GameServerAllocation)
-
GameServerStatus is the status for a GameServer resource
+GameServerAllocationSpec is the spec for a GameServerAllocation
-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 |
-players
+selectors
-
-PlayerStatus
+
+[]GameServerSelector
|
-(Optional)
- [Stage:Alpha] -[FeatureFlag:PlayerTracking] - |
-
-(Appears on: -GameServerAllocationStatus, -GameServerStatus) -
--
GameServerStatusPort shows the port that was allocated to a -GameServer.
- -Field | -Description | +
---|---|
-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 |
string
alias)+(Appears on: +GameServerAllocationStatus) +
++
GameServerAllocationState is the Allocation state
+ +(Appears on: -FleetSpec, -GameServerSetSpec) +GameServerAllocation)
-
GameServerTemplateSpec is a template for GameServers
+GameServerAllocationStatus is the status for an GameServerAllocation resource
-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
-
-
- |
-
- - -
If the allocation is from a remote cluster, Source is the endpoint of the remote agones-allocator. +Otherwise, Source is “local” |
(Appears on: -GameServerSpec) +GameServerAllocationSpec)
-
Health configures health checking on the GameServer
+GameServerSelector contains all the filter options for selecting +a GameServer for allocation.
-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. |
(Appears on: -GameServerStatus) +GameServerAllocationSpec)
-
PlayerStatus stores the current player capacity values
+MetaPatch is the metadata used to patch the GameServer metadata on allocation
-count
-
-int64
-
- |
-- | -
-capacity
+labels
-int64
+map[string]string
|
@@ -5931,9 +5964,9 @@ PlayerStatus |
-ids
+annotations
-[]string
+map[string]string
|
@@ -5941,14 +5974,14 @@ PlayerStatus |
(Appears on: -GameServerSpec) +GameServerAllocationSpec)
-
PlayersSpec tracks the initial player capacity
+MultiClusterSetting specifies settings for multi-cluster allocation.
-initialCapacity
+enabled
-int64
+bool
+
+ |
++ | +
+policySelector
+
+
+Kubernetes meta/v1.LabelSelector
+
|
@@ -5970,23 +6015,14 @@ PlayersSpec |
string
alias)-(Appears on: -GameServerPort) -
--
PortPolicy is the port policy for the GameServer
- -(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
-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 |
string
alias)-(Appears on: -SdkServer) -
--
SdkServerLogLevel is the log level for SDK server (sidecar) logs
-
Generated with gen-crd-api-reference-docs
.