- 
                Notifications
    
You must be signed in to change notification settings  - Fork 15.1k
 
Add simple dropdown menu for selecting a network addon #2389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add simple dropdown menu for selecting a network addon #2389
Conversation
| 
           This is cute. I'll leave it to Devin to decide if we want to support code in these docs.  | 
    
| 
           IMO we could do a similar thing for package installation instructions.  | 
    
| 
           Thanks @thockin! Hi @devin-donnelly - the context here is that we've had lots of users show up in SIG-cluster-lifecycle complaining that it's hard to find the instructions to install a network. At the same time, we also want to remain vendor neutral. This solution fixes the problem by showing users how to install a network inline in the setup guide, while remaining vendor neutral by making it clear that a choice is necessary at this stage. WDYT? Regards maintaining the JS, sign us up ;)  | 
    
| 
           One concern is that our docs should not really be a clearinghouse for every
integration for every vendor.  I am fine with this change, per second, but
I worry about encouraging an ever-increasing list of instructions,
especially for cases where the instructions are more than a one-liner. 
…On Feb 1, 2017 7:04 AM, "lukemarsden" ***@***.***> wrote:
 Thanks @thockin <https://github.com/thockin>! Hi @devin-donnelly
 <https://github.com/devin-donnelly> - the context here is that we've had
 lots of users show up in SIG-cluster-lifecycle complaining that it's hard
 to find the instructions to install a network. At the same time, we also
 want to remain vendor neutral. This solution fixes the problem by showing
 users how to install a network inline in the setup guide, while remaining
 vendor neutral by making it clear that a choice is necessary at this stage.
 WDYT?
 —
 You are receiving this because you were mentioned.
 Reply to this email directly, view it on GitHub
 <#2389 (comment)>,
 or mute the thread
 <https://github.com/notifications/unsubscribe-auth/AFVgVIbcz6rD1UkqUSZVXwh-H-9UiVEFks5rYJ8MgaJpZM4Ly0xO>
 .
 
 | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should let Canal and Romana join the party as well
