It looks like creating own Minecraft server is a simple ride. But it’s not really true, if it should be secured and easy to manage. This article describes a way how to to it.

Create server

Create a Digitalocean account, if you don’t have yet: https://cloud.digitalocean.com/registrations/new . Digitalocean gives a 60-day credit for new accounts.

Create a new Docker Droplet by wizard on the Marketplace: https://cloud.digitalocean.com/droplets/new?onboarding_origin=marketplace&image=docker-20-04

  • VM option: at least 2 GB / 1 CPU ($10/mo), but Premium Intel is faster (+2$/mo)
  • Datacenter region: closest to you
  • Select additional options: Monitoring (free)
  • Create root password: …
  • Choose a hostname: minecraft (example)
  • Add…

There are several Kubernetes on-premise distributions. A part of them are lightweight, others use more VMs or physical nodes.

It’s hard to select the best free solution, so I created a make-based development environment on Ubuntu (and partly Windows) to compare them. See the install description here: https://github.com/pgillich/kind-on-dev

The base distribution is the kubeadm in VMs (created by Vagrant) as a production environment.

Other distributions are candidates for developer and CI environment. This distributions are container-based (not VM-based), in order to keep resource consumption low. The developer/CI environment should be similar to production environment as much as possible, in order…


Microsoft made an IoT Edge solution integrated to Azure ecosystem. The information, collected from the sensors by the Azure IoT Edge device, can be processed, stored, and provided by Azure cloud services (event and message processing, DB, AI + machine learning, analytics, etc.). Nice, but somebody must pay the bill for Microsoft services. There are several other IoT Edge solutions, but if the company fell in love with Microsoft, it must be used.

The Azure bill can be reduced if our solution makes the work out of the Azure as much as possible, especially on the IoT Edge device. Microsoft…


It’s easy to capture network traffic with a capture tool (for example: tcpdump) if we have access to the network interface. But it’s tricky in Kubernetes. There are several options, for example: sidecar container, capture plugin, docker container, direct access in same network namespace.

Animated visualization showing pod to service connectivity. source: https://techcommunity.microsoft.com/t5/networking-blog/troubleshooting-kubernetes-networking-on-windows-part-1/ba-p/508648

Managed Kubernetes providers hardened security configurations, so depending on our access possibilities and rights to the cluster, the below examples may work (if it’s possible to access the node OS, if container is enabled to run the container as root, etc.). …


Google published Kubernetes as open-source in 2014, except a milk cow: the external connectivity (load balancer, ingress, DNS, etc). Other K8s cloud providers follow this strategy, too. They use own solution because it’s a rational cost model for them and fits to their infrastructure. If a company would like to setup on-premise solution, it has to be solved with open-source solutions and/or with non-free, for example: Red Hat OpenShift.

Components

Depending on the expectations and requirements, below components may be used:

  • External Load Balancer for K8s Services (type: LoadBalancer), for example: MetalLB, Porter
  • Ingress Controller (reverse proxy, HTTP router), for example…


K3s is a lightweight Kubernetes distribution, which looks like easy to install for devops, but not for dummies. This article gives answers for questions: How to solve install error? How to configure ingress? How to use dashboards? How to force Docker? How to use already installed kubectl?

K3s uses a built-in containerd as the container runtime, by default. This default setup has more advantages:

  • Docker is not needed.
  • If Docker is installed, the K3s containers and Docker containers are running in separated environment and cannot influence each other

Below description forces to use Docker to give opportunity for Docker experts…


Golang has limited OO features, for example method declaration with struct receiver. This article presents a lesser-known method declaration: method declaration with function receiver.

Golang has limited OO features, for example method declaration with struct receiver. This article presents a lesser-known method declaration: method declaration with function receiver.

First, let’s see a simple HTTP server, which uses authorization:

package mainimport (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/create", AuthNeeded(handleCreate))
fmt.Println(http.ListenAndServe(":8000", nil))
}
func handleCreate(w http.ResponseWriter, req *http.Request) {
w.WriteHeader(201)
}

Where the authorization is handled by a decorator function:

func AuthNeeded(handler http.HandlerFunc) http.HandlerFunc {
return func(w…


Using native Go elements, it’s possible to achieve similar result to a printed out exception.

Go does not support throwing/catching exceptions, like Java and C++. There are a few language keywords (defer, recover) and error handling libraries (for example: https://github.com/pkg/errors), but it’s far from exception handling.

Using native Go elements, it’s possible to achieve similar result to a printed out exception: printing out the panic message and the stacktrace, without stopping the actual goroutine.

Let’s take a simple example code, which panics:

package mainimport (
"fmt"
"math/rand"
)
func PrintRandomDiv() {
fmt.Println(1 / rand.Intn(2))
}
func main() {…

Peter Gillich

Golang, microservices, Kubernetes. https://www.linkedin.com/in/petergillich/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store