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, oc binaries and container images. minishift delete —clear-cache will for this reason affect all profiles. We recommend using —clear-cache with caution.

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:

  1. $ minishift --profile profile-demo start
  2. -- Checking if requested hypervisor 'xhyve' is supported on this platform ... OK
  3. -- Checking if xhyve driver is installed ...
  4. Driver is available at /usr/local/bin/docker-machine-driver-xhyve
  5. Checking for setuid bit ... OK
  6. -- Checking the ISO URL ... OK
  7. -- Starting local OpenShift cluster using 'xhyve' hypervisor ...
  8. -- Minishift VM will be configured with ...
  9. Memory: 2 GB
  10. vCPUs : 2
  11. Disk size: 20 GB
  12. ...

See also workflow for profile configuration.

A profile automatically becomes the active profile when a Minishift instance is started successfully via minishift start.

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:

  1. $ minishift profile set demo
  2. 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.

  1. $ minishift profile list
  2. - minishift Running (Active)
  3. - profile-demo Does Not Exist

Switching Profiles

To switch between profiles use the minishift profile set command:

  1. $ minishift profile set profile-demo
  2. Profile 'profile-demo' set as active profile

Only one profile can be active at any time.

Deleting Profiles

To delete a profile, run:

  1. $ minishift profile delete profile-demo
  2. You are deleting the active profile. It will remove the VM and all related artifacts. Do you want to continue [y/N]?: y
  3. Deleted: /Users/john/.minishift/profiles/profile-demo
  4. Profile 'profile-demo' deleted successfully
  5. 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:

  1. $ minishift profile set profile-demo
  2. $ minishift config set memory 8GB
  3. $ minishift config set cpus 4
  4. $ minishift addon enable anyuid
  5. $ minishift start

The alternative is to execute a series of commands each specifying the targeted profile explicitly using the --profile flag:

  1. $ minishift --profile profile-demo config set memory 8GB
  2. $ minishift --profile profile-demo config set cpus 4
  3. $ minishift --profile profile-demo addon enable anyuid
  4. $ minishift --profile profile-demo minishift start