docs: added a kubernetes example
This commit is contained in:
1 parent
8480be99f6
commit
5797eb8b5d
2 files changed
+88
-1
No files matched your search
@@ -60,7 +60,6 @@ docker run -d --name bds-flat-creative \
|
|||||||
-p 19132:19132/udp itzg/minecraft-bedrock-server
|
-p 19132:19132/udp itzg/minecraft-bedrock-server
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Exposed Ports
|
## Exposed Ports
|
||||||
|
|
||||||
- **UDP** 19132 : the Bedrock server port.
|
- **UDP** 19132 : the Bedrock server port.
|
||||||
@@ -77,3 +76,33 @@ When running the container on your LAN, you can find and connect to the dedicate
|
|||||||
in the "LAN Games" part of the "Friends" tab, such as:
|
in the "LAN Games" part of the "Friends" tab, such as:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Deploying with Kubernetes
|
||||||
|
|
||||||
|
The [examples](examples) directory contains [an example Kubernetes manifest file](examples/kubernetes.yml) that declares:
|
||||||
|
- a peristent volume claim (using default storage class)
|
||||||
|
- a pod deployment that uses the declared PVC
|
||||||
|
- a service of type LoadBalancer
|
||||||
|
|
||||||
|
The pod deployment includes some examples of configuring the server properties via environment variables:
|
||||||
|
```yaml
|
||||||
|
env:
|
||||||
|
- name: EULA
|
||||||
|
value: "TRUE"
|
||||||
|
- name: GAMEMODE
|
||||||
|
value: survival
|
||||||
|
- name: DIFFICULTY
|
||||||
|
value: normal
|
||||||
|
```
|
||||||
|
|
||||||
|
The file is deploy-able as-is on most clusters, but has been confirmed on [Docker for Desktop](https://docs.docker.com/docker-for-windows/kubernetes/) and [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/docs/):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl apply -f examples/kubernetes.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
You can follow the logs of the deployment using:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl logs -f deployment/bds
|
||||||
|
```
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: bds
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: bds
|
||||||
|
labels:
|
||||||
|
app: bds
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: bds
|
||||||
|
labels:
|
||||||
|
app: bds
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: bds
|
||||||
|
image: itzg/minecraft-bedrock-server
|
||||||
|
env:
|
||||||
|
- name: EULA
|
||||||
|
value: "TRUE"
|
||||||
|
- name: GAMEMODE
|
||||||
|
value: survival
|
||||||
|
- name: DIFFICULTY
|
||||||
|
value: normal
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /data
|
||||||
|
name: data
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: bds
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: bds
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: bds
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: bds
|
||||||
|
ports:
|
||||||
|
- port: 19132
|
||||||
|
protocol: UDP
|
||||||
|
type: LoadBalancer
|
||||||
Reference in new issue
Block a user