Minishift Profiles
Overview
A profile is an instance of the Minishift VM along with all of its configuration and state. The profile feature allows you to create and manage these isolated instances of Minishift.
Each Minishift profile is created with its own configuration (memory, CPU, disk size, add-ons, and so on) and is independent of other profiles. Refer to the use of environment variables if you want to make sure that certain configuration settings, for example cpus
or memory
, get applied to all profiles.
The active profile is the profile against which all commands are executed, unless the global --profile
flag is used. You can determine the active profile by using the minishift profile list
command. You can execute single commands against a non-active profile by using the --profile
flag, for example minishift --profile profile-demo console
to open the OpenShift console for the specified profile-demo profile.
On top of the --profile
flag, there are commands for listing, deleting and setting the active profile. These commands are described in the following sections.
Even though profiles are independent of each other, they share the same cache for ISOs, |
Creating Profiles
There are two ways to create a new profile.
Profile name can only consist of alphanumeric characters. The use of hyphen ( - ) is allowed as separator. |
Using the --profile
Flag
When you run Minishift start
command with the --profile
flag the profile gets created if it does not exist, for example:
$ minishift --profile profile-demo start -- Checking if requested hypervisor 'xhyve' is supported on this platform ... OK -- Checking if xhyve driver is installed ... Driver is available at /usr/local/bin/docker-machine-driver-xhyve Checking for setuid bit ... OK -- Checking the ISO URL ... OK -- Starting local OpenShift cluster using 'xhyve' hypervisor ... -- Minishift VM will be configured with ... Memory: 2 GB vCPUs : 2 Disk size: 20 GB ...
See also workflow for profile configuration.
A profile automatically becomes the active profile when a Minishift instance is started successfully via |
Using the profile set
Command
The other option to create a profile is to use the profile set
command. If the specified profile does not exist, it is implicitly created:
$ minishift profile set demo Profile 'demo' set as active profile
The default profile is minishift. It will be present by default and it does not need to be created. |
Listing Profiles
You can list all existing profiles with the minishift profile list
command. You can also see the active profile highlighted in the output.
$ minishift profile list - minishift Running (Active) - profile-demo Does Not Exist
Switching Profiles
To switch between profiles use the minishift profile set
command:
$ minishift profile set profile-demo Profile 'profile-demo' set as active profile
Only one profile can be active at any time. |
Deleting Profiles
To delete a profile, run:
$ minishift profile delete profile-demo You are deleting the active profile. It will remove the VM and all related artifacts. Do you want to continue [y/N]?: y Deleted: /Users/john/.minishift/profiles/profile-demo Profile 'profile-demo' deleted successfully Switching to default profile 'minishift' as the active profile.
The default profile minishift cannot be deleted. |
Example Workflow for Profile Configuration
You have two options to create a new profile and configure its persistent configuration. The first option is to implicitly create the new profile by making it the active profile using the profile set
command. Once the profile is active you can run any minishift config
command. Lastly, start the instance:
$ minishift profile set profile-demo $ minishift config set memory 8GB $ minishift config set cpus 4 $ minishift addon enable anyuid $ minishift start
The alternative is to execute a series of commands each specifying the targeted profile explicitly using the --profile
flag:
$ minishift --profile profile-demo config set memory 8GB $ minishift --profile profile-demo config set cpus 4 $ minishift --profile profile-demo addon enable anyuid $ minishift --profile profile-demo minishift start