File size: 2,969 Bytes
c08e495
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: minecraft-bedrock
  labels:
    role: service-config
    app: bds
data:
  # Find more options at https://github.com/itzg/docker-minecraft-bedrock-server#server-properties
  # Remove # from in front of line if changing from default values.
  EULA: "TRUE" # Must accept EULA to use this minecraft server
  #GAMEMODE: "survival" # Options: survival, creative, adventure
  #DIFFICULTY: "easy" # Options: peaceful, easy, normal, hard
  #DEFAULT_PLAYER_PERMISSION_LEVEL: "member" # Options: visitor, member, operator
  #LEVEL_NAME: "my_minecraft_world"
  #LEVEL_SEED: "33480944"
  #SERVER_NAME: "my_minecraft_server"
  #SERVER_PORT: "19132"
  #LEVEL_TYPE: "DEFAULT" # Options: FLAT, LEGACY, DEFAULT
  #ALLOW_CHEATS: "false" # Options: true, false
  #MAX_PLAYERS: "10"
  #PLAYER_IDLE_TIMEOUT: "30"
  #TEXTUREPACK_REQUIRED: "false" # Options: true, false
  #
  ## Changing these will have a security impact
  #ONLINE_MODE: "true" # Options: true, false (removes Xbox Live account requirements)
  #WHITE_LIST: "false" # If enabled, need to provide a whitelist.json by your own means. 
  #
  ## Changing these will have a performance impact
  #VIEW_DISTANCE: "10"
  #TICK_DISTANCE: "4"
  #MAX_THREADS: "8"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: bds
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app: bds
  name: bds
spec:
  # never more than 1 since BDS is not horizontally scalable
  replicas: 1
  serviceName: bds
  selector:
    matchLabels:
      app: bds
  template:
    metadata:
      labels:
        app: bds
    spec:
      containers:
        - name: main
          image: itzg/minecraft-bedrock-server
          imagePullPolicy: Always
          envFrom:
            - configMapRef:
                name: minecraft-bedrock
          volumeMounts:
            - mountPath: /data
              name: data
          ports:
            - containerPort: 19132
              protocol: UDP
          readinessProbe: &probe
            exec:
              command:
                - mc-monitor
                - status-bedrock
                - --host
                # force health check against IPv4 port
                - 127.0.0.1
            initialDelaySeconds: 30
          livenessProbe: *probe
          tty: true
          stdin: true
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
  name: bds
spec:
  selector:
    app: bds
  ports:
    - port: 19132
      protocol: UDP
  ipFamily: IPv4
  # Use LoadBalancer if running on a provider that supports that
#  type: LoadBalancer
  # or use NodePort on a non-managed system;
  # however, you'll need to lookup port assigned to the service
  type: NodePort