-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kubernetes integration and graceful shutdown (#960)
* Refactor server shutdown method * Move shutdown notification to BroadcastService * Add framework for graceful shutdown * Wait for connections to drain during graceful shutdown * Add signal handler to allow cancellation of drain task * Kick idle players during graceful shutdown * Abort connections if they don't login within a certain timeout * Prevent new games from being created during graceful shutdown * Prevent players from joining matchmaker during graceful shutdown * Add kubernetes readiness endpoint to control server * Add health server and refactor control server * Wait for all games to end during graceful shutdown * Close games that are in lobby during graceful shutdown * Notify players when the graceful shutdown period starts * Add integration test for graceful shutdown * Add example kubernetes config file * Misc refactor * Add info module for collecting static info
- Loading branch information
Showing
34 changed files
with
1,122 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: faf-lobby | ||
labels: | ||
app: faf-lobby | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: faf-lobby | ||
ports: | ||
- port: 8001 | ||
name: qstream | ||
- port: 8002 | ||
name: simplejson | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: faf-lobby | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: faf-lobby | ||
template: | ||
metadata: | ||
labels: | ||
app: faf-lobby | ||
spec: | ||
terminationGracePeriodSeconds: 310 | ||
containers: | ||
- name: faf-python-server | ||
image: faf-python-server:graceful | ||
imagePullPolicy: Never | ||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: health | ||
initialDelaySeconds: 4 | ||
periodSeconds: 1 | ||
ports: | ||
- containerPort: 4000 | ||
name: control | ||
- containerPort: 2000 | ||
name: health | ||
- containerPort: 8001 | ||
name: qstream | ||
- containerPort: 8002 | ||
name: simplejson | ||
env: | ||
- name: CONFIGURATION_FILE | ||
value: /config/config.yaml | ||
- name: CONTAINER_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
volumeMounts: | ||
- name: config | ||
mountPath: /config | ||
readOnly: true | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: minikube-dev-config | ||
items: | ||
- key: config.yaml | ||
path: config.yaml | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: minikube-dev-config | ||
data: | ||
config.yaml: | | ||
LOG_LEVEL: TRACE | ||
USE_POLICY_SERVER: false | ||
QUEUE_POP_TIME_MAX: 30 | ||
SHUTDOWN_GRACE_PERIOD: 300 | ||
SHUTDOWN_KICK_IDLE_PLAYERS: true | ||
DB_SERVER: host.minikube.internal | ||
MQ_SERVER: host.minikube.internal |
Oops, something went wrong.