I’ve been kicking around the idea of running a server for games and chat woth some of my friends, but worry about everyone getting cut off when there’s a disruption.

I’ve started looking into kubernetes out of curiosity, and it seems like we could potentially set up a cluster with master nodes at 3+ locations to hose whatever game server or chat server that we want with 100% uptime, solving my concerns.

Am I misunderstanding the kubernetes documentation, and this is just a terrible idea? Or am I on the right track?

  • msage@programming.dev
    link
    fedilink
    English
    arrow-up
    14
    ·
    2 months ago

    Not seeing LGSM, so dropping it here: https://linuxgsm.com/

    I have a Matrix server with Jitsi installed, works for gaming and everything else.

    Also, some older games (like Warcraft 3) require L2 connections to play multiplayer, which I managed to get working with OpenVPN, for both Linux and Windows players.

  • passenger@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    9
    ·
    2 months ago

    Kubernetes is too much. You could set up a matrix server for chat with jitsi for video meetings. Use element as client. Then add your game server(s).

    For matrix/jitsi server setup use this playbook https://github.com/spantaleev/matrix-docker-ansible-deploy

    It installs all you need for video, audio, and text chat.

    Maybe change the config to be unfederated if you want a private server.

    100% uptime is really not feasible so forget that. Even the commercial servers have downtimes.

    • pory@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      If I run this stuff, what do my clients / less techy friends need to install to get a Discord-like experience for screenshare/IM?

      • passenger@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        2 months ago

        A browser. Element web client and jitsi client are included as browser clients. They could install element if they want a client software that automatically starts and is dedicated

        • pory@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          2 months ago

          This would allow them to share their screen + system audio excluding Element’s own sound while playing a game, like Discord does? No extra hoops like installing OBS to function as a webcam? If it really is that easy, I’ll absolutely install this stack as soon as I can. But every time I’ve tried discord “alternatives”, there’s always either a whole series of steps you have to jump through to screenshare (and forget about screen sharing a single app instead of an entire monitor, and forget about sharing sound without causing the streamer to echo the viewer’s voice), or the screensharing has multi-second lag (no matter how good the client and server’s connection is - testing this was done on purely local setups on Ethernet).

          You’d think a direct peer to peer connection or “server” connection that’s… Functionally a peer would have less lag than the one that needs to phone home over the internet and perform downscaling on the feed to upsell Nitro, but that hasn’t been my experience.

          Is a domain name required for this, or can you replace all instances of “example.com” with an IP address and port combo?

          • passenger@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 months ago

            Try it out. You can try element and jitsi its free. Just test some matrix server with element web client and try out jitsi at their site.

            For the self hosted instance yes I think you need a domain and subdomains.

            • pory@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              ·
              2 months ago

              I don’t pay for a domain and don’t intend to start doing so. Using “someone else’s server” removes the only reason I’d want to use element/matrix/whatever else.

    • mnemonicmonkeys@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      2 months ago

      100% uptime is really not feasible so forget that. Even the commercial servers have downtimes.

      What I was thinking of doing was having 2-3 separate boxes distributed between houses and could automatically switch which boxes handles resources when 1 goes down. No individual box would have 100% uptime, but you’d have minimal disruptions when any particular box has issues or needs maintenance.

      Unfortunately, it doesn’t seem like kubernetes works that way, and I don’t know of any software that would. Best bet now is probably to distribute backups between the boxes and manually spin up a secondary box when the primary goes down

  • monkeyman512@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    2 months ago

    I think you are making it more complicated than needed. If you just want reliable service, just figure out who has the most reliable Internet and power and they can host the server. If you want to learn kubernets or docker swarm, you can try that but it will take a ton of upfront work.

    Edit: Also get a UPS for the server.

    • mnemonicmonkeys@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      2 months ago

      Going through some of the more detailed responses, yeah this is probably the best bet, and it’ll most likely be my server that’s the primary. I’ve got a Jellyfin server / NAS with an Intel 12700k, and I could either simply add a docker container or dedicate resources via Proxmox.

      Meanehile one of my friend is experimenting with an old $50 desktop with a 3rd gen i3. It’s… a decision, but he’s got more free time than I do

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 months ago

    I would argue k8s is overkill for this and the wrong tool for the job.

    Honestly I would never target 100% uptime. Ubisoft, Microsoft, Blizzard, EA, valve, Epic spend billions collectively on online services and still have unplanned outages.

    You can get a very cheap VPS from Heizner and you should run your game server there. You get proper cooling, networking, and support if something goes wrong.

  • Brkdncr@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    Assuming you were on the same lan you could probably set up chat with HA. A game server likely has a lot of change in memory and keeping that synced would be possible but it might not be cheap.

    Across a wan though is a different story and likely not reasonably possible.

  • oddlyqueer@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    I love this idea. As others have said, a distributed game server would be a really tall order, and AFAIK there’s not really anything already made that does what you’re describing. But you could have a setup where one server hosts the game and syncs the game state with the other servers in the network, and if one server fails the network decides which failover server to connect to, all the clients connect to that server and continue playing on the new host. But it would be a gargantuan task to implement something like that.

    • mnemonicmonkeys@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      2 months ago

      But you could have a setup where one server hosts the game and syncs the game state with the other servers in the network, and if one server fails the network decides which failover server to connect to, all the clients connect to that server and continue playing on the new host.

      This is kinda what I was hoping that kubernetes did. It’d be awesome if there was some software that automatically did the hand-off, but I haven’t heard of one either

      • oddlyqueer@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 months ago

        It does something similar, in that you can replicate servers and have one act as a failover for another, but I think you’d need a lot of extra code to sync the primary game host with the failover hosts, and more to make sure all the clients detect a failed host and all gracefully switch to the same failover host, and probably a hundred other things I’m not thinking of. If I were going to build something like this I probably would look to kubernetes as a foundation but there would be a lot of customization on top of that.