Giter VIP home page Giter VIP logo

mineflayer-k8s's Introduction

mineflayer-k8s

Docker Docker Pulls Docker Image Size (tag) Discord Try it on gitpod

A Mineflayer example bot runnable as a baremetal process, as a Docker container or as a Kubernetes Deployment.

deploy a mineflayer-k8s


multi mineflayer-k8s


Detect toxic players using TensorflowJS

toxic

If you're lucky mineflayer-k8s(s) are running on 91.121.67.56:30018 Minecraft server running in a Kubernetes cluster running on a Raspberry PI.

Viewer

You can interactively see what your bot is doing using prismarine-viewer in the web.
See example here You can disable this feature easily by adding viewer to the disabled plugins (or any plugins in the plugins directory) in the configuration:

"disabledPlugins": ["viewer"]

viewer

Node dependencies

Usage

If you want to use Kubernetes and know it plus Helm, just jump directly to the values.

louis@louis-pc:~/Documents/mineflayer-k8s$ make help
usage: make [target] ...

Variables:
TAG: Docker tag, default "TAG ?= 0.1.4"
CONFIG: path to application config file, default "CONFIG ?= setting.json"
SERVER_CONFIG: path to minecraft server config file, default "SERVER_CONFIG ?= server-values.yaml"

Targets:
help                   Display this help
build_push             Build and push on DockerHub multiarch Docker image (need Docker buildx)
deploy                 Deploy as a baremetal process
deploy_docker          Deploy as a Docker container
deploy_k8s             Deploy as a Kubernetes Deployment
deploy_k8s_server      Deploy a github.comitzg/minecraft-server-charts on Kubernetes

Run as nodejs process

Dependencies

Default settings

Using default settings

make deploy

With custom settings

CONFIG=./setting.json make deploy

Run as Docker container

Dependencies

  • make
  • docker
  • Supported OS/ARCH see tags, I personally run this on my Raspberry PI 4B

Default settings

Using default settings

make deploy_docker

With custom settings

CONFIG=./setting.json make deploy_docker

Run as Kubernetes Deployment

Dependencies

Default settings

Using default settings

make deploy_k8s

With custom settings

RELEASE=mt1 CONFIG=./setting.json make deploy_k8s

Example Helm output

helm install mk helm -f helm/values-dev.yaml --dry-run --debug

NOTES: mk connecting as foo to 109.210.246.114:30018, server running >version 1.16.4

  1. Get logs kubectl logs -f -l app.kubernetes.io/instance=mk
  2. Watch your bot playing in the web using prismarine-viewer at 109.210.246.114:30019

Deploy a externally accessible Minecraft server on your k8s cluster

  1. Port-forward [port between 30000 and 31000 (k8s allowed)] TCP, Kubernetes API (6443) TCP

  2. Assign a static IP

  3. Use similar config for make deploy_k8s_server:

    minecraftServer:
      eula: true
      version: "1.16.4"
      serviceType: LoadBalancer
      loadBalancerIP: <curl ifconfig.me on your k8s host>
      externalIPs:
        - <curl ifconfig.me on your k8s host>
      nodePort: <my port forwarded port>

Troubleshoot

  • Could not resolve host: launchermeta.mojang.com - see issue

    kubectl edit deployment/minecraft-server-minecraft
    dnsPolicy: "None"
    dnsConfig:
      nameservers:
        - 8.8.8.8

mineflayer-k8s's People

Contributors

louis030195 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mineflayer-k8s's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.