Carrier is a Kubernetes controller for running and scaling game servers on Kubernetes.

Related tags

DevOps Tools carrier
Overview

Carrier

Carrier is a Kubernetes controller for running and scaling game servers on Kubernetes.

This project is inspired by agones.

Introduction

Generally speaking, the online multiplayer games such as competitive FPSs and MOBAs, require a Dedicated Game Server(DS) which simulating game worlds, and players connect to the server with separate client programs, then playing within it.

Dedicated game servers are stateful applications that retain the full game simulation in memory. But unlike other stateful applications, such as databases, they have a short lifetime. Rather than running for months or years, a dedicated game server process will exit when a game is over, which usually lasts a few minutes or hours.

The Kubernetes Statefulset workload does not manage such applications well. Carrier communicates with the game server through the SDK, and dedicated server can notify the Carrier when no player whthin it, then the Carrier can delete the Pod safely. Conversely, when scaling down the Kubernetes cluster, Carrier can also notify the game server through the SDK, which allows the Carrier to better running and scaling the game server.

Main Features

Good Scalability

Carrier provides many extensions to communicate with game server and services out of K8s clusters.

  • SDK

    communicate with game server directly, which enables game server runtime fetching the GameServer status running in K8s, e.g. LB Status, Labels and Annotations.

  • Webhook(Readiness/Deletable)

    this extension helps user to define when a GameServer is ready or can be deleted. Carrier will fetch the GameServer status from webhook servers developed by users according to the protocol.

Scale down GameServers in order

There are many players on different GameServer. Since carrier do not allow scaling down a GameServer when it is not deletable, carrier should scale down the GameServers in order to avoid waiting long time. An annotation named carrier.ocgi.dev/gs-deletion-cost is used for helping sort the GameServers. This annotation can be added by SDK or set carrier.ocgi.dev/gs-cost-metrics-name to enable fetching metrics to set carrier.ocgi.dev/gs-deletion-cost.

Update Policy

We support some policies to Update Squad.

  • Recreate
  • RollingUpdate
  • CanaryUpdate
  • InPlaceUpdate

Application architecture based on Carrier

Here’s an example of dedicated game server architecture based on Carrier.

The overall game server architecture

  • MatchMaker Responsible for match making (developed by the application)

  • Dscenter Responsible for Dedicated Server management and allocation (developed by the application)

  • Dedicated Server Corresponds to a GameServer, manages multiple DS processes, and reports ds information to Dscenter. Dedicated Server and Carrier-SDK as a whole are deployed in the same K8s Pod

  • Carrier Controller Manage a group of GameServers(include create, update, delete) and maintain a certain number of replicas of the DS cluster

  • Autoscaler Calculate and adjust the number of replicas of the DS cluster according to application metrics, events, time, etc.

Quick Start

Build and deploy the Carrier.

Build

# make container

Deploy

# # change the image version if you would like to deploy a specified version(default: latest).

# kubectl apply -f manifeasts/crd.yaml
# kubectl apply -f manifeasts/deploy.yaml

Documentation

You can view the full documentation from the website.

License

Carrier is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Issues
  • fix

    fix "did not find expected alphabetic or numeric character" on apply

    I tried the quickstart with minikube, but it failed with the following error, so I fixed it.

    error: error parsing deploy.yaml: error converting YAML to JSON: yaml: line 13: did not find expected alphabetic or numeric character
    
    opened by castaneai 0
  • Add message field to GameServer Condition

    Add message field to GameServer Condition

    Message enables setting more information to a GameServer. For example: When a GameServer starts up, set number of allocatable players, then if a player connects, change the number, which makes developing a gpa webhook based on online players possible.

    opened by cwdsuzhou 0
Releases(v0.1.0)
  • v0.1.0(Jun 17, 2021)

    Carrier controller: version 0.1.0

    1. Support different update policy;
    2. Support constraint of GameServer;
    3. Support scale down according to GameServer cost.
    Source code(tar.gz)
    Source code(zip)
Owner
Open Cloud-native Game-application Initiative
Run and Scale Game Server better on Kubernetes
Open Cloud-native Game-application Initiative
Create AWS Auto Scaling groups from running instances or AMIs automatically.

AWS Auto Scaling Groups Builder AWS Auto Scaling group is a great way of managing Amazon EC2 instances. AWS Auto Scaling group watches the correspondi

