All Projects → costela → docker-volume-hetzner

costela / docker-volume-hetzner

Licence: MIT license
Docker Volume Plugin for accessing Hetzner Cloud Volumes

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-volume-hetzner

hcloud-rust
Unofficial Rust crate for accessing the Hetzner Cloud API
Stars: ✭ 22 (-72.84%)
Mutual labels:  hetzner, hetzner-cloud
docker-swarm-vagrant
Getting started with Docker swarm
Stars: ✭ 20 (-75.31%)
Mutual labels:  cluster, docker-swarm
hetzner-k3s
A Ruby gem (and Docker image) to install and manage Kubernetes clusters in Hetzner Cloud using the lightweight distribution k3s by Rancher.
Stars: ✭ 201 (+148.15%)
Mutual labels:  hetzner, hetzner-cloud
molecule-hetznercloud
Molecule Hetzner Cloud driver 💀
Stars: ✭ 21 (-74.07%)
Mutual labels:  hetzner, hetzner-cloud
hcloud-ruby
Native ruby client for HetznerCloud
Stars: ✭ 29 (-64.2%)
Mutual labels:  hetzner, hetzner-cloud
minectl
minectl 🗺 is a cli for creating Minecraft server on different cloud provider.
Stars: ✭ 85 (+4.94%)
Mutual labels:  hetzner, hetzner-cloud
clusterplex
ClusterPlex is basically an extended version of Plex, which supports distributed Workers across a cluster to handle transcoding requests.
Stars: ✭ 123 (+51.85%)
Mutual labels:  cluster, docker-swarm
ui-driver-hetzner
Rancher UI driver for the Hetzner Cloud docker driver.
Stars: ✭ 238 (+193.83%)
Mutual labels:  hetzner, hetzner-cloud
Guide
Kubernetes clusters for the hobbyist.
Stars: ✭ 5,150 (+6258.02%)
Mutual labels:  cluster, hetzner-cloud
Jaas
Run jobs (tasks/one-shot containers) with Docker
Stars: ✭ 291 (+259.26%)
Mutual labels:  cluster, docker-swarm
hetzner-rescaler
Lightweight CLI tool to programmatically rescale your Hetzner virtual server daily to optimize your budget spending
Stars: ✭ 44 (-45.68%)
Mutual labels:  hetzner, hetzner-cloud
Miniswarm
Docker Swarm cluster in one command
Stars: ✭ 130 (+60.49%)
Mutual labels:  cluster, docker-swarm
packer-builder-hcloud
Packer builder plugin for Hetzner Cloud - https://hetzner.cloud
Stars: ✭ 24 (-70.37%)
Mutual labels:  hetzner, hetzner-cloud
hcloud-pricing-exporter
A prometheus exporter for the current pricing and costs of your HCloud account
Stars: ✭ 19 (-76.54%)
Mutual labels:  hetzner, hetzner-cloud
hetzner.hcloud
A collection containing modules to manage resources on the Hetzner Cloud.
Stars: ✭ 58 (-28.4%)
Mutual labels:  hetzner, hetzner-cloud
hivemq4-docker-images
Official Docker Images for the Enterprise MQTT Broker HiveMQ
Stars: ✭ 18 (-77.78%)
Mutual labels:  cluster, docker-swarm
aws docker swarm
setup to bootstrap docker swarm cluster and a controller on AWS using terraform
Stars: ✭ 24 (-70.37%)
Mutual labels:  cluster, docker-swarm
Docker Swarm
🐳🐳🐳 This repository is part of a blog series on Docker Swarm example using VirtualBox, OVH Openstack, Azure and Amazon Web Services AWS
Stars: ✭ 43 (-46.91%)
Mutual labels:  cluster, docker-swarm
wireguard-setup
WireGuard and Unbound setup with Packer and Terraform.
Stars: ✭ 55 (-32.1%)
Mutual labels:  hetzner, hetzner-cloud
node-codis
Codis client for Node.js.
Stars: ✭ 18 (-77.78%)
Mutual labels:  cluster

Go Report Card tests Docker Hub Version

Docker Volume Plugin for Hetzner Cloud

This plugin manages docker volumes using Hetzner Cloud's volumes.

