Simple kubernetes storage solution using Minio
Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
.dockerignore
.gitignore
.travis.yml
Dockerfile.mc-arm
Dockerfile.mc-arm64
Dockerfile.minio-arm
Dockerfile.minio-arm64
Dockerfile.volumizr-amd64
Dockerfile.volumizr-arm
Dockerfile.volumizr-arm64
README.md
build.sh
config-mc.json
config-minio.json
manifest-mc.yml
manifest-minio.yml
manifest-volumizr.yml
minio-k8s-storage.png
minio.yml
mysql-example.yml
volumizr.sh

README.md

volumizr

Build Status

This is a simple (simplistic or poor but not necessarily bad) solution for solving storage in a Kubernetes cluster. The solution uses emptyDir volumes in StatefulSet and init-containers for setting up volumes before start by mirroring from a Minio server, and after start continuously mirrors changes back.

Minio storage for your Kubernets cluster

Usage

Mirror in

Docker:

$ docker run --rm -it -v $PWD/config.json:/app/config/config.json -v $PWD/mydata:/app/target thenatureofsoftware/volumizr in minio/bucket1 /app/target

Init container in Kubernetes:

annotations:
  pod.beta.kubernetes.io/init-containers:
    '[{
    "name": "volumizr-in",
    "image": "thenatureofsoftware/volumizr:latest",
    "args": ["in", "minio/mysql", "/var/lib/mysql"],
    "volumeMounts": [{
      "mountPath": "/var/lib/mysql",
      "name": "persistentdata"
    }]
  }]

Mirror out

For continuously mirror changes back to minio server.

Docker:

$ docker run --rm -it -v $PWD/config.json:/app/config/config.json -v $PWD/mydata:/app/source thenatureofsoftware/volumizr out /app/source minio/bucket1

As a sidecar container in Kubernetes:

...
- image: thenatureofsoftware/volumizr:latest
  imagePullPolicy: Always
  name: volumizr-out
  args:
  - out
  - /var/lib/mysql
  - minio/mysql
  volumeMounts:
  - mountPath: "/var/lib/mysql"
    name: persistentdata
...