minishift / minishift-centos-iso

CentOS based ISO as an alternative for boot2docker ISO
GNU Lesser General Public License v3.0
40 stars 33 forks source link

Provide a way to configure minishift from a source code repository #252

Closed jorgemoralespou closed 6 years ago

jorgemoralespou commented 6 years ago

It'll be ideal if we can provide a way to have some minishift configuration along with an application source code so that a minishift profile can be easily configured.

This is the scenario I'm contemplating. When I work on an application I might configure a profile with specific addons, memory, images, etc to improve my productivity. I would like to save this configuration in a file/folder local to my source control system so that I can re-apply it at any time or that any other colleague working on this application can create a profile configured on the same way as I have.

Example of configuration I like to provide is:

Right now I have a file that I store under .minishift in my repository that has a script that sets the configuration to the active profile.

minishift config set cpus 4
minishift config set memory 8G
minishift config set image-caching true
minishift config set vm-driver virtualbox

minishift addon enable admin-user
minishift addon install addons/appA-deps --force --enable

minishift images cache-config add openshift/origin-docker-registry:v3.9.0
minishift images cache-config add openshift/origin-haproxy-router:v3.9.0
minishift images cache-config add openshift/origin:v3.9.0
minishift images cache-config add openshift/origin-pod:v3.9.0
minishift images cache-config add openshift/origin-deployer:v3.9.0
minishift images cache-config add openshift/origin-web-console:v3.9.0

I would like to define a .minishift folder with a config.json file and addons folder so that an easy command can import this configuration to my profile, or even create a new profile from this configuration.

e.g:

Create a new profile importing the confguration from my .minishift folder:

minishift profile set myappA --from=.

Import this configuration to my profile.

$ minishift profile import-from=.
Importing the configuration found in .minishift
No Minishift instance exists. New 'cpus' setting will be applied on next 'minishift start'
No Minishift instance exists. New 'memory' setting will be applied on next 'minishift start'
No Minishift instance exists. New 'vm-driver' setting will be applied on next 'minishift start'
Add-on 'admin-user' enabled
Addon 'appA-deps' installed
Add-on 'appA-deps' enabled

Maybe make the option interactive:

$ minishift profile import-from=.
Importing the configuration found in .minishift
Setting cpus to 4
Do you want to apply this setting? (y/n)
Setting memory to 8 GB.
Do you want to apply this setting? (y/n)
Setting vm-driver to virtualbox
Do you want to apply this setting? (y/n)
Adding add-on 'admin-user'
Do you want to apply this setting? (y/n)
Adding addon 'appA-deps'.
Do you want to apply this setting? (y/n)
Enabling add-on 'appA-deps'.
Do you want to apply this setting? (y/n)
gbraad commented 6 years ago

Wrong repo. Please discuss on ML and create an issue

On Fri, Jun 29, 2018, 23:24 Jorge Morales Pou notifications@github.com wrote:

Closed #252 https://github.com/minishift/minishift-centos-iso/issues/252 .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/minishift/minishift-centos-iso/issues/252#event-1708913720, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAHZgashiCH3UooCK_bwHlwK3o5Cu6Xks5uBkaagaJpZM4U9NBy .

jorgemoralespou commented 6 years ago

That's why I closed it. I had multiple tabs open and used the wrong one. There's an issue on the correct repo. Why a discussion on ML and not on GH?

El sáb., 30 jun. 2018 13:40, Gerard Braad notifications@github.com escribió:

Wrong repo. Please discuss on ML and create an issue

On Fri, Jun 29, 2018, 23:24 Jorge Morales Pou notifications@github.com wrote:

Closed #252 < https://github.com/minishift/minishift-centos-iso/issues/252> .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/minishift/minishift-centos-iso/issues/252#event-1708913720 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAAHZgashiCH3UooCK_bwHlwK3o5Cu6Xks5uBkaagaJpZM4U9NBy

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/minishift/minishift-centos-iso/issues/252#issuecomment-401535736, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEyDinFQD1seIPg14uXT-XGD66-UX8Wks5uB2OhgaJpZM4U9NBy .

gbraad commented 6 years ago

I think this is more general than just for Minishift. It is project metadata for setting up an environment. For minishift it means the vm configuration while for origin this could mean resource shares.

On Sat, Jun 30, 2018, 20:37 Jorge Morales Pou notifications@github.com wrote:

That's why I closed it. I had multiple tabs open and used the wrong one. There's an issue on the correct repo. Why a discussion on ML and not on GH?

El sáb., 30 jun. 2018 13:40, Gerard Braad notifications@github.com escribió:

Wrong repo. Please discuss on ML and create an issue

On Fri, Jun 29, 2018, 23:24 Jorge Morales Pou notifications@github.com wrote:

Closed #252 < https://github.com/minishift/minishift-centos-iso/issues/252> .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <

https://github.com/minishift/minishift-centos-iso/issues/252#event-1708913720

, or mute the thread <

https://github.com/notifications/unsubscribe-auth/AAAHZgashiCH3UooCK_bwHlwK3o5Cu6Xks5uBkaagaJpZM4U9NBy

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub < https://github.com/minishift/minishift-centos-iso/issues/252#issuecomment-401535736 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAEyDinFQD1seIPg14uXT-XGD66-UX8Wks5uB2OhgaJpZM4U9NBy

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/minishift/minishift-centos-iso/issues/252#issuecomment-401538601, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAHZhzr6PtGTSxxytaIKx3UomWHIgh1ks5uB3D0gaJpZM4U9NBy .