-
Notifications
You must be signed in to change notification settings - Fork 3
Networking
Bungee is a Minecraft server proxy that can let users connect to a multi server network though one connection.
The first things you need to do to configure bungee
is switch both of the game servers to offline mode.
In the minishift vm, Navigate to the smp and hub volume directories you created earlier.
/mnt/sda1/var/lib/minishift/openshift.local.volumes/pv/minecraft-server
Change the server.properties value of online-mode
to false
for both smp and hub.
After this you need to start a new deployment both applications.
Application -> Deployments -> (smp and hub) -> Deploy
In OpenShift every time a new pod is created it gets a new ip address. When configuring inter-pod communication you should use the domain name instead. For out services the internal domain names are:
App | Domain Name |
---|---|
bungee | bungee.minecraft-server.svc.cluster.local |
hub | hub.minecraft-server.svc.cluster.local |
smp | smp.minecraft-server.svc.cluster.local |
Using these we give the bungee proxy server targets
-
Go to a terminal and type
minishift ssh
thensudo -i
-
Navigate to the local bungee volume directory
cd /mnt/sda1/var/lib/minishift/openshift.local.volumes/pv/minecraft-server/bungee
-
Now edit the config.yml file
-
Replace these lines:
priorities:
- lobby
servers:
lobby:
motd: '&1Just another BungeeCord - Forced Host'
address: localhost:25565
restricted: false
- With these lines:
priorities:
- hub
servers:
hub:
motd: 'Welcome to the Hub Server!'
address: hub.minecraft-server.svc.cluster.local:25565
restricted: false
smp:
motd: 'Welcome to the SMP Server!'
address: smp.minecraft-server.svc.cluster.local:25565
restricted: false
After making these changes to the bungee configuration start a new deployment to apply these changes.
Application -> Deployments -> bungee -> Deploy
Now that you have configured bungee it is time to expose the service so that you can connect to it.
- Go to Applications -> Routes
- Click
Create Route
- Name The Route
bungee
and ensure thatbungee
is selected as the service
Make note of Hostname given as you will use this later to connect to the server.
Since our service is not HTTP based we need to create a NodePort Service to expose it so that we can connect.
The way we do this is by exposing it as the type LoadBalancer
in the oc command line.
oc expose dc bungee --type=LoadBalancer --name=bungee-ingress
Now see what port the server is exposed on.
oc get svc/bungee-ingress
the second port is the one you need to connect.
If you have access to a Minecraft java account you can now connect to the server
The connection info for the server is the Hostname that you noted earlier (excluding "http://") followed by the port from the node port service separated by a colon.