Skip to content

Instantly share code, notes, and snippets.

@coderplay
Last active April 1, 2021 09:12
Show Gist options
  • Save coderplay/8859e993a1995c1d639a877b34f6335a to your computer and use it in GitHub Desktop.
Save coderplay/8859e993a1995c1d639a877b34f6335a to your computer and use it in GitHub Desktop.
Setup a Raspberry PI Kubernetes Cluster
#!/usr/bin/env bash
set -e
VER=$1
PROJ="etcd"
if [ -z "$1" ]; then
echo "Usage: ${0} VERSION" >> /dev/stderr
exit 255
fi
set -u
function setup_env {
local proj=${1}
local ver=${2}
if [ ! -d ${proj} ]; then
git clone https://github.com/coreos/${proj}
fi
pushd ${proj} >/dev/null
git checkout master
git fetch --all
git reset --hard origin/master
git checkout $ver
sed -i '' '/checkSupportArch()$/d' ./etcdmain/etcd.go
popd >/dev/null
}
function package {
local target=${1}
local srcdir="${2}/bin"
local ccdir="${srcdir}/${GOOS}_${GOARCH}"
if [ -d ${ccdir} ]; then
srcdir=${ccdir}
fi
local ext=""
if [ ${GOOS} == "windows" ]; then
ext=".exe"
fi
for bin in etcd etcdctl; do
cp ${srcdir}/${bin} ${target}/${bin}${ext}
done
cp etcd/README.md ${target}/README.md
cp etcd/etcdctl/README.md ${target}/README-etcdctl.md
cp -R etcd/Documentation ${target}/Documentation
}
function main {
mkdir -p release
cd release
setup_env ${PROJ} ${VER}
export GOOS="linux"
export GOARCH="arm"
export GOARM="7"
pushd etcd >/dev/null
./build
popd >/dev/null
TARGET="etcd-${VER}-${GOOS}-${GOARCH}"
mkdir ${TARGET}
package ${TARGET} ${PROJ}
if [ ${GOOS} == "linux" ]; then
tar cfz ${TARGET}.tar.gz ${TARGET}
echo "Wrote release/${TARGET}.tar.gz"
else
zip -qr ${TARGET}.zip ${TARGET}
echo "Wrote release/${TARGET}.zip"
fi
}
main
$ docker logs eae1e5c5cf1f
I0601 08:45:25.221781 8716 server.go:141] Running kubelet in containerized mode (experimental)
W0601 08:45:38.436128 8716 server.go:461] Could not load kubeconfig file /var/lib/kubelet/kubeconfig: stat /var/lib/kubelet/kubeconfig: no such file or directory. Trying auth path instead.
W0601 08:45:38.436300 8716 server.go:422] Could not load kubernetes auth path /var/lib/kubelet/kubernetes_auth: stat /var/lib/kubelet/kubernetes_auth: no such file or directory. Continuing with defaults.
I0601 08:45:38.438824 8716 plugins.go:71] No cloud provider specified.
I0601 08:45:38.438921 8716 server.go:328] Successfully initialized cloud provider: "" from the config file: ""
I0601 08:45:38.439719 8716 manager.go:133] cAdvisor running in container: "/docker/eae1e5c5cf1f897ede00f007d80827747d9b4915f777242e338f6f44e504751e"
W0601 08:45:38.481478 8716 manager.go:141] unable to connect to Rkt api service: rkt: cannot tcp Dial rkt api service: dial tcp [::1]:15441: getsockopt: connection refused
I0601 08:45:38.522995 8716 fs.go:116] Filesystem partitions: map[overlay:{mountpoint:/ major:0 minor:44 fsType:overlay blockSize:0} /dev/root:{mountpoint:/var/lib/docker major:179 minor:2 fsType:ext4 blockSize:0} /dev/mapper/docker-179:2-507204-2ff658a040e5e76d3f5faf7d0499c03ce63e6e53ce854f4bc394ad81fbd7f390:{mountpoint:/rootfs/var/lib/docker-bootstrap/devicemapper/mnt/2ff658a040e5e76d3f5faf7d0499c03ce63e6e53ce854f4bc394ad81fbd7f390 major:254 minor:1 fsType: blockSize:0} /dev/mapper/docker-179:2-507204-9d0d96f6f4aca172e8c47ba010f4ff80fccc52e61014e6eba76150538d5a7072:{mountpoint:/rootfs/var/lib/docker-bootstrap/devicemapper/mnt/9d0d96f6f4aca172e8c47ba010f4ff80fccc52e61014e6eba76150538d5a7072 major:254 minor:2 fsType: blockSize:0}]
E0601 08:45:38.534164 8716 machine.go:194] failed to get cache information for node 0: open /sys/devices/system/cpu/cpu0/cache: no such file or directory
I0601 08:45:40.569577 8716 manager.go:182] Machine: {NumCores:4 CpuFrequency:1200000 MemoryCapacity:970391552 MachineID:9f110c3a244648c5a6382f7abb11e1eb SystemUUID:3885d4871c6044a290feacc2c4c0786e BootID:a15af290-7e7f-4913-bff7-3f03da83b5d4 Filesystems:[{Device:overlay Capacity:29884887040 Type:vfs Inodes:7524608} {Device:/dev/root Capacity:29884887040 Type:vfs Inodes:7524608} {Device:/dev/mapper/docker-179:2-507204-2ff658a040e5e76d3f5faf7d0499c03ce63e6e53ce854f4bc394ad81fbd7f390 Capacity:10434699264 Type:vfs Inodes:655360} {Device:/dev/mapper/docker-179:2-507204-9d0d96f6f4aca172e8c47ba010f4ff80fccc52e61014e6eba76150538d5a7072 Capacity:10434699264 Type:vfs Inodes:655360}] DiskMap:map[254:0:{Name:dm-0 Major:254 Minor:0 Size:107374182400 Scheduler:none} 254:1:{Name:dm-1 Major:254 Minor:1 Size:10737418240 Scheduler:none} 254:2:{Name:dm-2 Major:254 Minor:2 Size:10737418240 Scheduler:none} 179:0:{Name:mmcblk0 Major:179 Minor:0 Size:31914983424 Scheduler:deadline}] NetworkDevices:[{Name:eth0 MacAddress:b8:27:eb:76:a7:d0 Speed:100 Mtu:1500} {Name:flannel0 MacAddress: Speed:10 Mtu:1472} {Name:wlan0 MacAddress:b8:27:eb:23:f2:85 Speed:0 Mtu:1500}] Topology:[{Id:0 Memory:0 Cores:[{Id:0 Threads:[0] Caches:[]} {Id:1 Threads:[1] Caches:[]} {Id:2 Threads:[2] Caches:[]} {Id:3 Threads:[3] Caches:[]}] Caches:[]}] CloudProvider:Unknown InstanceType:Unknown InstanceID:None}
I0601 08:45:40.577324 8716 manager.go:188] Version: {KernelVersion:4.4.10-hypriotos-v7+ ContainerOsVersion:Debian GNU/Linux 8 (jessie) DockerVersion:1.11.1 CadvisorVersion: CadvisorRevision:}
I0601 08:45:40.590443 8716 server.go:360] Using root directory: /var/lib/kubelet
I0601 08:45:40.592044 8716 server.go:694] Adding manifest file: /etc/kubernetes/manifests-multi
I0601 08:45:40.592646 8716 file.go:47] Watching path "/etc/kubernetes/manifests-multi"
I0601 08:45:40.592922 8716 server.go:704] Watching apiserver
E0601 08:45:40.598232 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:40.602213 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:40.603360 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
W0601 08:45:40.644771 8716 kubelet.go:527] Hairpin mode set to "promiscuous-bridge" but configureCBR0 is false, falling back to "hairpin-veth"
I0601 08:45:40.644937 8716 kubelet.go:371] Hairpin mode set to "hairpin-veth"
I0601 08:45:40.679696 8716 manager.go:228] Setting dockerRoot to /var/lib/docker
I0601 08:45:40.731138 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/aws-ebs"
I0601 08:45:40.731477 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/empty-dir"
I0601 08:45:40.731725 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/gce-pd"
I0601 08:45:40.731941 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/git-repo"
I0601 08:45:40.732154 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/host-path"
I0601 08:45:40.732403 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/nfs"
I0601 08:45:40.732614 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/secret"
I0601 08:45:40.732828 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/iscsi"
I0601 08:45:40.733068 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/glusterfs"
I0601 08:45:40.733343 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/persistent-claim"
I0601 08:45:40.733526 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/rbd"
I0601 08:45:40.733698 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/cinder"
I0601 08:45:40.733907 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/cephfs"
I0601 08:45:40.734133 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/downward-api"
I0601 08:45:40.734329 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/fc"
I0601 08:45:40.734533 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/flocker"
I0601 08:45:40.734700 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/azure-file"
I0601 08:45:40.734919 8716 plugins.go:291] Loaded volume plugin "kubernetes.io/configmap"
I0601 08:45:40.735380 8716 server.go:666] Started kubelet v1.3.0-alpha.4
I0601 08:45:40.736441 8716 server.go:117] Starting to listen on 0.0.0.0:10250
I0601 08:45:40.739443 8716 server.go:134] Starting to listen read-only on 0.0.0.0:10255
E0601 08:45:40.743657 8716 kubelet.go:885] Image garbage collection failed: unable to find data for container /
E0601 08:45:40.767948 8716 event.go:207] Unable to write event: 'Post http://localhost:8080/api/v1/namespaces/default/events: dial tcp [::1]:8080: getsockopt: connection refused' (may retry after sleeping)
E0601 08:45:40.793960 8716 kubelet.go:946] Failed to start ContainerManager system validation failed - Following Cgroup subsystem not mounted: [cpuset]
I0601 08:45:40.794547 8716 manager.go:123] Starting to sync pod status with apiserver
I0601 08:45:40.794872 8716 kubelet.go:2462] Starting kubelet main sync loop.
I0601 08:45:40.795067 8716 kubelet.go:2471] skipping pod synchronization - [Failed to start ContainerManager system validation failed - Following Cgroup subsystem not mounted: [cpuset] container runtime is down]
I0601 08:45:40.987230 8716 kubelet.go:2874] Recording NodeHasSufficientDisk event message for node 127.0.0.1
I0601 08:45:40.987505 8716 kubelet.go:1071] Attempting to register node 127.0.0.1
I0601 08:45:40.993423 8716 kubelet.go:1074] Unable to register 127.0.0.1 with the apiserver: Post http://localhost:8080/api/v1/nodes: dial tcp [::1]:8080: getsockopt: connection refused
I0601 08:45:40.999861 8716 factory.go:208] Registering Docker factory
E0601 08:45:41.000157 8716 manager.go:229] Registration of the rkt container factory failed: unable to communicate with Rkt api service: rkt: cannot tcp Dial rkt api service: dial tcp [::1]:15441: getsockopt: connection refused
I0601 08:45:41.000288 8716 factory.go:53] Registering systemd factory
I0601 08:45:41.045585 8716 factory.go:85] Registering Raw factory
I0601 08:45:41.106291 8716 manager.go:1024] Started watching for new ooms in manager
I0601 08:45:41.112504 8716 oomparser.go:182] oomparser using systemd
I0601 08:45:41.118324 8716 manager.go:277] Starting recovery of all containers
I0601 08:45:41.232452 8716 manager.go:282] Recovery completed
I0601 08:45:41.253046 8716 kubelet.go:2874] Recording NodeHasSufficientDisk event message for node 127.0.0.1
I0601 08:45:41.253520 8716 kubelet.go:1071] Attempting to register node 127.0.0.1
I0601 08:45:41.257234 8716 kubelet.go:1074] Unable to register 127.0.0.1 with the apiserver: Post http://localhost:8080/api/v1/nodes: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:41.611669 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:41.612498 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:41.612542 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
I0601 08:45:41.694197 8716 kubelet.go:2874] Recording NodeHasSufficientDisk event message for node 127.0.0.1
I0601 08:45:41.694877 8716 kubelet.go:1071] Attempting to register node 127.0.0.1
I0601 08:45:41.699983 8716 kubelet.go:1074] Unable to register 127.0.0.1 with the apiserver: Post http://localhost:8080/api/v1/nodes: dial tcp [::1]:8080: getsockopt: connection refused
I0601 08:45:42.536459 8716 kubelet.go:2874] Recording NodeHasSufficientDisk event message for node 127.0.0.1
I0601 08:45:42.537126 8716 kubelet.go:1071] Attempting to register node 127.0.0.1
I0601 08:45:42.542567 8716 kubelet.go:1074] Unable to register 127.0.0.1 with the apiserver: Post http://localhost:8080/api/v1/nodes: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:42.615829 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:42.617617 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:42.620466 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:43.622081 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:43.623748 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:43.625042 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
I0601 08:45:44.179533 8716 kubelet.go:2874] Recording NodeHasSufficientDisk event message for node 127.0.0.1
I0601 08:45:44.180238 8716 kubelet.go:1071] Attempting to register node 127.0.0.1
I0601 08:45:44.185022 8716 kubelet.go:1074] Unable to register 127.0.0.1 with the apiserver: Post http://localhost:8080/api/v1/nodes: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:44.626391 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:44.626540 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:44.629022 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:45.632074 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:45.632074 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:45.633917 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
I0601 08:45:45.795388 8716 kubelet.go:2471] skipping pod synchronization - [Failed to start ContainerManager system validation failed - Following Cgroup subsystem not mounted: [cpuset]]
E0601 08:45:46.635423 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:46.635887 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:46.638539 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:46.822700 8716 event.go:207] Unable to write event: 'Post http://localhost:8080/api/v1/namespaces/default/events: dial tcp [::1]:8080: getsockopt: connection refused' (may retry after sleeping)
I0601 08:45:47.419163 8716 kubelet.go:2874] Recording NodeHasSufficientDisk event message for node 127.0.0.1
I0601 08:45:47.419964 8716 kubelet.go:1071] Attempting to register node 127.0.0.1
I0601 08:45:47.423973 8716 kubelet.go:1074] Unable to register 127.0.0.1 with the apiserver: Post http://localhost:8080/api/v1/nodes: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:47.638900 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:47.638954 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:47.642254 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:48.642374 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:48.642790 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:48.645425 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:49.648240 8716 reflector.go:205] pkg/kubelet/config/apiserver.go:43: Failed to list *api.Pod: Get http://localhost:8080/api/v1/pods?fieldSelector=spec.nodeName%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:49.649020 8716 reflector.go:205] pkg/kubelet/kubelet.go:250: Failed to list *api.Service: Get http://localhost:8080/api/v1/services?resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused
E0601 08:45:49.650306 8716 reflector.go:205] pkg/kubelet/kubelet.go:269: Failed to list *api.Node: Get http://localhost:8080/api/v1/nodes?fieldSelector=metadata.name%3D127.0.0.1&resourceVersion=0: dial tcp [::1]:8080: getsockopt: connection refused

