Skip to content

Commit ece3fd9

Browse files
Lukenickersonmaciaszczykm
authored andcommitted
Updated detailed instructions for installing prerequisites (#1104)
* Updated order or steps and improved some details * Removed vim as a dependency in the steps * Added troubleshooting and separate check sections
1 parent 1727120 commit ece3fd9

File tree

1 file changed

+128
-60
lines changed

1 file changed

+128
-60
lines changed
Lines changed: 128 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
# Installing Requirements for the Kubernetes Dashboard
22

3-
This document assumes you have a Linux machine (or VM), and that you have a brand new Ubuntu Linux environment setup, but does not assume familiarity with Linux. If you don't have a Linux environment and you're using Windows, you may want to read instructions on how to setup a Linux VM on Windows first.
3+
These instructions are an elaboration on how to install the requirements listed on the [Getting Started page](getting-started.md). This document assumes you have a Linux machine (or VM), and that you have a brand new Ubuntu Linux environment setup, but does not assume familiarity with Linux. If you don't have a Linux environment and you're using Windows, you may want to read instructions on how to setup a Linux VM on Windows first.
44

55
Before you begin please make sure you can connect to your Linux machine and login. Command line instructions for Linux will be shown starting with `$`; you should only type the text following the `$`.
66

7-
## Basic Setup
7+
## Initial System Setup
88
Based on instructions from: https://docs.docker.com/engine/installation/linux/ubuntulinux/
99

10-
This will update Linux and get curl and vim, which you'll need later.
10+
This will update and upgrade Linux.
1111
```
1212
$ sudo apt-get update
1313
$ sudo apt-get upgrade
14-
$ sudo apt-get install curl
15-
$ sudo apt-get install vim
1614
```
17-
Unless you have another text editor you prefer, vim may be useful for beginners; instructions below use vim.
18-
19-
### Initial checks
15+
### Check
2016
```
2117
$ uname -r
2218
```
23-
You should get `3.2.0-23-generic`, `3.13.0-88-generic`, or something similar depending on what the current version is.
19+
You should get `3.2.0-23-generic` or something similar depending on what the current version is.
20+
2421

2522
```
2623
$ lsb_release -a
@@ -34,74 +31,60 @@ Release: 12.04
3431
Codename: precise
3532
```
3633

37-
## Get Kubernetes
3834

35+
## Install Helpful Programs
36+
Install some programs that we'll need later on, and verify that they're there.
3937
```
40-
$ curl -O https://storage.googleapis.com/kubernetes-release/release/v1.2.4/bin/linux/amd64/kubectl
41-
```
42-
*This will take a while.*
43-
44-
## Get Vagrant on Linux
45-
46-
```
47-
$ sudo apt-get install vagrant
48-
$ cd kubernetes
49-
$ export KUBERNETES_PROVIDER=vagrant
50-
$ ./cluster/kube-up.sh
38+
$ sudo apt-get install curl
39+
$ sudo apt-get install git
5140
```
52-
*Note that the last command will throw a lot of errors.*
5341

54-
55-
## Install Git
42+
### Check
5643
```
57-
$ sudo apt-get install git
44+
$ curl --version
5845
$ git --version
5946
```
60-
These instructions were last tested with git version 1.7.9.5.
47+
These instructions were last tested with curl `7.22.0`, and git `1.7.9.5`.
6148

49+
## Get Vagrant on Linux
6250

63-
## Clone the Dashboard Repo
6451
```
65-
git clone https://github.com/kubernetes/dashboard.git
52+
$ sudo apt-get install vagrant
53+
$ vagrant --version
54+
$ export KUBERNETES_PROVIDER=vagrant
55+
$ echo "export KUBERNETES_PROVIDER=vagrant" >> ~/.profile
6656
```
57+
These instructions are using vagrant version 1.0.1.
6758

68-
## Install Kubernetes Dashboard Requirements
69-
70-
See the requirement list on the [Getting Started page](getting-started.md).
71-
72-
### Install Docker
59+
## Install Docker
7360

7461
Based on instructions from: https://docs.docker.com/engine/installation/linux/ubuntulinux/
7562

76-
#### Setup
63+
### Setup
7764
```
78-
$ sudo apt-get update
7965
$ sudo apt-get install apt-transport-https ca-certificates
8066
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
8167
```
8268

69+
Create a docker.list file with one command:
70+
8371
```
84-
$ cd /etc/apt/sources.list.d/
85-
$ sudo vim docker.list
72+
sudo bash -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-precise main" > /etc/apt/sources.list.d/docker.list'
8673
```
87-
* <kbd>i</kbd> = insert
88-
* Type `deb https://apt.dockerproject.org/repo ubuntu-precise main`
89-
* <kbd>Esc</kbd> = stops inserting
90-
* `:x` = exits and saves
9174

9275
```
9376
$ sudo apt-get update
9477
$ sudo apt-get purge lxc-docker
9578
$ apt-cache policy docker-engine
9679
```
9780

98-
#### Only needed for Ubuntu Precise 12.04
81+
### Only needed for Ubuntu Precise 12.04
9982
```
10083
$ sudo apt-get update
10184
$ sudo apt-get install linux-image-generic-lts-trusty
10285
$ sudo reboot
10386
```
104-
#### Do the Docker install
87+
### Do the Docker install
10588
```
10689
$ sudo apt-get update
10790
$ sudo apt-get install docker-engine
@@ -111,7 +94,7 @@ $ sudo docker run hello-world
11194

11295
You should receive a message that includes: `This message shows that your installation appears to be working correctly`.
11396

114-
#### Configure Docker for your user
97+
### Configure Docker for your user
11598
Based on instructions from https://docs.docker.com/engine/installation/linux/ubuntulinux/#create-a-docker-group
11699

117100
The example below uses "username" as a placeholder. Please substitute with the user you are logged in as, which can be seen by using `$ id`.
@@ -120,68 +103,117 @@ If you are running Linux in a VM using Vagrant, your username will be "vagrant".
120103
```
121104
$ sudo groupadd docker
122105
$ sudo usermod -aG docker username
123-
$ env
124106
$ sudo reboot
107+
```
108+
109+
#### Check
110+
111+
```
125112
$ docker run hello-world
126113
```
127114

128115
You should get the same message as above, that includes: `This message shows that your installation appears to be working correctly`.
129116

117+
For an additional check you can run these commands:
118+
130119
`$ status docker` --> should say "docker start/running, process [some number]"
120+
131121
`$ docker ps` --> should show a table of information (or at least headers)
132122

133123

134-
### Install Go
124+
## Install Go
135125

136-
Get the latest download URL from https://golang.org/dl/
126+
The instructions below are for install a specific version of Go (1.6.2 for linux amd64). If you want the latest Go version or have a different system, then you can get the latest download URL from https://golang.org/dl/
137127
```
138128
$ wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz
129+
$ sudo tar -C /usr/local -xzf go1.6.2.linux-amd64.tar.gz
130+
$ export PATH=$PATH:/usr/local/go/bin
131+
$ echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
139132
```
140-
*Add Go to the path*
133+
134+
### Check
135+
141136
```
142137
$ go version
138+
$ echo $PATH
143139
```
144-
Should return something like `go version go1.6.2 linux/amd64`. Note that if you already had Go installed, ensure that `GO15VENDOREXPERIMENT` is unset.
140+
The Go version should return something like `go version go1.6.2 linux/amd64`. Note that if you already had Go installed, ensure that `GO15VENDOREXPERIMENT` is unset.
141+
142+
## Install Node and NPM
143+
144+
For some reason doing `sudo apt-get install nodejs` gives a much older version, so instead we will get the more recent version:
145145

146-
### Install Node and NPM
147-
For some reason doing this...
148-
```
149-
$ sudo apt-get install nodejs
150-
```
151-
... gives a much older version, so instead we will get the more recent version:
152146
```
153147
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
154148
$ sudo apt-get install -y nodejs
149+
```
150+
151+
### Check
152+
153+
````
155154
$ node -v
156155
$ npm -v
157156
```
158-
Should return `v6.2.1` and `3.9.3` respectively.
157+
The last time these instructions were updated, this returned `v6.3.1` and `3.10.3` respectively, but later versions will probably also work.
158+
159+
## Install Java 7
159160
160-
### Install Java 7
161161
```
162162
$ sudo apt-get install openjdk-7-jre
163+
```
164+
165+
### Check
166+
167+
```
163168
$ java -version
164169
```
165170
Should return `java version "1.7.0_101"`.
166171
167-
### Install Gulp using npm
172+
## Install Gulp using npm
168173
```
169174
$ sudo npm install --global gulp-cli
170175
$ sudo npm install --global gulp
176+
```
177+
178+
### Check
179+
180+
````
171181
$ gulp -v
172182
```
173183
Should return `CLI version 3.9.1` and `Local version 3.9.1`.
174184
185+
186+
## Get Kubernetes
187+
188+
Download the command line tool _kubectl_.
189+
190+
```
191+
$ curl -O https://storage.googleapis.com/kubernetes-release/release/v1.2.4/bin/linux/amd64/kubectl
192+
```
193+
194+
Clone the Dashboard and Kubernetes code from the GitHub repos. *This could take a while.*
195+
196+
```
197+
$ git clone https://github.com/kubernetes/dashboard.git
198+
$ git clone https://github.com/kubernetes/kubernetes.git
199+
```
200+
175201
## Install Other Dashboard Dependencies Automatically with NPM
176202
177203
```
178-
$ cd /dashboard
204+
$ cd ~/dashboard
179205
$ npm install
180206
```
181-
This will install all the dependencies that are in the `package.json` file.
207+
208+
This will install all the dependencies that are in the `package.json` file in the dashboard repo. *This could take a while.*
182209
183210
## Run the Kubernetes Cluster
211+
212+
Run the script included with the dashboard that checks out the latest Kubernetes and runs it in a Docker container.
213+
184214
```
215+
$ cd ~/dashboard
216+
$ sudo ./build/setup-docker.sh
185217
$ gulp local-up-cluster
186218
```
187219
If you need to stop the cluster you can run `$ docker kill $(docker ps -aq)`
@@ -190,4 +222,40 @@ If you need to stop the cluster you can run `$ docker kill $(docker ps -aq)`
190222
$ gulp serve
191223
```
192224
225+
### Check
226+
227+
Open up another terminal to your machine, and try to access the dashboard.
228+
229+
```
230+
curl http://localhost:9090
231+
```
232+
This should return the HTML for the dashboard.
233+
234+
### Continue
235+
193236
Now you may [continue with the Getting Started guide](getting-started.md) to learn more about developing with the Kubernetes Dashboard.
237+
238+
# Troubleshooting
239+
240+
## Docker
241+
If you're having trouble with the `gulp local-up-cluster` step, you may want to investigate the docker containers.
242+
243+
* `docker ps -a` lists all docker containers
244+
* `docker inspect name_of_container | grep "Error"` will look through the details of a docker container and display any errors.
245+
246+
If you have a error like "linux mounts: Path /var/lib/kubelet is mounted on / but it is not a shared mount." you should try `sudo mount --bind /var/lib/kubelet /var/lib/kubelet` followed by `sudo mount --make-shared /var/lib/kubelet`. ([source](https://github.com/kubernetes/kubernetes/issues/4869#issuecomment-193640483))
247+
248+
## Go
249+
250+
If you run into an error like "Go is not on the path.", you may need to re-run `export PATH=$PATH:/usr/local/go/bin`
251+
252+
## Helpful Linux Tips
253+
254+
* `env` will show your environment variables. One common error is not having every directory needed in your PATH.
255+
256+
Using *vim* to edit files may be helpful for beginners.
257+
* `sudo apt-get install vim` will get *vim*
258+
* `sudo vim /path/to/folder/filename` will open the file you want to edit.
259+
* <kbd>i</kbd> = insert
260+
* <kbd>Esc</kbd> = stops inserting
261+
* `:x` = exits and saves

0 commit comments

Comments
 (0)