minikube relies on docker-machine drivers to manage machines. This document discusses how to modify minikube, so that this driver may be used by `minikube start --driver=<new_driver>`.
See https://github.com/machine-drivers, the fork where all new docker-machine drivers are located.
## Builtin vs External Drivers
Most drivers are built-in: they are included into minikube as a code dependency, so no further
installation is required. There are two primary cases you may want to use an external driver:
- The driver has a code dependency which minikube should not rely on due to platform incompatibilities (kvm2) or licensing
- The driver needs to run with elevated permissions (hyperkit)
External drivers are instantiated by executing a command `docker-machine-driver-<name>`, which begins an RPC server which minikube will talk to.
### Integrating a driver
The integration process is effectively 3 steps.
1. Create a driver shim within `k8s.io/minikube/pkg/minikube/drivers`
- Add Go build tag for the supported operating systems
- Define the driver metadata to register in `DriverDef`
2. Add import in `pkg/minikube/cluster/default_drivers.go` so that the driver may be included by the minikube build process.
### The driver shim
The primary duty of the driver shim is to register a VM driver with minikube, and translate minikube VM hardware configuration into a format that the driver understands.
### Registering your driver
The godoc of registry is available here: <https://godoc.org/k8s.io/minikube/pkg/minikube/registry>
[DriverDef](https://godoc.org/k8s.io/minikube/pkg/minikube/registry#DriverDef) is the main
struct to define a driver metadata. Essentially, you need to define 4 things at most, which is
pretty simple once you understand your driver well:
- Name: unique name of the driver, it will be used as the unique ID in registry and as