Install HypriotOS

Insert each sd card on a laptop, mine laptop OS is Mac OSX. Download the HypriotOS. Install flash before starting.

$ wget -c  https://downloads.hypriot.com/hypriotos-rpi-v0.8.0.img.zip 
$ flash -n rpi[1-n] hypriotos-rpi-v0.8.0.img.zip 

Turn on power of the cluster.

Install Ansible

On Mac do

brew install ansible

We use ansible to verify every machine is on. Firstly define an inventory file like below


[masters]
192.168.1.101

[etcd]
192.168.1.101

[nodes]
192.168.1.102
192.168.1.103
192.168.1.104
192.168.1.105
192.168.1.106
192.168.1.107
$ export ANSIBLE_HOST_KEY_CHECKING=False
$ ansible -k  -u pirate -i inventory all -m shell -a "hostname" 

The command line will prompt SSH password:, enter the default password hypriot, we will see all hosts' name.

SSH password: hypriot

192.168.1.105 | SUCCESS | rc=0 >>
rpi5

192.168.1.106 | SUCCESS | rc=0 >>
rpi6

192.168.1.102 | SUCCESS | rc=0 >>
rpi2

192.168.1.103 | SUCCESS | rc=0 >>
rpi3

192.168.1.104 | SUCCESS | rc=0 >>
rpi4

