|
| 1 | +# Installing Requirements for the Kubernetes Dashboard |
| 2 | + |
| 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. |
| 4 | + |
| 5 | +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 `$`. |
| 6 | + |
| 7 | +## Basic Setup |
| 8 | +Based on instructions from: https://docs.docker.com/engine/installation/linux/ubuntulinux/ |
| 9 | + |
| 10 | +This will update Linux and get curl and vim, which you'll need later. |
| 11 | +``` |
| 12 | +$ sudo apt-get update |
| 13 | +$ sudo apt-get upgrade |
| 14 | +$ sudo apt-get install curl |
| 15 | +$ sudo apt-get install vim |
| 16 | +``` |
| 17 | +Unless you have another text editor you prefer, vim may be useful for beginners; instructions below use vim. |
| 18 | + |
| 19 | +### Initial checks |
| 20 | +``` |
| 21 | +$ uname -r |
| 22 | +``` |
| 23 | +You should get `3.2.0-23-generic`, `3.13.0-88-generic`, or something similar depending on what the current version is. |
| 24 | + |
| 25 | +``` |
| 26 | +$ lsb_release -a |
| 27 | +``` |
| 28 | +^ You should get a response like: |
| 29 | +``` |
| 30 | +No LSB modules are available. |
| 31 | +Distributor ID: Ubuntu |
| 32 | +Description: Ubuntu 12.04.5 LTS |
| 33 | +Release: 12.04 |
| 34 | +Codename: precise |
| 35 | +``` |
| 36 | + |
| 37 | +## Get Kubernetes |
| 38 | + |
| 39 | +``` |
| 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 |
| 51 | +``` |
| 52 | +*Note that the last command will throw a lot of errors.* |
| 53 | + |
| 54 | + |
| 55 | +## Install Git |
| 56 | +``` |
| 57 | +$ sudo apt-get install git |
| 58 | +$ git --version |
| 59 | +``` |
| 60 | +These instructions were last tested with git version 1.7.9.5. |
| 61 | + |
| 62 | + |
| 63 | +## Clone the Dashboard Repo |
| 64 | +``` |
| 65 | +git clone https://github.com/kubernetes/dashboard.git |
| 66 | +``` |
| 67 | + |
| 68 | +## Install Kubernetes Dashboard Requirements |
| 69 | + |
| 70 | +See the requirement list on the [Getting Started page](getting-started.md). |
| 71 | + |
| 72 | +### Install Docker |
| 73 | + |
| 74 | +Based on instructions from: https://docs.docker.com/engine/installation/linux/ubuntulinux/ |
| 75 | + |
| 76 | +#### Setup |
| 77 | +``` |
| 78 | +$ sudo apt-get update |
| 79 | +$ sudo apt-get install apt-transport-https ca-certificates |
| 80 | +$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
| 81 | +``` |
| 82 | + |
| 83 | +``` |
| 84 | +$ cd /etc/apt/sources.list.d/ |
| 85 | +$ sudo vim docker.list |
| 86 | +``` |
| 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 |
| 91 | + |
| 92 | +``` |
| 93 | +$ sudo apt-get update |
| 94 | +$ sudo apt-get purge lxc-docker |
| 95 | +$ apt-cache policy docker-engine |
| 96 | +``` |
| 97 | + |
| 98 | +#### Only needed for Ubuntu Precise 12.04 |
| 99 | +``` |
| 100 | +$ sudo apt-get update |
| 101 | +$ sudo apt-get install linux-image-generic-lts-trusty |
| 102 | +$ sudo reboot |
| 103 | +``` |
| 104 | +#### Do the Docker install |
| 105 | +``` |
| 106 | +$ sudo apt-get update |
| 107 | +$ sudo apt-get install docker-engine |
| 108 | +$ sudo service docker start |
| 109 | +$ sudo docker run hello-world |
| 110 | +``` |
| 111 | + |
| 112 | +You should receive a message that includes: `This message shows that your installation appears to be working correctly`. |
| 113 | + |
| 114 | +#### Configure Docker for your user |
| 115 | +Based on instructions from https://docs.docker.com/engine/installation/linux/ubuntulinux/#create-a-docker-group |
| 116 | + |
| 117 | +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`. |
| 118 | +If you are running Linux in a VM using Vagrant, your username will be "vagrant". |
| 119 | + |
| 120 | +``` |
| 121 | +$ sudo groupadd docker |
| 122 | +$ sudo usermod -aG docker username |
| 123 | +$ env |
| 124 | +$ sudo reboot |
| 125 | +$ docker run hello-world |
| 126 | +``` |
| 127 | + |
| 128 | +You should get the same message as above, that includes: `This message shows that your installation appears to be working correctly`. |
| 129 | + |
| 130 | +`$ status docker` --> should say "docker start/running, process [some number]" |
| 131 | +`$ docker ps` --> should show a table of information (or at least headers) |
| 132 | + |
| 133 | + |
| 134 | +### Install Go |
| 135 | + |
| 136 | +Get the latest download URL from https://golang.org/dl/ |
| 137 | +``` |
| 138 | +$ wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz |
| 139 | +``` |
| 140 | +*Add Go to the path* |
| 141 | +``` |
| 142 | +$ go version |
| 143 | +``` |
| 144 | +Should return something like `go version go1.6.2 linux/amd64` |
| 145 | + |
| 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: |
| 152 | +``` |
| 153 | +$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - |
| 154 | +$ sudo apt-get install -y nodejs |
| 155 | +$ node -v |
| 156 | +$ npm -v |
| 157 | +``` |
| 158 | +Should return `v6.2.1` and `3.9.3` respectively. |
| 159 | + |
| 160 | +### Install Java 7 |
| 161 | +``` |
| 162 | +$ sudo apt-get install openjdk-7-jre |
| 163 | +$ java -version |
| 164 | +``` |
| 165 | +Should return `java version "1.7.0_101"`. |
| 166 | + |
| 167 | +### Install Gulp using npm |
| 168 | +``` |
| 169 | +$ sudo npm install --global gulp-cli |
| 170 | +$ sudo npm install --global gulp |
| 171 | +$ gulp -v |
| 172 | +``` |
| 173 | +Should return `CLI version 3.9.1` and `Local version 3.9.1`. |
| 174 | + |
| 175 | +## Install Other Dashboard Dependencies Automatically with NPM |
| 176 | + |
| 177 | +``` |
| 178 | +$ cd /dashboard |
| 179 | +$ npm install |
| 180 | +``` |
| 181 | +This will install all the dependencies that are in the `package.json` file. |
| 182 | + |
| 183 | +## Run the Kubernetes Cluster |
| 184 | +``` |
| 185 | +$ gulp local-up-cluster |
| 186 | +``` |
| 187 | +If you need to stop the cluster you can run `$ docker kill $(docker ps -aq)` |
| 188 | + |
| 189 | +``` |
| 190 | +$ gulp serve |
| 191 | +``` |
| 192 | + |
| 193 | +Now you may [continue with the Getting Started guide](getting-started.md) to learn more about developing with the Kubernetes Dashboard. |
0 commit comments