| <script> | ||
| var networkAddons = { | ||
| "Calico": "kubectl apply -f \"http://docs.projectcalico.org/v2.0/getting-started/kubernetes/installation/hosted/calico.yaml\"", | ||
| "Flannel": "kubeclt apply -f \"https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml?raw=true\"", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubectl
| 
               | 
          ||
| <p> | ||
| <select id="pickNetworkAddon" style="margin:1em;font-size:1.2em;"> | ||
| <option>Please select a network addon...</option> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case the user chooses this, I think the command should go back to # kubectl apply -f <selected-add-on.yaml>, now it does not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, makes sense, will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reluctant about adding more enumerations of (network) add-ons in numerous places in the k8s docs but I suppose this is OK.
| 
               | 
          ||
| <script> | ||
| var networkAddons = { | ||
| "Calico": "kubectl apply -f \"http://docs.projectcalico.org/v2.0/getting-started/kubernetes/installation/hosted/calico.yaml\"", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Calico add-on should be from this link: http://docs.projectcalico.org/v2.0/getting-started/kubernetes/installation/hosted/kubeadm/calico.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL looks the same to me...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I can see the kubeadm path segment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caseydavenport I think we should try to avoid having a version number in the URL. Can we have a "latest" or similar that corresponds to the latest stable release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've update the URL to a kubeadm specific one.
| # kubectl apply -f <add-on.yaml> | ||
| Several projects provide Kubernetes pod networks using CNI, some of which also support [Network Policy](/docs/user-guide/networkpolicies/). | ||
| 
               | 
          ||
| You must select a network addon from the drop-down menu below, and correct instructions will appear below. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sort of implies that the add-on needs to be from the dropdown. We should make it clear that this is just a sampling of network add-ons and not the definitive list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, could you suggest a way to phrase it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A specific suggestion would be very appreciated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about something like this:
"The dropdown below includes some common network add-ons. Select one from the dropdown to view its installation instructions."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be late to this thread. I'm not a fan of this drop down idea. Mainly because I can't' recall ever seeing it used in docs to address this kind of problem? It seems like a strange thing to see on a doc page. Are there examples of this that someone could point me to?
Also, it doesn't address the problem of enumerating all the options because every add-on provider will want to be include in the drop down. Finally, it introduces additional doc edit/management complexity. So, in addition to markdown, I have to know javascript to make a change? Some of my trivially simple markdown edits have broken the rendering of some pages, and IMO adding scripts is opening a real bag of worms.
That said, happy to defer to doc experts on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @chrismarino, I don't think it matters whether it's used in other docs, as long as it's obvious enough to users. IMHO, it's a very common GUI idiom to have a dropdown select which thing you're looking at. An alternative design could be tabs. But I don't think it makes much of a difference (and dropdown is more scalable than tabs).
I think what really does matter is that users are having a bad time:
So I understand that I need to complete Step 3 first, but I am totally lost on what to do for the network.I feel, this step is quite vague.
Hopefully it's fairly clear how the JS mapping works. Failing that, we have volunteered to maintain the JS.
          
 Yes, who should we ping?  | 
    
| 
           cc @chrismarino for Romana Also cc @tomdee  | 
    
| 
           Let's get this in, it dramatically improves the UX for the kubeadm guide! cc @devin-donnelly  | 
    
7c9b8d6    to
    4409b87      
    Compare
  
    | 
           I've addressed the comments above.  | 
    
| 
           Hey @thockin, totally hear you. We keep getting feedback that the current guide isn't working for people, though. Users are having a bad time. This PR is a big step towards fixing that. Can you help us get this merged?  | 
    
9b86b86    to
    673f66d      
    Compare
  
    - add simple dropdown menu for selecting a network addon, so users don't have go to other pages to find the commands they need to run - remove unecessary information from the paragraph
673f66d    to
    671e9fc      
    Compare
  
    | 
           @caseydavenport I've used the text you've suggested, thanks very much. @thockin @lukemarsden I've also edited the paragraph a bit more, there was some info in bold that was just unnecessary for anyone to know at that stage.  | 
    
| 
           Thanks @errordeveloper, LGTM  | 
    
Added Romana to drop down
| 
           This is squarely in the domain of docs owners, who have an actual docs plan...  | 
    
Added Romana to drop down...
| 
           Sorry it's taken me so long to get in on this. @errordeveloper , @lukemarsden : I'm not a big fan of dropping a new script into the documentation and then having to maintain it. I understand the reasoning behind this from a UX perspective, though. As a compromise, have you considered using the Tabs functionality that's already installed on the site? See this file: https://github.com/kubernetes/kubernetes.github.io/blob/master/_includes/tabs.html These display different included code files in tabs rather than drop-downs, but it has the advantage of already being installed and working on the site and also lives in our _includes directory.  | 
    
| 
           See this file for an example: kubernetes.github.io/docs/user-guide/services/operations.md  | 
    
| 
           @devin-donnelly I've only noticed tabs after I wrote this, I will try to use tabs for this, thanks.  | 
    
| 
           @errordeveloper I will close this PR for now then.  | 
    
| 
           @devin-donnelly I am afraid  
 More broadly, I've not been able to make meaningful UX out of it. I spent half-a-day yesterday. We can try extending tabs, but the way that it's written right now makes my brain hurt. I've quite quickly written a simple Jekyll plugin that takes a JSON description of all command variants we want to put in separate tabs, but it turns out we cannot use plugins due to   | 
    
| 
           @chenopis Please re-open. @devin-donnelly Please note Ilya's comments above. We tried the tabs route, and it turned out to be more complicated than what we were initially suggesting here. Additionally, the dropdown list is: 
  | 
    
| 
           Ok, I'm reopening this for further discussion.  | 
    
| <script> | ||
| var networkAddons = { | ||
| "Calico": "kubectl apply -f \"http://docs.projectcalico.org/v2.0/getting-started/kubernetes/installation/hosted/kubeadm/calico.yaml\"", | ||
| "Flannel": "kubectl apply -f \"https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml?raw=true\"", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flannel also needs to apply a RBAC file to run properly: https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel-rbac.yml
Would be helpful to have a single file a no external commands.
| 
           Please make a PR to my branch. 
…On Tue, 14 Mar 2017, 21:26 Ghe Rivero, ***@***.***> wrote:
 ***@***.**** commented on this pull request.
 ------------------------------
 In docs/getting-started-guides/kubeadm.md
 <#2389 (comment)>
 :
 > -
 -    # kubectl apply -f <add-on.yaml>
 +You must install a pod network add-on so that your pods can communicate with each other, a cluster without a network add-on should not be considered fully-functional.
 +
 +**It is necessary to do this before you try to deploy any applications to your cluster.**
 +
 +
 +Several projects provide Kubernetes pod networks using CNI, some of which also support [Network Policy](/docs/user-guide/networkpolicies/).
 +The dropdown below includes some common network add-ons. Select one from the dropdown to view its installation instructions.
 +
 +See the [add-ons page](/docs/admin/addons/) to learn more about each of the available network add-ons.
 +
 +<script>
 +  var networkAddons = {
 +    "Calico": "kubectl apply -f \"http://docs.projectcalico.org/v2.0/getting-started/kubernetes/installation/hosted/kubeadm/calico.yaml\"",
 +    "Flannel": "kubectl apply -f \"https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml?raw=true\"",
 Flannel also needs to apply a RBAC file to run properly:
 https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel-rbac.yml
 Would be helpful to have a single file a no external commands.
 —
 You are receiving this because you were mentioned.
 Reply to this email directly, view it on GitHub
 <#2389 (review)>,
 or mute the thread
 <https://github.com/notifications/unsubscribe-auth/AAPWS7beYbUyULwJtVEbgaUbA3JbHqC8ks5rlwYhgaJpZM4Ly0xO>
 .
 
 | 
    
| 
           Per @thockin and @devin-donnelly concerns, I am strongly against this PR. I ask that you reconsider using tabs. The drop-down is difficult to read and distinguish from the text, and I'm EXTREMELY reluctant to support new UX that has near-similar functionality to something we already have on the site.  | 
    
| 
           FYI, we're going to discuss this at the next SIG Docs meeting on 4/4, tentatively scheduled for 10:30 am PDT: Join from PC, Mac, Linux, iOS or Android: https://zoom.us/j/678394311 Or Telephone:  | 
    
| 
           I have refactored the tabs implementation in PR #3268, and you can test it out here: https://deploy-preview-3268--kubernetes-io-master-staging.netlify.com/docs/tabs-example/  | 
    
| 
           I write quite a few tutorials for Docker Swarm (new version) and I tried to get started with Kubernetes via  It would be great if this could be improved. 
 Even if trying to be impartial - this guide needs to leave you with a working system at the end and right now it just left me super confused and I'm not a newbie to orchestration. Needed in addition: Before / after:  | 
    
| 
           Thanks a lot @alexellis for that write-up. I hope that comment can bring this thread to life... So TL;DR; I agree with @alexellis, @lukemarsden and @errordeveloper and also think this would be a really nice feature to merge. Basically let the providers add themselves to this dropdown list. If the provider is lazy enough to not do it; well bad for them, but they are probably still listed in the addons page. Of course we'll ping all people involved to notify them they can add supported solutions to this list. But making these visible in the docs will actually help us target the users we want to target -- people that set up Kubernetes for the very first time; people that want to kick the tires with Kubernetes. Sure, kubeadm fits a lot of other people like experienced hackers of k8s as well, but that person can in theory build whatever system he/she wants anyway. I'm wondering how this kind of straightforward change could stall out like this. I'm currently updating the kubeadm docs to reflect the v1.7 release (#4018), and I might just add this kind of functionality in a second PR and try to push for this again ping @thockin @devin-donnelly @chenopis @errordeveloper @lukemarsden  | 
    
| 
           I think @errordeveloper just hasn't had time to get back to this PR yet. The implementation of tabs is good to go, and I used this PR to model the example: https://kubernetes.io/docs/tabs-example/  | 
    
| 
           I think @luxas is going to take a look at this, instead of @errordeveloper now – thanks!  | 
    
| 
           I'll do that this week, yes 
… On 03 Jul 2017, at 16:34, lukemarsden ***@***.***> wrote:
 I think @luxas is going to take a look at this, instead of @errordeveloper now – thanks!
 —
 You are receiving this because you were mentioned.
 Reply to this email directly, view it on GitHub, or mute the thread.
 
 | 
    
| 
           Implemented by: #4274  | 
    
This is to improve UX, it removes the need for users to click away to addon pages.
This a very simple version and only 3 addons are included right now, happy to extend this, if folks like the idea.
@lukemarsden @thockin @mikedanese @caseydavenport PTAL
Initial appearance:

Drop down choices:

Weave Net addon selected from dropdown:

This change is