192.168.1.107 | SUCCESS | rc=0 >>
rpi7

192.168.1.101 | SUCCESS | rc=0 >>
rpi1

Here very likely you will run into a MODULE FAILURE, add '-vvvv' on the previous ansible script. You will see it's because HypriotOS by default doesn't install python. You need to write a shell script install it on every machine.

Enable keyless login

$ ansible-playbook -k -u pirate -i inventory cluster.yml  --tags enable-keyless

Build Golang

env GOROOT_BOOTSTRAP=$HOME/go-linux-arm-bootstrap GOOS=linux GOARCH=arm GOARM=7 ./make.bash --no-banner

Compile kubernetes, etcd and fannel

etcd tar ball

./build-etcd v2.3.6

http://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5 http://dave.cheney.net/2013/07/09/an-introduction-to-cross-compilation-with-go-1-1

sudo journalctl | grep -i etcd 

Install docker on raspbian https://packagecloud.io/Hypriot/Schatzkiste/install

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
sudo apt-get update
sudo apt-get install oracle-java8-installer
FLANNEL_NETWORK=10.1.0.0/16
FLANNEL_SUBNET=10.1.98.1/24
FLANNEL_MTU=1472
FLANNEL_IPMASQ=true
docker run -d -p 8500:8500 -v /data hypriot/rpi-consul agent -server -data-dir /data -bootstrap-expect 1 -ui-dir /ui -client 0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment