https://github.com/idebeijer/gameserver-operator
An operator to deploy game servers on Kubernetes using LinuxGSM
https://github.com/idebeijer/gameserver-operator
gameserver k8s kubernetes kubernetes-operator linuxgsm operator
Last synced: 4 months ago
JSON representation
An operator to deploy game servers on Kubernetes using LinuxGSM
- Host: GitHub
- URL: https://github.com/idebeijer/gameserver-operator
- Owner: idebeijer
- License: mit
- Created: 2024-03-18T19:10:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-12T13:49:40.000Z (5 months ago)
- Last Synced: 2026-02-12T22:31:28.886Z (5 months ago)
- Topics: gameserver, k8s, kubernetes, kubernetes-operator, linuxgsm, operator
- Language: Go
- Homepage:
- Size: 329 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
GameServer Operator
**A Kubernetes operator for managing game servers via LinuxGSM with security in mind**
[](https://github.com/idebeijer/gameserver-operator/blob/main/LICENSE)
[](https://github.com/idebeijer/gameserver-operator/releases)
[](https://goreportcard.com/report/github.com/idebeijer/gameserver-operator)
[](https://github.com/idebeijer/gameserver-operator/actions)
[](https://go.dev/)
[](https://kubernetes.io/)
[](https://artifacthub.io/packages/helm/gameserver-operator/gameserver-operator)
## Overview
GameServer Operator is a Kubernetes CRD controller that provides a declarative way to deploy and manage game servers via [LinuxGSM](https://linuxgsm.com/). With a `GameServer` custom resource, you define the game, storage layout, and networking, while the operator takes care of orchestration.
Couldn't this be done with a Helm chart? Maybe, but the operator pattern provides more flexibility and extensibility. And since it's built with future features in mind (like automated mod installs, backups, updates, CLI/web UI, etc.), an operator seems like a better fit.
## Features
- **Universal game support** – Deploy any LinuxGSM-supported game server using a single CRD.
- **Security-first defaults** – Non-root user, restricted capabilities, seccomp profile, and no privilege escalation.
## Requirements
- Kubernetes 1.22+ (operator uses [Server-Side Apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/)).
- Helm 3.8+.
- `kubectl` configured for the target cluster.
- Some games require SteamCMD. Check the LinuxGSM SteamCMD guide at https://docs.linuxgsm.com/steamcmd.
## Installation
### Helm (recommended)
```bash
helm install gameserver-operator \
oci://ghcr.io/idebeijer/charts/gameserver-operator \
--namespace gameserver-system \
--create-namespace
```
### From source
```bash
make docker-build docker-push IMG=/gameserver-operator:
make deploy IMG=/gameserver-operator:
```
The first command builds and pushes an image that matches any local changes; the second command deploys that image and installs the CRDs into the target cluster.
## Quick Start
1. Install the operator using the [Helm chart](#helm-recommended) or `make deploy`.
2. Apply a `GameServer` manifest that describes the game you want to run.
### Example: Minecraft server
```yaml
apiVersion: games.idebeijer.github.io/v1alpha1
kind: GameServer
metadata:
name: my-minecraft-server
spec:
gameName: mc
service:
type: LoadBalancer
ports:
- name: game
port: 25565
protocol: TCP
storage:
size: 20Gi
```
Apply these manifests with `kubectl apply -f ` (or `-` for stdin).
## Development Workflow
```bash
make install # Install or update CRDs in the active kubecontext
make run # Run the controller locally against cluster in kubeconfig
make deploy IMG=... # Build manifests and deploy the manager to the cluster
make undeploy # Remove the manager and associated resources
```
More details in [CONTRIBUTING.md](./CONTRIBUTING.md).
## Documentation
Additional examples and configuration snippets live in the [`config/samples`](./config/samples) directory. The [`pkg/specs`](./pkg/specs) package contains the programmatic representation of supported options.
## Known Limitations
- Some actions might be unsupported due to security restrictions. To name a few:
- Binding to ports below 1024.
- Games that require `CAP_NET_ADMIN` or `CAP_SYS_ADMIN` will not work due to dropped capabilities.
- LinuxGSM cron-based automations (updates, backups) are disabled under the default security profile. (working on a k8s native solution)
Those limitations are intentional to maintain a secure default. If it appears that a game cannot run under these restrictions, please open an issue.
Otherwise, in the future the `GameServer` spec may include options for customizing security settings per game.
## Stability and API Changes
⚠️ **Major version zero (v0.x.x).** The CRDs and APIs may change between releases and backwards compatibility is not guaranteed.
## Roadmap
- [ ] Automatic Minecraft modded server setup (CurseForge).
- [ ] CLI tool for managing game servers.
- [ ] Web UI for server management.
- [ ] Command forwarding service (native LinuxGSM commands).
- [ ] Configurable security contexts per game. (if it turns out some games need it)
- [ ] Native backup support using CronJobs.
- [ ] Auto-update scheduling.
## Special Thanks
Special thanks to the [LinuxGSM](https://linuxgsm.com/) maintainers for the tooling and huge catalog of supported games that power this operator.
## Contributing
Contributions are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.
## License
Licensed under the MIT License. See [LICENSE](./LICENSE) for details.