enhancements/proposed/20210618-tips/tips.md
Please review this proposal with the following priorities:
Please leave the above text in your proposal as instructions to the reader.
minikube has lots of great features. We want to proactively remind users that those features are available.
To achieve this, we can have a tips feature that randomly shows a tip from a curated list whenever the user starts a new minikube profile.
For example:
First, we need a static file to store all the tips, we can have a YAML file at pkg/generate/tips/tips.yaml:
tips:
- |
You can specify any Kubernetes version you want. For example:
```
minikube start --kubernetes-version=v1.19.0
```
- |
You can use minikube's built-in kubectl. For example:
```
minikube kubectl -- get pods
```
- |
minikube has the built-in Kubernetes Dashboard UI. To access it:
```
minikube dashboard
```
Use goembed to embed this file into the minikube binary.
The current out.Boxed has a hard-coded style (red). I propose to add another out.BoxedWithConfig method to allow
output with customized style:
// BoxedWithConfig writes a templated message in a box with customized style config to stdout
func BoxedWithConfig(cfg box.Config, st style.Enum, title string, format string, a ...V) {
}
Whenever minikube successfully starts, we randomly choose a tip.
Before printing it out, we need to do some regex replacement to strip the markdown syntax for better view experience in Terminal:
From this:
You can specify any Kubernetes version you want. For example:
```
minikube start --kubernetes-version=v1.19.0
```
To this:
You can specify any Kubernetes version you want. For example:
minikube start --kubernetes-version=v1.19.0
Then we can print out the tip:
boxCfg := out.BoxConfig{
Config: box.Config{
Py: 1,
Px: 5,
TitlePos: "Top",
Type: "Round",
Color: tipBoxColor,
},
Title: tipTitle,
Icon: style.Tip,
}
out.BoxedWithConfig(boxCfg, tips.Tips[chosen] + "\n\n" + tipSuffix)
User can choose to disable this through minikube config set disable-tips true
We will have make generate-docs generating the docs site based on this YAML file as well.
We can have a Nice to know sub-page under FAQ?
I plan to start with the command lines and cover almost all CLI usages of minikube.
That includes but not limited to:
I plan to open at least 4 PRs:
out.Boxed with custom styletips display with ability to disable through config, with an initial set of about 10 tipsmake generate-docs to sync tips to docsIs there a more preferred file format to YAML?
Maybe we just want to sync the tips to the FAQ page list instead of creating a new page?
Instead of the file format I proposed, maybe add a question field?
tips:
- question: How to specify a different Kubernetes version?
answer: |
You can specify any Kubernetes version you want. For example:
```
minikube start --kubernetes-version=v1.19.0
```
- question: Do I have to install `kubectl` myself?
answer: |
You can use minikube's built-in kubectl. For example:
```
minikube kubectl -- get pods
```
- question: How do I access the Kubernetes Dashboard UI?
answer: |
minikube has the built-in Kubernetes Dashboard UI. To access it:
```
minikube dashboard
```
On the docs side we can show both questions and answers. On the CLI side we can either show both questions and answers, or just show the answers to make it more compact.