Skip to content

Commit

Permalink
Fixed titles capitalisation
Browse files Browse the repository at this point in the history
  • Loading branch information
abelperezok committed Dec 21, 2020
1 parent cb8766a commit 978f9c4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 26 deletions.
14 changes: 7 additions & 7 deletions 00-Intro.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Introduction - Setting up the cluster
# Introduction - Setting Up the Cluster
This is the second attempt after some time when I first tried to set up such a cluster and I started learning [Kubernetes](https://kubernetes.io/). One of the reasons I wanted to do this is because I have two [Raspberry Pi Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) (and [Zero W](https://www.raspberrypi.org/products/raspberry-pi-zero-w/)) lying around and a new (at the time) [Raspberry Pi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/). After experimenting for a bit with them individually, I decided to put them to work together.

Some research brought my attention to [ClusterHAT](https://clusterhat.com/) which simplified all the messing around with USB gadgets to make the Pi Zeros believe they’re connected to a network using USB. Having tested it for a while, I decided to give it a go and install a Kubernetes cluster.
Expand Down Expand Up @@ -28,7 +28,7 @@ Download the images for each Pi: controller CNAT and each pi (p1 .. p4) in this

If you're using Wi-Fi, it needs setting up before booting to make it easy to connect totally headless.

### Set up Wi-Fi on the controller
### Setting Up Wi-Fi on the Controller

Mount the microSD card and in /boot partition modify the file `/boot/wpa_supplicant.conf`

Expand All @@ -50,7 +50,7 @@ touch /boot/ssh
```


### Understand the networking model
### Understand the Networking Model


Host name | External IP | Internal IP | Role |
Expand All @@ -63,7 +63,7 @@ p2 | NAT | 172.19.181.2 | worker |

Diagram

### Upgrade the system
### Upgrade the System

It's always a good start with a fresh up to date system. Something particular of Raspbian is that you should use `full-upgrade` instead of just `upgrade` as it could be the case that it doesn't download all the dependencies of the new packages, kind of weird.

Expand All @@ -80,7 +80,7 @@ In my case, I wanted to identify the master node from the rest, I updated to `rp
$ sudo hostnamectl set-hostname rpi-k8s-master
```

### Set up and verify connectivity
### Set Up and Verify Connectivity

Once all the base hardware is up and running, it'll be much easier if ssh config file is configured to connect to the pi zeros.

Expand Down Expand Up @@ -114,7 +114,7 @@ $ cat | sudo tee -a /etc/hosts << HERE
HERE
```

### Generate ssh keys and copy to the pi zeros
### Generate SSH Keys and Copy to the Pi Zeros

```shell
ssh-keygen -t rsa -b 4096 -N "" -f ~/.ssh/local_rsa -C "local key ClusterHAT"
Expand Down Expand Up @@ -147,7 +147,7 @@ Install tmux
sudo apt install tmux
```

### Working directories
### Working Directories

The following directories are going to be used to store the files produced by the command outputs during this process.

Expand Down
6 changes: 3 additions & 3 deletions 02-Build-Binaries.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build Binaries From Source Code
# Build Binaries from Source Code

Since ARMv6 is not officially supported by Kubernetes, the binaries need to be built from the source in order to get them properly to work. They are all written in Go which facilitates the process of cross-compiling. However, I found it even easier using qemu to to run ARM native golang docker images to compile.

Expand All @@ -9,7 +9,7 @@ Use docker to build the binaries, although it’s not necessary, it removes the
* [arm32v7/golang](https://hub.docker.com/r/arm32v7/golang) for armhf - Pi 3
* [arm32v5/golang](https://hub.docker.com/r/arm32v5/golang) for armel - Pi Zero

## Build Kubernetes Binaries For Master Node
## Build Kubernetes Binaries for Master Node

```shell
git clone https://github.com/kubernetes/kubernetes.git
Expand Down Expand Up @@ -41,7 +41,7 @@ scp _output/local/bin/linux/arm/kube* [email protected]:~/bin

> **Note** - kubectl can be reused for worker nodes as well, it worked for me.
## Build Kubernetes Binaries For Worker Nodes
## Build Kubernetes Binaries for Worker Nodes

Before building kubelet, I found numerous issues with a missing cgroup (cpuset) in the raspberry pi zero. I’m not entirely sure why this is a requirement and I removed it from the code. I published my findings in the [raspberry pi forum](https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=219644#p1348691).

Expand Down
2 changes: 0 additions & 2 deletions 03-Prepare-Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ kubectl config set-context default \
kubectl config use-context default --kubeconfig=admin.kubeconfig
```



## Generating the Data Encryption Config and Key

```shell
Expand Down
4 changes: 2 additions & 2 deletions 04-Etcd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In this case there is only one controller node, not really an etcd cluster.

## Install etcd and etcdctl
## Install Etcd and Etcdctl

Inside master node at $HOME directory.

Expand Down Expand Up @@ -60,7 +60,7 @@ sudo systemctl enable etcd
sudo systemctl start etcd
```

## Verify it’s working
## Verify It’s Working

```shell
sudo etcdctl member list \
Expand Down
6 changes: 3 additions & 3 deletions 05-Control-Plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ WantedBy=multi-user.target
EOF
```

## Enable and start services
## Enable and Start Services

```shell
sudo systemctl daemon-reload
sudo systemctl enable kube-apiserver kube-controller-manager kube-scheduler
sudo systemctl start kube-apiserver kube-controller-manager kube-scheduler
```

## Verify the installation
## Verify the Installation

The guide recommends to run:

Expand Down Expand Up @@ -278,7 +278,7 @@ $ curl --cacert ca.pem https://${KUBERNETES_PUBLIC_ADDRESS}:6443/version

Success!

## Transfer the binaries to the worker nodes
## Transfer the Binaries to the Worker Nodes

```shell
for instance in p1 p2; do
Expand Down
8 changes: 4 additions & 4 deletions 06-Worker-Nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ echo br_netfilter | sudo tee -a /etc/modules

After these steps `reboot` the node.

## Install the worker binaries
## Install the Worker Binaries

```shell
sudo mkdir -p \
Expand Down Expand Up @@ -95,7 +95,7 @@ cat <<EOF | sudo tee /etc/cni/net.d/99-loopback.conf
EOF
```

## Configure containerd
## Configure Containerd

Important attention to `titilambert/armv6-pause:latest`, the original `k8s.gcr.io/pause` doesn’t work on ARMv6, so I found an alternative already published that worked for me. You can always build the image yourself from the source once compiled the `pause` binary but I didn’t go that far.

Expand Down Expand Up @@ -245,15 +245,15 @@ WantedBy=multi-user.target
EOF
```

## Enable and start services
## Enable and Start Services

```shell
sudo systemctl daemon-reload
sudo systemctl enable containerd kubelet kube-proxy
sudo systemctl start containerd kubelet kube-proxy
```

## Test worker nodes
## Test Worker Nodes

On the worker nodes, test `containerd` is up and running using `crictl tool`.

Expand Down
4 changes: 2 additions & 2 deletions 07-Remote-Access.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Run in master node, $HOME directory, also embed all the certificates in the config file, in case we move the temporary directory pki and easier if we want to download the configuration file.

## Prepare configuration file
## Prepare Configuration File

```shell
KUBERNETES_PUBLIC_ADDRESS=192.168.1.164
Expand Down Expand Up @@ -32,7 +32,7 @@ The result is stored in `~/.kube/config` file, download the config file.
scp [email protected]:~/.kube/config /home/abel/.kube/
```

## Verification from remote computer
## Verification from Remote Computer

```shell
$ kubectl version
Expand Down
6 changes: 3 additions & 3 deletions 08-Network-Routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ shell1 1/1 Running 0 14m 10.200.0.59 p1
shell2 1/1 Running 0 14m 10.200.1.30 p2
```

## Test without routes
## Test without Routes

```shell
kubectl run shell1 --rm -it --image arm32v5/busybox -- sh
Expand All @@ -44,7 +44,7 @@ PING 10.200.0.59 (10.200.0.59): 56 data bytes
3 packets transmitted, 0 packets received, 100% packet loss
```

## Add the missing routes
## Add the Missing Routes

On master node, run the following command to add the missing routes.

Expand All @@ -53,7 +53,7 @@ sudo route add -net 10.200.0.0 netmask 255.255.255.0 gw 172.19.181.1
sudo route add -net 10.200.1.0 netmask 255.255.255.0 gw 172.19.181.2
```

## Repeat the test with routes in place
## Repeat the Test with Routes in Place

```shell
kubectl run shell1 --rm -it --image arm32v5/busybox -- sh
Expand Down

0 comments on commit 978f9c4

Please sign in to comment.