Alexey Shagraev 1 Jan 7, 2022
Image clone controller is a kubernetes controller to safe guard against the risk of container images disappearing

Image clone controller image clone controller is a kubernetes controller to safe guard against the risk of container images disappearing from public r

Jayadeep KM 0 Oct 10, 2021
A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore

bookstore-sample-controller A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore. A resource cre

Abdullah Al Shaad 0 Jan 20, 2022
A Kubernetes Operator used for pre-scaling applications in anticipation of load

Pre-Scaling Kubernetes Operator Built out of necessity, the Operator helps pre-scale applications in anticipation of load. At its core, it manages a c

Container Solutions 24 Oct 14, 2021
Aws asg updater - Update AMIs within AWS Auto Scaling groups automatically.

AWS Auto Scaling Groups Updater AWS Auto Scaling group is a great way of managing Amazon EC2 instances. AWS Auto Scaling group watches the correspondi

Alexey Shagraev 1 Jan 6, 2022
Rotate is a tool for rotating out AWS Auto-Scaling Groups within a k8s cluster

k8s-r8 rotate is a tool for rotating out AWS Auto-Scaling Groups within a k8s cluster. It was developed to make upgrading AMIs as a one command experi

maikxchd 0 Mar 27, 2022
network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of kubernetes.

Network Node Manager network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of ku

kakao 97 Jun 12, 2022
The OCI Service Operator for Kubernetes (OSOK) makes it easy to connect and manage OCI services from a cloud native application running in a Kubernetes environment.

OCI Service Operator for Kubernetes Introduction The OCI Service Operator for Kubernetes (OSOK) makes it easy to create, manage, and connect to Oracle

Oracle 22 Jun 17, 2022
kitex running in kubernetes cluster and discover each other in kubernetes Service way

Using kitex in kubernetes Kitex [kaɪt'eks] is a high-performance and strong-extensibility Golang RPC framework. This go module helps you to build mult

adolli 1 Feb 21, 2022
Annotated and kubez-autoscaler-controller will maintain the HPA automatically for kubernetes resources.

Kubez-autoscaler Overview kubez-autoscaler 通过为 deployment / statefulset 添加 annotations 的方式,自动维护对应 HorizontalPodAutoscaler 的生命周期. Prerequisites 在 kuber

null 115 May 29, 2022
An Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer

NGINX Ingress Controller Overview ingress-nginx is an Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer. Learn more a

null 0 Nov 15, 2021
A kubernetes controller that watches the Deployments and “caches” the images

image-cloner This is just an exercise. It's a kubernetes controller that watches

Luca Sepe 1 Dec 20, 2021
Sesame: an Ingress controller for Kubernetes that works by deploying the Envoy proxy as a reverse proxy and load balancer

Sesame Overview Sesame is an Ingress controller for Kubernetes that works by dep

Sesame 1 Dec 28, 2021
KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes

Kubernetes-based Event Driven Autoscaling KEDA allows for fine-grained autoscaling (including to/from zero) for event driven Kubernetes workloads. KED

KEDA 5.1k Jul 1, 2022
A Kubernetes Terraform Controller

Terraform Controller Terraform Controller is a Kubernetes Controller for Terraform, which can address the requirement of Using Terraform HCL as IaC mo

Open Application Model 86 Jun 22, 2022
the simplest testing framework for Kubernetes controller.

KET(Kind E2e Test framework) KET is the simplest testing framework for Kubernetes controller. KET is available as open source software, and we look fo

Riita 37 Jun 27, 2022
Kubernetes workload controller for container image deployment

kube-image-deployer kube-image-deployer는 Docker Registry의 Image:Tag를 감시하는 Kubernetes Controller입니다. Keel과 유사하지만 단일 태그만 감시하며 더 간결하게 동작합니다. Container, I

PUBG Corporation 2 Mar 8, 2022
Kubernetes Admission controller for golang

KCAdm Kubernetes Admission controller Test locally First create the required cer

Christos Kotsis 0 Dec 23, 2021
Kubernetes controller for backing up public container images to our own registry repository

image-clone-controller Kubernetes controller which watches applications (Deployment and DaemonSet) and "caches" the images (public container images) b

Sahadat Hossain 6 Jan 17, 2022