requirements-installation.md 5.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
# Installing Requirements for the Kubernetes Dashboard

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.

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 `$`.

## Basic Setup
Based on instructions from: https://docs.docker.com/engine/installation/linux/ubuntulinux/

This will update Linux and get curl and vim, which you'll need later.
```
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install curl
$ sudo apt-get install vim
```
Unless you have another text editor you prefer, vim may be useful for beginners; instructions below use vim.

### Initial checks
```
$ uname -r
```
You should get `3.2.0-23-generic`, `3.13.0-88-generic`, or something similar depending on what the current version is.

```
$ lsb_release -a
```
^ You should get a response like:
```
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:        12.04
Codename:       precise
```

## Get Kubernetes

```
$ curl -O https://storage.googleapis.com/kubernetes-release/release/v1.2.4/bin/linux/amd64/kubectl
```
*This will take a while.*

## Get Vagrant on Linux

```
$ sudo apt-get install vagrant
$ cd kubernetes
$ export KUBERNETES_PROVIDER=vagrant
$ ./cluster/kube-up.sh
```
*Note that the last command will throw a lot of errors.*


## Install Git
```
$ sudo apt-get install git
$ git --version
```
These instructions were last tested with git version 1.7.9.5.


## Clone the Dashboard Repo
```
git clone https://github.com/kubernetes/dashboard.git
```

## Install Kubernetes Dashboard Requirements

See the requirement list on the [Getting Started page](getting-started.md).

### Install Docker

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

#### Setup
```
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
```

```
$ cd /etc/apt/sources.list.d/
$ sudo vim docker.list
```
* <kbd>i</kbd> = insert
* Type `deb https://apt.dockerproject.org/repo ubuntu-precise main`
* <kbd>Esc</kbd> = stops inserting
* `:x` = exits and saves

```
$ sudo apt-get update
$ sudo apt-get purge lxc-docker
$ apt-cache policy docker-engine
```

#### Only needed for Ubuntu Precise 12.04
```
$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-trusty
$ sudo reboot
```
#### Do the Docker install
```
$ sudo apt-get update
$ sudo apt-get install docker-engine
$ sudo service docker start
$ sudo docker run hello-world
```

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

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

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`.
If you are running Linux in a VM using Vagrant, your username will be "vagrant".

```
$ sudo groupadd docker
$ sudo usermod -aG docker username
$ env
$ sudo reboot
$ docker run hello-world
```

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

`$ status docker` --> should say  "docker start/running, process [some number]"
`$ docker ps` --> should show a table of information (or at least headers)


### Install Go

Get the latest download URL from https://golang.org/dl/
```
$ wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz
```
*Add Go to the path*
```
$ go version
```
P
Piotr Bryk 已提交
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.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193

### Install Node and NPM
For some reason doing this...
```
$ sudo apt-get install nodejs
```
... gives a much older version, so instead we will get the more recent version:
```
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ node -v
$ npm -v
```
Should return `v6.2.1` and `3.9.3` respectively.

### Install Java 7
```
$ sudo apt-get install openjdk-7-jre
$ java -version
```
Should return `java version "1.7.0_101"`.

### Install Gulp using npm 
```
$ sudo npm install --global gulp-cli
$ sudo npm install --global gulp
$ gulp -v
```
Should return `CLI version 3.9.1` and `Local version 3.9.1`.

## Install Other Dashboard Dependencies Automatically with NPM

```
$ cd /dashboard
$ npm install
```
This will install all the dependencies that are in the `package.json` file.

## Run the Kubernetes Cluster
```
$ gulp local-up-cluster
```
If you need to stop the cluster you can run `$ docker kill $(docker ps -aq)`

```
$ gulp serve
```

Now you may [continue with the Getting Started guide](getting-started.md) to learn more about developing with the Kubernetes Dashboard.