Minikube: Add `--addons` flag to `minikube start`

Created on 30 Sep 2019  Â·  7Comments  Â·  Source: kubernetes/minikube

It would be nice if users could specify which addons a cluster will have, especially as this could in the future inform the default resource footprint for a cluster.

For example:

minikube start --addons helm-tiller

Related: #4227 #5302

help wanted kinfeature prioritimportant-longterm

All 7 comments

Hi, I'm New Contributor.
I'd like to contribute this.
Can I work on this?

@govargo - Yes! We would very much love your help on this issue.

I know you didn't ask, but just in case it helps to move things a long, here's my suggestion on how to get started.

Create an addons flag here:

https://github.com/kubernetes/minikube/blob/7d59b0d36cf5d0191095e41b859062dad90e3b11/cmd/minikube/cmd/start.go#L164

Add a call here to enable the addons based on the flag value:

https://github.com/kubernetes/minikube/blob/7d59b0d36cf5d0191095e41b859062dad90e3b11/cmd/minikube/cmd/start.go#L344

Here's an example of how to enable an addon, from the "minikube addons enable" command line:

https://github.com/kubernetes/minikube/blob/7d59b0d36cf5d0191095e41b859062dad90e3b11/cmd/minikube/cmd/config/enable.go#L34

It's worth noting that at the moment, addons and settings use the same API, though we would like to change the behavior in the future with #4227.

As far as integration testing so that this feature doesn't break in the future, I would change this command-line to enable ingress using your new flag:

https://github.com/kubernetes/minikube/blob/7d59b0d36cf5d0191095e41b859062dad90e3b11/test/integration/addons_test.go#L45

And then remove the line where we explicitly call "addons enable ingress":

https://github.com/kubernetes/minikube/blob/7d59b0d36cf5d0191095e41b859062dad90e3b11/test/integration/addons_test.go#L75

The rest of the test should not require any additional changes.

Hope this helps!

@tstromberg
Thabk you very much for your advice!!!

I’ll try it!

/assign

I send PR for this!

5543

Thank you for advices of implement!

While this is a great improvement to be able to enable further addons, it keeps the default addons enabled.
It would be good if passing this arg make minikube only deploy the listed addons.

See below, starting with only 2 addons leads to minikube started with 3 addons

$ minikube version
minikube version: v1.8.1
commit: cbda04cf6bbe65e987ae52bb393c10099ab62014
$ minikube start --addons default-storageclass storage-provisioner
* minikube v1.8.1 on Ubuntu 18.04
* Using the none driver based on existing profile
* Reconfiguring existing host ...
* Using the running none "minikube" bare metal machine ...
* OS release is Ubuntu 18.04.4 LTS
* Preparing Kubernetes v1.17.3 on Docker 19.03.6 ...
  - kubelet.resolv-conf=/run/systemd/resolve/resolv.conf
* Launching Kubernetes ...
* Enabling addons: dashboard, default-storageclass, storage-provisioner
* Configuring local host environment ...
* Done! kubectl is now configured to use "minikube"
$ minikube addons list
|-----------------------------|----------|--------------|
|         ADDON NAME          | PROFILE  |    STATUS    |
|-----------------------------|----------|--------------|
| dashboard                   | minikube | enabled ✅   |
| default-storageclass        | minikube | enabled ✅   |
| efk                         | minikube | disabled     |
| freshpod                    | minikube | disabled     |
| gvisor                      | minikube | disabled     |
| helm-tiller                 | minikube | disabled     |
| ingress                     | minikube | disabled     |
| ingress-dns                 | minikube | disabled     |
| istio                       | minikube | disabled     |
| istio-provisioner           | minikube | disabled     |
| logviewer                   | minikube | disabled     |
| metrics-server              | minikube | disabled     |
| nvidia-driver-installer     | minikube | disabled     |
| nvidia-gpu-device-plugin    | minikube | disabled     |
| registry                    | minikube | disabled     |
| registry-creds              | minikube | disabled     |
| storage-provisioner         | minikube | enabled ✅   |
| storage-provisioner-gluster | minikube | disabled     |
|-----------------------------|----------|--------------|

@tstromberg @medyagh

minikube's always enable default addons default-storageclass & storage-provisioner.
Is this essential requirement for minikube?

Was this page helpful?
0 / 5 - 0 ratings