Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move SplitControllerAndExtensions to Stable #3523

Merged
4 changes: 2 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ steps:
region=${versionsAndRegions[$version]}
if [ $cloudProduct = generic ]
then
featureWithGate="PlayerAllocationFilter=true&PlayerTracking=true&SplitControllerAndExtensions=false&FleetAllocationOverflow=false&CountsAndLists=true&DisableResyncOnSDKServer=true&Example=true"
featureWithGate="PlayerAllocationFilter=true&PlayerTracking=true&FleetAllocationOverflow=false&CountsAndLists=true&DisableResyncOnSDKServer=true&Example=true"
testCluster="standard-e2e-test-cluster-${version//./-}"
else
featureWithGate="PlayerAllocationFilter=true&PlayerTracking=true&SplitControllerAndExtensions=true&FleetAllocationOverflow=false&CountsAndLists=true&DisableResyncOnSDKServer=true&Example=true"
featureWithGate="PlayerAllocationFilter=true&PlayerTracking=true&FleetAllocationOverflow=false&CountsAndLists=true&DisableResyncOnSDKServer=true&Example=true"
testCluster="gke-autopilot-e2e-test-cluster-${version//./-}"
fi
featureWithoutGate=""
Expand Down
19 changes: 0 additions & 19 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ import (
"agones.dev/agones/pkg/cloudproduct"
"agones.dev/agones/pkg/fleetautoscalers"
"agones.dev/agones/pkg/fleets"
"agones.dev/agones/pkg/gameserverallocations"
"agones.dev/agones/pkg/gameservers"
"agones.dev/agones/pkg/gameserversets"
"agones.dev/agones/pkg/metrics"
"agones.dev/agones/pkg/util/apiserver"
"agones.dev/agones/pkg/util/https"
"agones.dev/agones/pkg/util/runtime"
"agones.dev/agones/pkg/util/signals"
"agones.dev/agones/pkg/util/webhooks"
"github.com/google/uuid"
"github.com/heptiolabs/healthcheck"
"github.com/pkg/errors"
Expand Down Expand Up @@ -165,10 +161,6 @@ func main() {
if err != nil {
logger.WithError(err).Fatal("Could not initialize cloud product")
}
// https server and the items that share the Mux for routing
httpsServer := https.NewServer(ctlConf.CertFile, ctlConf.KeyFile)
wh := webhooks.NewWebHook(httpsServer.Mux)
api := apiserver.NewAPIServer(httpsServer.Mux)

agonesInformerFactory := externalversions.NewSharedInformerFactory(agonesClient, defaultResync)
kubeInformerFactory := informers.NewSharedInformerFactory(kubeClient, defaultResync)
Expand Down Expand Up @@ -228,17 +220,6 @@ func main() {
rs = append(rs,
gsCounter, gsController, gsSetController, fleetController, fasController)

if !runtime.FeatureEnabled(runtime.FeatureSplitControllerAndExtensions) {
gameservers.NewExtensions(controllerHooks, wh)
gameserversets.NewExtensions(controllerHooks, wh)
fleets.NewExtensions(controllerHooks, wh)
fleetautoscalers.NewExtensions(wh)

gasController := gameserverallocations.NewExtensions(api, health, gsCounter, kubeClient, kubeInformerFactory,
agonesClient, agonesInformerFactory, 10*time.Second, 30*time.Second, ctlConf.AllocationBatchWaitTime)
rs = append(rs, httpsServer, gasController)
}

runRunner := func(r runner) {
if err := r.Run(ctx, ctlConf.NumWorkers); err != nil {
logger.WithError(err).Fatalf("could not start runner! %T", r)
Expand Down
1 change: 0 additions & 1 deletion install/helm/agones/defaultfeaturegates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

# Beta features
FleetAllocationOverflow: true
SplitControllerAndExtensions: true

# Alpha features
PlayerAllocationFilter: false
Expand Down
4 changes: 0 additions & 4 deletions install/helm/agones/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- $featureGates := include "agones.featureGates" . | fromYaml }}
{{- $replicas := (int .Values.agones.controller.replicas) }}
{{- if not $featureGates.SplitControllerAndExtensions }}
{{- $replicas = 1 }}
{{- end }}
markmandel marked this conversation as resolved.
Show resolved Hide resolved
{{- if lt $replicas 1 }}
{{- fail "agones.controller.replica field has an invalid value!" }}
{{- end }}
Expand Down
3 changes: 0 additions & 3 deletions install/helm/agones/templates/extensions-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- $featureGates := include "agones.featureGates" . | fromYaml }}
{{- if $featureGates.SplitControllerAndExtensions }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -209,4 +207,3 @@ spec:
app: {{ template "agones.name" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
# 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.
{{- $featureGates := include "agones.featureGates" . | fromYaml }}
{{- if $featureGates.SplitControllerAndExtensions }}

apiVersion: v1
kind: Service
metadata:
Expand All @@ -31,4 +30,3 @@ spec:
- name: metrics
port: {{ .Values.agones.controller.http.port }}
targetPort: http
{{- end}}
8 changes: 0 additions & 8 deletions install/helm/agones/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,14 @@ metadata:
name: agones-controller-service
namespace: {{ .Release.Namespace }}
labels:
{{- if $featureGates.SplitControllerAndExtensions }}
agones.dev/role: extensions
{{- else}}
agones.dev/role: controller
{{- end}}
app: {{ template "agones.name" . }}
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
{{- if $featureGates.SplitControllerAndExtensions }}
agones.dev/role: extensions
{{- else}}
agones.dev/role: controller
{{- end}}
ports:
- name: webhooks
port: 443
Expand Down
1 change: 0 additions & 1 deletion install/helm/agones/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ agones:
controller:
name: agones-controller
pullPolicy: IfNotPresent
# extensions settings ignored unless `SplitControllerAndExtensions` feature gate is enabled
extensions:
name: agones-extensions
pullPolicy: IfNotPresent
Expand Down
2 changes: 2 additions & 0 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16800,6 +16800,7 @@ spec:
# 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.

apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -17128,6 +17129,7 @@ spec:
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
12 changes: 4 additions & 8 deletions pkg/util/runtime/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ const (
////////////////
// Beta features

// FeatureSplitControllerAndExtensions is a feature flag that will split agones-controller into two deployments
FeatureSplitControllerAndExtensions Feature = "SplitControllerAndExtensions"
// FeatureFleetAllocateOverflow enables setting labels and/or annotations on Allocated GameServers
// if the desired number of the underlying GameServerSet drops below the number of Allocated GameServers.
FeatureFleetAllocateOverflow Feature = "FleetAllocationOverflow"

////////////////
// Alpha features
Expand All @@ -44,10 +45,6 @@ const (
// FeaturePlayerTracking is a feature flag to enable/disable player tracking features.
FeaturePlayerTracking Feature = "PlayerTracking"

// FeatureFleetAllocateOverflow enables setting labels and/or annotations on Allocated GameServers
// if the desired number of the underlying GameServerSet drops below the number of Allocated GameServers.
FeatureFleetAllocateOverflow = "FleetAllocationOverflow"

// FeatureCountsAndLists is a feature flag that enables/disables counts and lists feature
// (a generic implenetation of the player tracking feature).
FeatureCountsAndLists Feature = "CountsAndLists"
Expand Down Expand Up @@ -91,8 +88,7 @@ var (
// In each of these, keep the feature sorted by descending maturity then alphabetical
featureDefaults = map[Feature]bool{
// Beta features
FeatureFleetAllocateOverflow: true,
FeatureSplitControllerAndExtensions: true,
FeatureFleetAllocateOverflow: true,

// Alpha features
FeaturePlayerAllocationFilter: false,
Expand Down
18 changes: 18 additions & 0 deletions site/content/en/docs/Advanced/high-availability-agones.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ description: >
publishDate: 2023-02-28
---

{{% feature expiryVersion="1.37.0" %}}
{{< beta title="split controller and extensions" gate="SplitControllerAndExtensions" >}}
{{% /feature %}}

## High Availability for Agones Controller

{{% feature expiryVersion="1.37.0" %}}
When `SplitControllerAndExtensions` is enabled, the `agones-controller` responsibility is split up into `agones-controller`, which enacts the Agones control loop, and `agones-extensions`, which acts as a service endpoint for webhooks and the allocation extension API. Splitting these responsibilities allows the `agones-extensions` pod to be **horizontally scaled**, making the Agones control plane **highly available** and more **resiliant to disruption**.

`SplitControllerAndExtensions` enables multiple `agones-controller` pods, with a primary controller selected via leader election. Having multiple `agones-controller` minimizes downtime of the service from pod disruptions such as deployment updates, autoscaler evictions, and crashes.

`SplitControllerAndExtensions` must be enabled for GKE Autopilot.
{{% /feature %}}

{{% feature publishVersion="1.37.0" %}}
The `agones-controller` responsibility is split up into `agones-controller`, which enacts the Agones control loop, and `agones-extensions`, which acts as a service endpoint for webhooks and the allocation extension API. Splitting these responsibilities allows the `agones-extensions` pod to be **horizontally scaled**, making the Agones control plane **highly available** and more **resiliant to disruption**.

Multiple `agones-controller` pods enabled, with a primary controller selected via leader election. Having multiple `agones-controller` minimizes downtime of the service from pod disruptions such as deployment updates, autoscaler evictions, and crashes.
{{% /feature %}}

## Extension Pod Configrations

Expand All @@ -34,9 +44,17 @@ An important configuration to note is the PodDisruptionBudget fields, `agones.ex

## Deployment Considerations

{{% feature expiryVersion="1.37.0" %}}
Leader election will automatically be enabled when `SplitControllerAndExtensions` is enabled and `agones.controller.replicas` is > 1. [`agones.controller.replicas`]({{< relref "/docs/Installation/Install Agones/helm.md#configuration" >}}) defaults to 2.

When `SplitControllerAndExtensions` is enabled, what was previously a single `agones-controller` pod is deployed by default as 2 `agones-controller` and 2 `agones-extensions` pods. For example:
{{% /feature %}}

{{% feature publishVersion="1.37.0" %}}
Leader election will automatically be enabled and `agones.controller.replicas` is > 1. [`agones.controller.replicas`]({{< relref "/docs/Installation/Install Agones/helm.md#configuration" >}}) defaults to 2.

The default configuration now deploys 2 `agones-controller` pods and 2 `agones-extensions` pods, replacing the previous single `agones-controller` pod setup. For example:
{{% /feature %}}

```
NAME READY STATUS RESTARTS AGE
Expand Down
1 change: 0 additions & 1 deletion site/content/en/docs/Guides/feature-stages.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ The current set of `alpha` and `beta` feature gates:
| Feature Name | Gate | Default | Stage | Since |
|-----------------------------------------------------------------------------------------------------------------------|--------------------------------|----------|---------|--------|
| [Allocated GameServers are notified on relevant Fleet Updates][fleet-updates] | `FleetAllocationOverflow` | Enabled | `Beta` | 1.37.0 |
| [Split `agones-controller` ](https://github.com/googleforgames/agones/issues/2797) | `SplitControllerAndExtensions` | Enabled | `Beta` | 1.32.0 |
| [CountsAndLists](https://github.com/googleforgames/agones/issues/2716) | `CountsAndLists` | Disabled | `Alpha` | 1.37.0 |
| [GameServer player capacity filtering on GameServerAllocations](https://github.com/googleforgames/agones/issues/1239) | `PlayerAllocationFilter` | Disabled | `Alpha` | 1.14.0 |
| [Player Tracking]({{< ref "/docs/Guides/player-tracking.md" >}}) | `PlayerTracking` | Disabled | `Alpha` | 1.6.0 |
Expand Down
3 changes: 3 additions & 0 deletions site/content/en/docs/Installation/Creating Cluster/gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,14 @@ Flag explanations:
* `--release-channel`: The release channel [you chose above](#choosing-a-release-channel-and-optional-version).
* `--autoprovisioning-network-tags`: Defines the tags that will be attached to new nodes in the cluster. This is to grant access through ports via the [firewall created above](#creating-the-firewall).

{{% feature expiryVersion="1.37.0" %}}
{{<alert title="Warning" color="warning">}}
To install Agones on version 1.30-1.31, you must enable the `SplitControllerAndExtensions`
[feature gate]({{% ref "/docs/Guides/feature-stages.md#feature-gates" %}}).
This feature is enabled by default starting in Agones 1.32.0.
{{</alert>}}
{{% /feature %}}


## Setting up cluster credentials

Expand Down
Loading