To write a custom add-on, you should create a directory and in it create at least one text file with the extension .addon, for example admin-role.addon.
This file needs to contain the Name and Description metadata fields, as well as the commands that you want to execute as a part of the add-on.
The following example shows the definition of an add-on that gives the developer user cluster-admin privileges.
Example: Add-on definition for admin-role
# Name: admin-role
# Description: Gives the developer user cluster-admin privileges
oc adm policy add-role-to-user cluster-admin developer
After you define the add-on, you can install it by running:
$ minishift addons install <ADDON_DIR_PATH>
|
You can also write metadata with multiple lines.
|
|
You can also edit your add-on directly in the Minishift add-on install directory $MINISHIFT_HOME/addons.
Be aware that if there is an error in the add-on, it will not show when you run any addons commands, and it will not be applied during the minishift start process.
|
To provide add-on remove instructions, you can create text file with the extension .addon.remove, for example admin-user.addon.remove.
Similar to the .addon file, it needs the Name and Description metadata fields.
If a .addon.remove file exists, it can be applied via the remove
command.