{"id":23009102,"url":"https://github.com/belgaied2/docker-machine-driver-harvester","last_synced_at":"2025-04-02T16:12:43.670Z","repository":{"id":57566457,"uuid":"336197029","full_name":"belgaied2/docker-machine-driver-harvester","owner":"belgaied2","description":"A simple docker-machine driver for Harvester to use with Rancher Node Driver","archived":false,"fork":false,"pushed_at":"2021-04-06T17:32:11.000Z","size":42,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T06:43:12.263Z","etag":null,"topics":["docker-machine-driver","kubevirt"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/belgaied2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-05T07:29:16.000Z","updated_at":"2021-03-04T21:52:30.000Z","dependencies_parsed_at":"2022-08-27T19:02:01.334Z","dependency_job_id":null,"html_url":"https://github.com/belgaied2/docker-machine-driver-harvester","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belgaied2%2Fdocker-machine-driver-harvester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belgaied2%2Fdocker-machine-driver-harvester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belgaied2%2Fdocker-machine-driver-harvester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belgaied2%2Fdocker-machine-driver-harvester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/belgaied2","download_url":"https://codeload.github.com/belgaied2/docker-machine-driver-harvester/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246847138,"owners_count":20843444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-machine-driver","kubevirt"],"created_at":"2024-12-15T09:12:35.077Z","updated_at":"2025-04-02T16:12:43.654Z","avatar_url":"https://github.com/belgaied2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Harvester Driver for Docker Machine\n\nThis repository is a Harvester Driver for Docker Machine. It uses the Kubernetes API underlying Harvester (since Harvester does not yet an official API) in order manage VM lifecycle.\n\nThe Create() operation will create an Object VirtualMachine with some labels for Harvester.\n\nAt the moment, integration with Docker is not perfect. Using `docker-machine create -d harvester` is run, a VM is successfully created in Harvester, and it is visible using `docker-machine ls`. However, some lifecycle steps are still buggy.\n\nAlso, since my knowledge in Harvester and the bridge network is lacking, I implemented NodePort services to connect to the VM from docker-machine.\n\n## Warning\nThis repo is not yet well documented and not fully functional, it is designed to be a POC for the Node Driver feature for Harvester in Rancher.\n\n## Installation\nIn order to use this [Docker Machine](https://docs.docker.com/machine/install-machine/#install-docker-machine) plugin, you need to have `docker-machine` already installed.\n\nYou can then download the binary for the Harvester Driver from the [Releases page](https://github.com/belgaied2/docker-machine-driver-harvester/releases). This binarz file `docker-machine-driver-harvester` needs to be placed in your `$PATH` for instance `/usr/local/bin/`.\nNow, the file needs to be executable\n```\nsudo chmod +x /usr/local/bin/docker-machine-driver-harvester\n```\nCheck the installation by running and understand how to create VMs in Harvester using `docker-machine`:\n```\ndocker-machine create -d harvester --help\n\nUsage: docker-machine create [OPTIONS] [arg...]\n\nCreate a machine\n\nDescription:\n   Run 'docker-machine create --driver name --help' to include the create flags for that driver in the help text.\n\nOptions:\n\n   --ca-cert \u003cBASE64_CACERT\u003e\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t                Trust CA for the Harvester URL [$HARVESTER_CA_CERT]\n   --cert \u003cBASE64_CERT\u003e\t                                                                                                                                                                        Client Certificate to authenticate user with Harvester's KubeAPI Server [$HARVESTER_CERT]\n   --cpus \"1\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDesired number of CPU cores of the VM [$HARVESTER_VM_CPUS]\n   --disk-size \"10Gi\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDesired Size of Main Disk of the VM [$HARVESTER_VM_DISK_SIZE]\n   --driver, -d \"virtualbox\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDriver to create machine with. [$MACHINE_DRIVER]\n   --engine-env [--engine-env option --engine-env option]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSpecify environment variables to set in the engine\n   --engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option]\t\t\t\t\t\t\t\t\t\t\t\tSpecify insecure registries to allow with the created engine\n   --engine-install-url \"https://get.docker.com\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCustom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL]\n   --engine-label [--engine-label option --engine-label option]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSpecify labels for the created engine\n   --engine-opt [--engine-opt option --engine-opt option]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSpecify arbitrary flags to include with the created engine in the form flag=value\n   --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option]\t\t\t\t\t\t\t\t\t\t\t\t\tSpecify registry mirrors to use [$ENGINE_REGISTRY_MIRROR]\n   --engine-storage-driver \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSpecify a storage driver to use with the engine\n   --harvester-url \"https://192.168.0.1:6443\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tURL to Access Harvester's underlying Kubernetes API [$HARVESTER_URL]\n   --image-id \"image-fjh7c\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tImage ID on which VM will be based [$HARVESTER_VM_IMAGE_ID]\n   --key \u003cBASE64_KEY\u003e\t\t\t\t\t\t\t\t\t                                                                                                        Client Key to authenticate user with Harvester's KubeAPI Server [$HARVESTER_KEY]\n   --keypair \"macos\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSSH KeyPair name (in Harvester's UI) to use to connect to VM [$HARVESTER_SSH_KEYNAME]\n   --mem-size \"2Gi\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDesired Memory of the VM [$HARVESTER_VM_MEM_SIZE]\n   --namespace \"default\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKubernetes Namespace in which to create VM [$HARVESTER_VM_NAMESPACE]\n   --ssh-key-path \"~/.ssh/id_rsa\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t        Path of the SSH Private Key to be used to connect to VMs [$HARVESTER_SSH_KEY_PATH]\n   --ssh-user \"ubuntu\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSSH user with Harvester's KubeAPI Server [$HARVESTER_SSH_USER]\n   --swarm\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tConfigure Machine to join a Swarm cluster\n   --swarm-addr \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taddr to advertise for Swarm (default: detect and use the machine IP)\n   --swarm-discovery \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDiscovery service to use with Swarm\n   --swarm-experimental\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEnable Swarm experimental features\n   --swarm-host \"tcp://0.0.0.0:3376\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tip/socket to listen on for Swarm master\n   --swarm-image \"swarm:latest\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSpecify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE]\n   --swarm-join-opt [--swarm-join-opt option --swarm-join-opt option]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDefine arbitrary flags for Swarm join\n   --swarm-master\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tConfigure Machine to be a Swarm master\n   --swarm-opt [--swarm-opt option --swarm-opt option]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDefine arbitrary flags for Swarm master\n   --swarm-strategy \"spread\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDefine a default scheduling strategy for Swarm\n   --tls-san [--tls-san option --tls-san option]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSupport extra SANs for TLS certs, important if using the Pod Network\n   --vm-description \"Test VM in Harvester\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDescription of the Virtual Machine in Harvester [$HARVESTER_VIRTUAL_MACHINE_DESCRIPTION]\n   --vm-name \"ubuntu-test\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t        Desired Virtual Machine Name in Harvester [$HARVESTER_VIRTUAL_MACHINE_NAME]\n```\n\n## Parameters\nThe Harvester Driver for Docker Machine needs a number of parameters for creating a VM. These are summarized in the following table:\n| Name      | Description | Environment variable | Optional|\n|---      |---|---|---|\n| vm-name     | Desired Virtual Machine Name in Harvester | HARVESTER_VIRTUAL_MACHINE_NAME ||\n|namespace    | Kubernetes Namespace in which to create VM|HARVESTER_VM_NAMESPACE| X |\n|vm-description    | Description of the Virtual Machine in Harvester|HARVESTER_VIRTUAL_MACHINE_DESCRIPTION| |\n|ssh-user     | SSH user with Harvester's KubeAPI Server|HARVESTER_SSH_USER| |\n|ssh-key-path     | Path of the SSH Private Key to be used to connect to VMs|HARVESTER_SSH_KEY_PATH| |\n|keypair    | SSH KeyPair name to use to connect to VM|HARVESTER_SSH_KEYNAME| |\n|image-id   | Image ID on which VM will be based|HARVESTER_VM_IMAGE_ID| |\n|disk-size    | Desired Size of Main Disk of the VM|HARVESTER_VM_DISK_SIZE| |\n|mem-size   | Desired Memory of the VM|HARVESTER_VM_MEM_SIZE| |\n| cpus    | Desired number of CPU cores of the VM|HARVESTER_VM_CPUS| X |\n|harvester-url    | URL to Access Harvester|HARVESTER_URL| |\n|  ca-cert    | Base64 Encoded Trust CA for the Harvester URL|HARVESTER_CA_CERT| |\n|  cert   | Base64 Encoded Client Certificate to authenticate user with Harvester's KubeAPI Server|HARVESTER_CERT| |\n|  key    | Base64 Encoded Client Key to authenticate user with Harvester's KubeAPI Server|HARVESTER_KEY| |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelgaied2%2Fdocker-machine-driver-harvester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelgaied2%2Fdocker-machine-driver-harvester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelgaied2%2Fdocker-machine-driver-harvester/lists"}