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
    16
    ·
    23 hours 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.

        • mnemonicmonkeys@sh.itjust.worksOP
          link
          fedilink
          English
          arrow-up
          3
          arrow-down
          20
          ·
          edit-2
          9 hours ago

          Read the rest of my post, asshole. I was asking about server cluster software.

          This type of pointless snark is something I’d expect from hexbear, not blahaj

          • papertowels@mander.xyz
            link
            fedilink
            English
            arrow-up
            5
            arrow-down
            1
            ·
            edit-2
            8 hours ago

            Read the rest of my post, asshole.

            This type of pointless snark

            Pot calling the kettle black here. Chill out, they were trying to help.

            You wrote a post with a title that their comment helps with, no need to be a jerk, and maybe consider more specific titles that capture your actual ask.

            It’s currently akin to a post titled “how do I invest in a 401k?” And having the actual ask be the logistics of logging into vanguard.

            • mnemonicmonkeys@sh.itjust.worksOP
              link
              fedilink
              English
              arrow-up
              1
              arrow-down
              3
              ·
              5 hours ago

              You wrote a post with a title that their comment helps with,

              Post titles just aren’t great at detailing the real issue when you need to provide context. It’s frustrating whem someone doesn’t actually read the body of the post, because then the comments can be filled up with people answering the wrong question. Then someone that can actually answer the question might skip the post because there’s already a bunch of comments under it.

              If you’re going to help, it’s better to actually read through the provided context. Otherwise it’s more likely to just end up being self-gratification.

              It’s kinda like the people who give up right-of-way at stop signs. Sure, it makes that person feel better about themselves, but the confusion just leads to everyone at the stop taking longer to get through the intersection.

  • passenger@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 day 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.

    • mnemonicmonkeys@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 hours 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

  • Kairos@lemmy.today
    link
    fedilink
    English
    arrow-up
    12
    ·
    1 day ago

    Chat server is easy: Matrix (actually multiple servers but same effect)

    Game server is very hard. The game has to be made for it or you have to be very good at network application engineering to hack it in.

    • mnemonicmonkeys@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 day ago

      The game has to be made for it

      Just for clarity, do you mean the game has to be made for self-hosted servers, or do you mean it has to be made to handle self-hosted servers across a cluster?

      The former is already a thing with Minecraft, 7 Days to Die, etc. The latter… Yeah I’d have to do digging on that

      • Kairos@lemmy.today
        link
        fedilink
        English
        arrow-up
        5
        ·
        23 hours ago

        Actually I can provide a little more detail. Check out how Matrix handles event graph resolution/desync. It’s why messages sometimes come in out of order. This is a fundamental problem with decentralization: authority breakdown. The homesever in Matrix is considered the authority for the clients, but within the Federation itself there is no true authoritative party or event history. If a server goes off federation for a while, a room will split, and once it re-federates it and other servers will have different event graphs, assuming something happened in those rooms in the meantime for both the defederated server and federated server(s).

        Basically: videogames assume that within a certain amount of latency the server’s state is permanent and authoritative. Federation breakdowns even for 500ms can destroy a games running state.

        • mnemonicmonkeys@sh.itjust.worksOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          5 hours ago

          Thank you for the detailed explanation

          It sounds like my friends and I are better off just having 1 primary server running everything, and pushing backups to 1 or 2 other servers that can be spun up if/when things go wrong with the primary server.

      • Kairos@lemmy.today
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 day ago

        The game has to be made for distributed servers. The game software expects that everything the server says is authorative, including for rollback. Multiple servers introduces an extra source of latency and it’s just so hard to deal with.

        I don’t know too much about this.

  • monkeyman512@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    1 day 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
      1
      ·
      5 hours 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

  • hendrik@palaver.p3x.de
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    1 day ago

    I’d rent one (small) VPS for $10 a month and split the bill. As far as I know that’s how most people do it. It’s going to have >99.6% uptime, a fast datacenter internet connection at some central location and runs on enterprise hardware… The Kubernetes approach adds a lot of complexity, you’ll have your games disconnect anyway once it fails over as you can’t migrate the IP addresses. And there will be some additional traffic between the locations to keep everything in sync. And 4x chance of some of the hardware failing and someone needs to fix it. Unless I’m mistaken about how Kubernetes works.

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

      I’d rent one (small) VPS for $10 a month and split the bill.

      We don’t want to pay for a VPS. We’ve been burned by that too often in the past were you go months paying for a minecraft server that noone is using after the first month

      • hendrik@palaver.p3x.de
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        1 day ago

        Fair enough. I mean I’d pay about 200€ a year in electricity to run 3 efficient computers. And my VPS is only 73€ and I never have to pay for replacement parts (SSDs, harddisks) which I had to replace at home. And then they have gigabit network, low latency, a proper IP address, it didn’t fail yet so their reliability >99.6% seems to be correct. And that’s all way better than what I have at home. So it’s a no-brainer to go for that. But your calculation might be different.

        I mean ultimately there is no harm in trying. If you have 3 old computers laying around, you might as well try setting up a kubernetes cluster. I think it’s going to prove difficult to handle the IP addresses but I’m not an expert on high availability and gaming clients.

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

      And 4x chance of some of the hardware failing and someone needs to fix it. Unless I’m mistaken about how Kubernetes works.

      I’m pretty sure half the point of kubernetes is to have the server automatically reroute traffic when one node goes down

      • NowThatsWhatICallDadRock@slrpnk.net
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 day ago

        That would be a load balancer but is not integral to the working of kubernetes. I wouldn’t consider kubernetes unless you have a need for autoscaling. It’s a lot of overhead for such a limited use case.

        You can front any three un-clustered nodes with a load balancer to the same effect

        • mnemonicmonkeys@sh.itjust.worksOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          5 hours ago

          You can front any three un-clustered nodes with a load balancer to the same effect

          Good to hear. Are there specific example you could point me to? I’d like to learn more

          • NowThatsWhatICallDadRock@slrpnk.net
            link
            fedilink
            English
            arrow-up
            2
            ·
            edit-2
            4 hours ago

            https://www.cloudflare.com/learning/performance/what-is-load-balancing/

            https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/

            I would start here. Most off the shelf proxies can do it. Once set up you’ll just have your friends connect to the load balancer either via IP or dns hostname. For anything behind a residential connection I would recommend either tunneling out or setting up ddns (dynamic dns) as the IPs can change every few days. Take a look at load balancing strategies as well

            For the game server you’ll probably want failover instead, which most proxies can also provide. This is because a load balancer could route everyone to different instances. I would set up save syncs between the three nodes so that if your primary instance becomes unhealthy you can simply reconnect to the same address and the proxy will route you to the secondary node. Obviously requires healthchecks. When the primary node becomes healthy again new connections will be initiated there.

            Both of these introduce latency because you are adding a network hop though. You could also look into dns failover (direct to each node) to avoid this

      • hendrik@palaver.p3x.de
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        1 day ago

        But doesn’t that require some software-defined networking or a special network setup? I’m pretty sure with the average home internet connection, you’ll fail over to the replica at your friend’s home. But that has an entirely different IP address and the game client will not handle that gracefully. It’s going to disconnect. And you need to do some DNS as well to always point at the active server and forbid caching. In a datacenter or enterprise setting, sure. you’ll just reroute the traffic and nobody will notice.

  • renegadespork@lemmy.jelliefrontier.net
    link
    fedilink
    English
    arrow-up
    2
    ·
    24 hours ago

    If avoiding downtime is your number one priority and you’re willing to take on a lot of complexity to achieve it, then Kubernetes is probably the way to go. There are various chat platforms that can be distributed, but keeping a game server state synced between nodes isn’t an easy task. There’s a reason most multiplayer games are instanced.

    I do find it a little odd that you’re so concerned about uptime with a casual gaming server, but to each their own.

    • mnemonicmonkeys@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 hours ago

      I do find it a little odd that you’re so concerned about uptime with a casual gaming server, but to each their own.

      Personally, part of it is that I don’t want everything to be solely dependent on a box I own. I don’t like the idea of lording a petty fiefdom over my friends. If there’s multiple distributed boxes that are technically equal, then there’s less potential for interpersonal friction.

      Also, while I have the more powerful server, I also have very little free time. If my box stops working for whatever reason, I don’t want my friends to have to wait 1-2 weeks for me to fix it

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 day 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.

  • oddlyqueer@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 day 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
      ·
      5 hours 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
        ·
        3 hours 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.

  • rozodru@piefed.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 day ago

    should be find depending on the chat server.

    I mean hell we used to do this way back in the day with IRC and Quake servers. it’s not hard at all and you don’t need to over think it. I mean it’s not like the thing is going to crash often so I’m not sure why you want to spread it out. I generally reboot my server like once a month and it takes all of 5min.

    Depending on the game and the type of chat server you’re looking to run I don’t think you need to over think it. Just start out with like a VPS, see how it goes, maybe switch it up to a dedicated. neither are expensive.

  • Brkdncr@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 day 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.