This plugin is still in ALPHA; use at your own risk

Installation

To install the plugin, run the following command:

$ docker plugin install --alias hetzner costela/docker-volume-hetzner

When using Docker Swarm, this should be done on all nodes in the cluster.

Important: the plugin expects the Docker node's hostname to match with the name of the server created on Hetzner Cloud. This should usually be the case, unless explicitly changed.

Plugin privileges

During installation, you will be prompted to accept the plugins's privilege requirements. The following are required:

  • network: used for communicating with the Hetzner Cloud API
  • mount[/dev/]: needed for accessing the Hetzner Cloud Volumes (made available to the host as a SCSI device)
  • allow-all-devices: actually enable access to the volume devices mentioned above (since the devices cannot be known a priori)
  • capabilities[CAP_SYS_ADMIN,CAP_CHOWN]: needed for running mount and chown

Usage

First, create an API key from the Hetzner Cloud console and save it temporarily.

Install the plugin as described above. Then, set the API key in the plugin options, where <apikey> is the key you just created:

$ docker plugin disable hetzner
$ docker plugin set hetzner apikey=<apikey>
$ docker plugin enable hetzner

Again, when using Docker Swarm, this should be done on all nodes in the cluster.

The plugin is then ready to be used, e.g. in a docker-compose file, by setting the driver option on the docker volume definition (assuming the alias hetzner passed during installation above).

For example, when using the following docker-compose volume definition in a project called foo:

volumes:
  somevolume:
    driver: hetzner

This will initialize a Hetzner volume named docker-foo_somevolume (see the prefix configuration below).

If the volume docker-foo_somevolume does not exist in the Hetzner Cloud project, the plugin will do the following:

  1. Create the Hetzner Cloud (HC) volume
  2. Attach the created HC volume to the node requesting the creation (when using docker swarm, this will be the manager node being used)
  3. Format the HC volume (using fstype option; see below)
  4. chown the volume to the appropriate uid/gid if specified.

The plugin will then mount the volume on the node running its parent service, if any.

Configuration

The following options can be passed to the plugin via docker plugin set (all names case-sensitive):

  • apikey (required): authentication token to use when accessing the Hetzner Cloud API
  • size (optional): size of the volume in GB (default: 10)
  • fstype (optional): filesystem type to be created on new volumes. Currently supported values are ext{2,3,4} and xfs (default: ext4)
  • prefix (optional): prefix to use when naming created volumes; the final name on the HC side will be of the form prefix-name, where name is the volume name assigned by docker (default: docker)
  • loglevel (optional): the amount of information that will be output by the plugin. Accepts any value supported by logrus (i.e.: fatal, error, warn, info and debug; default: warn)
  • use_protection (optional): whether to enable/disable deletion protection on creation/deletion. Disable this if you want to manage deletion protection yourself. (default: true)
  • uid (optional): which user id to use by default as owners for the filesystem of newly created volumes
  • gid (optional): which group id to use by default as owners for the filesystem of newly created volumes

Additionally, size, fstype, uid and gid can also be passed as options to the driver via driver_opts:

volumes:
  somevolume:
    driver: hetzner
    driver_opts:
      size: '42'
      fstype: xfs
      uid: '999'
      gid: '999'

⚠️ Passing any option besides size, fstype, uid and gid to the volume definition will have no effect beyond a warning in the logs. Use docker plugin set instead.

Limitations

  • Concurrent use: Hetzner Cloud volumes currently cannot be attached to multiple nodes, so the same limitation applies to the docker volumes using them. This also precludes concurrent use by multiple containers on the same node, since there is currently no way to enforce docker swarm services to be managed together (cf. kubernetes pods).
  • Single location: since volumes are currently bound to the location they were created in, this plugin will not be able to reattach a volume if you have a swarm cluster across locations and its service migrates over the location boundary.
  • Volume resizing: docker has no support for updating volume definitions. After a volume is created, its size option is currently ignored. This may be worked around in a future release.
  • Docker partitions: when used in a docker swarm setup, there is a chance a network hiccup between docker nodes might be seen as a node down, in which case the scheduler will start the container on a different node and will "steal" its volume while in use, potentially causing data loss.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].