Skip to content

Commit fbdc672

Browse files
committed
Update the readme
1 parent c07d0c7 commit fbdc672

File tree

1 file changed

+35
-59
lines changed

1 file changed

+35
-59
lines changed

README.md

Lines changed: 35 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ kube-config install
133133
Hmm, starting a complex system like Kubernetes should be a complex task, right?
134134
Well, not this time.
135135

136+
`enable-master` runs [master.sh](https://github.com/kubernetes/kube-deploy/blob/master/docker-multinode/master.sh)
137+
`enable-worker` runs [worker.sh](https://github.com/kubernetes/kube-deploy/blob/master/docker-multinode/worker.sh)
138+
136139
```bash
137140
# To set up your board as both a master and a node, run
138141
kube-config enable-master
@@ -150,9 +153,10 @@ The README for the `docker-multinode` rootfs [is here](sdcard/rootfs/docker-mult
150153
If you already have set up your Pi with latest Raspbian OS for example, follow this guide.
151154

152155
#### Install the `.deb` package
153-
```bash
154-
# The OS have to be systemd based, e. g. HypriotOS, Debian Jessie, Arch Linux ARM, Ubuntu 15.04
155156

157+
Supported operating systems are HypriotOS, Raspbian, Arch Linux ARM and in some cases Debian/Ubuntu.
158+
159+
```bash
156160
# Download the latest package
157161
curl -sSL https://github.com/luxas/kubernetes-on-arm/releases/download/v0.8.0/docker-multinode.deb > docker-multinode.deb
158162
# or
@@ -163,10 +167,7 @@ sudo dpkg -i docker-multinode.deb
163167

164168
# Setup the enviroinment
165169
# It will ask which board it's running on and which OS
166-
# If your OS is Hypriot or Arch Linux, choose that. Otherwise, choose systemd, which is generic
167-
# It will download prebuilt binaries
168-
# And make a swap file if you plan to compile things
169-
# A reboot is required for it to function properly
170+
# A reboot is required for it to function properly, but not for HypriotOS
170171
kube-config install
171172

172173
## ----- REBOOT -----
@@ -219,10 +220,6 @@ kubectl get svc
219220
curl $SERVICE_IP
220221
# --> <p>WELCOME TO NGINX</p>
221222

222-
# 10.0.0.10 is already enabled as a DNS server in your system, see the file /etc/systemd/resolved.conf.d/dns.conf
223-
# That file makes /etc/resolv.conf use kube-dns also outside of your containers
224-
kube-config enable-addon dns
225-
226223
# See which internal cluster services that are running
227224
kubectl --namespace=kube-system get pods,rc,svc
228225

@@ -243,16 +240,13 @@ kube-config enable-addon registry
243240
kubectl --namespace=kube-system get pods
244241

245242
# Tag an image
246-
docker tag my-name/my-image registry.kube-system:5000/my-name/my-image
243+
docker tag my-name/my-image localhost:5000/my-name/my-image
247244

248245
# And push it to the registry
249-
docker push registry.kube-system:5000/my-name/my-image
246+
docker push localhost:5000/my-name/my-image
250247

251248
# On another node, pull it
252-
docker pull registry.kube-system:5000/my-name/my-image
253-
254-
# The registry address may be written longer if search isn't specified.
255-
# registry.kube-system.svc.cluster.local == registry.kube-system
249+
docker pull localhost:5000/my-name/my-image
256250

257251
# The master also proxies the services so that they are accessible from outside
258252
# The -L flag is there because curl has to follow redirects
@@ -272,14 +266,10 @@ kubectl cluster-info
272266
# cAdvisor in kubelet provides a web site that outputs all kind of stats in real time
273267
# http://$MASTER_IP:4194
274268

275-
# Disable this node. This always reverts the "kube-config enable-*" commands
276-
kube-config disable-node
277-
278-
# Remove the data for the cluster
279-
kube-config delete-data
269+
# Turndown Kubernetes on this node. This always reverts the "kube-config enable-*" commands
270+
kube-config disable
280271
```
281272

282-
283273
## Addons
284274

285275
To enable/disable addons is very easy: `kube-config enable-addon [addon-name]` and `kube-config disable-addon [addon-name]`
@@ -293,26 +283,28 @@ Three addons are available for the moment:
293283
- Example: `my-awesome-webserver.default.svc.cluster.local` or just `my-awesome-webserver` may resolve to ip `10.0.0.154`
294284
- Those DNS names is available both in containers and on the node itself (kube-config automatically adds the info to `/etc/resolv.conf`)
295285
- If you want to access the Kubernetes API easily, `curl -k https://kubernetes` or `curl -k https://10.0.0.1` if you remember numbers better (`-k` stands for insecure as apiserver has no signed certs by default)
296-
- The DNS server itself has allocated ip `10.0.0.10` by default
297-
- The DNS domain is `cluster.local` by default
298-
- Central image registry:
299-
- A registry for storing cluster images if e.g. the cluster has no internet connection for a while
300-
- Or for cluster-specific images that one not want to publish on Docker Hub
301-
- This service is available at this address: `registry.kube-system` when DNS is enabled
302-
- Just tag your image: `docker tag my-name/my-image registry.kube-system:5000/my-name/my-image`
303-
- And push it to the registry: `docker push registry.kube-system:5000/my-name/my-image`
286+
- The DNS server itself has allocated ip `10.0.0.10`
287+
- The DNS domain is `cluster.local`
288+
- This addon can't be disabled.
304289
- Kubernetes Dashboard:
305290
- The Kubernetes Dashboard project [is here](https://github.com/kubernetes/dashboard)
306-
- Replaces `kube-ui`
307291
- Access the dashboard on: `http://[master-ip]:8080/ui`
308-
- The Service Loadbalancer:
292+
- This addon can't be disabled.
293+
- Central image registry:
294+
- A registry for storing cluster images if e.g. the cluster has no internet connection for a while
295+
- Or for cluster-specific images that one not want to publish on Docker Hub
296+
- This service is available at `localhost:5000` on all nodes, which by default is a "trusted" location.
297+
- `localhost:5000` forwards the traffic to the internal IP of the registry service.
298+
- Just tag your image: `docker tag my-name/my-image localhost:5000/my-name/my-image`
299+
- And push it to the registry: `docker push localhost:5000/my-name/my-image`
300+
- Service loadbalancer:
309301
- Documentation [here](https://github.com/kubernetes/contrib/tree/master/service-loadbalancer)
310302
- You have to label at least one node `role=loadbalancer` like this: `kubectl label no [node_ip] role=loadbalancer`
311303
- The loadbalancer will expose http services in the default namespace on `http://[loadbalancer_ip]/[service_name]`. Only `http` services on port 80 are tested in this release. It should be pretty easy to add `https` support though.
312304
- You may see `haproxy` stats on `http://[loadbalancer_ip]:1936`
313-
- More info will come later
305+
- Not recommended for heavy use. Will be replaced with ingress in coming releases.
314306
- Cluster monitoring with heapster, influxdb and grafana
315-
- When running this addon (`heapster`), the Dashboard will show usage graphs in the CPU and RAM columns.
307+
- When this addon is enabled, the dashboard will show usage graphs in the CPU and RAM columns.
316308
- All heapster data is stored in an InfluxDB database. Data is written once a minute. Access the graphical InfluxDB UI: `http://[master-ip]:8080/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb:http` and the raw api on: `http://[master-ip]:8080/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb:api`
317309
- A nice `grafana` web dashboard that shows resource usage for the whole cluster as for individual pods is accessible at: `http://[master-ip]:8080/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana`. It may take some minutes for data to show up.
318310

@@ -328,8 +320,8 @@ Here is some ways to make your outside devices reach the services running in the
328320
- Connect a computer to the `flannel` network
329321
- It's possible to start `flannel` and `kube-proxy` on another computer **in the same network** and access all services
330322
- Run these two commands from a `amd64` machine with docker:
331-
- `docker run --net=host -d --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.5.5 /opt/bin/flanneld --etcd-endpoints=http://$MASTER_IP:4001`
332-
- `docker run --net=host -d --privileged gcr.io/google_containers/hyperkube-amd64:v1.2.0 /hyperkube proxy --master=http://$MASTER_IP:8080 --v=2`'
323+
- `docker run --net=host -d --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.6.1-amd64 /opt/bin/flanneld --etcd-endpoints=http://$MASTER_IP:2379`
324+
- `docker run --net=host -d --privileged gcr.io/google_containers/hyperkube-amd64:v1.3.6 /hyperkube proxy --master=http://$MASTER_IP:8080 --v=2`'
333325
- Replace $MASTER_IP with the actual ip of your master node
334326
- The consuming `amd64` computer can access all services
335327
- For example: `curl -k https://10.0.0.1`
@@ -348,39 +340,23 @@ Go to a web browser and type: `{IP of your node}:4194` and a nice dashboard will
348340

349341
There is a configuration file: `/etc/kubernetes/k8s.conf`, where you can customize some things:
350342
- `K8S_MASTER_IP`: Points to the master in the cluster. If the node is master, it uses `127.0.0.1` (aka `localhost`). Default: `127.0.0.1`
351-
- `FLANNEL_SUBNET`: The subnet `flannel` should use. [More information](https://github.com/coreos/flannel#configuration). Default: `10.1.0.0/16`
352-
- `FLANNEL_BACKEND`: The backend `flannel` will use to proxy packets from one node to another. [More information](https://github.com/coreos/flannel#configuration). Default: `host-gw`, which requires Layer 2 connectivity between nodes.
353-
- `DNS_IP`: The IP the DNS addon will allocate. Defaults to: `10.0.0.10`. Do not change this unless you have a good reason.
354-
- `DNS_DOMAIN`: The domain for DNS names. Defaults to: `cluster.local`. If you for example changes this to `abc`, your DNS names will look like this: `my-nginx.default.svc.abc`.
355-
- `DOCKER_STORAGE_DRIVER`: The storage driver all docker daemons will use. Note: You shouldn't change this after the installation.
356-
357-
**Note:** You must change the values in `k8s.conf` before starting Kubernetes. Otherwise they won't have effect, just be able to harm your setup. And remember that if you change `DNS_IP` and `DNS_DOMAIN` on one node, you'll have to change them on all nodes in the cluster
343+
- The other options comes from [docker-multinode](https://github.com/kubernetes/kube-deploy/tree/master/docker-multinode#optionsconfiguration)
358344

345+
**Note:** You must change the values in `k8s.conf` before starting Kubernetes. Otherwise they won't have effect, just be able to harm your setup.
359346

360347
On Arch Linux, this file will override the default `eth0` settings. If you have a special `eth0` setup (or use some other network), edit this file to fit your use case: `/etc/systemd/network/dns.network`
361348

362349
## Docker versions
363350

364-
With release `v0.6.5` and higher, only `docker-1.10.0` and higher is supported.
365-
366-
## Cross-compiling
367-
368-
For this project, I compile the binaries on ARM hosts. But I've also made a script that can cross-compile if you want to compile it faster. [Check it out](scripts/build-k8s-on-amd64/Dockerfile)
369-
370-
## Running tests
371-
372-
Right now there is one test:
373-
- `run-test master` will simply do what the `Use Kubernetes` section does. It setups a master, runs `nginx`, starts the DNS, registry and sleep addons.
374-
375-
Logs can be found at: `/etc/kubernetes/source/scripts/logs`
376-
The tests can be found at: `/etc/kubernetes/source/scripts/tests`
377-
The test might fail, although the thing it's testing is in fact working. Report an issue in that case.
351+
Only `docker-1.10` and higher is supported, `docker-1.11` is recommended.
378352

379353
## Troubleshooting
380354

381-
If your cluster won't start, try `kube-config delete-data`. That will remove all data you store in `/var/lib/kubelet` and `/var/lib/kubernetes`. If you don't want to delete all data, but have to get Kubernetes up and running, you can answer `M`, when running `kube-config delete-data` and it will rename `/var/lib/kubernetes` and `/var/lib/kubelet` to `/var/lib/kubernetesold` and `/var/lib/kubeletold` so you may restore them later.
355+
If your cluster won't start, try `kube-config disable` and choose to remove `/var/lib/kubelet`. That will remove all data you store in `/var/lib/kubelet` and kill most running docker images.
356+
357+
## Reboots
382358

383-
There is also no guarantee that the master/workers and all their services will come up successfully after a reboot, but it's possible.
359+
Will **not** work in this version. It's in the roadmap to enable reboots again.
384360

385361
## Contributing
386362

0 commit comments

Comments
 (0)