-
Notifications
You must be signed in to change notification settings - Fork 33
/
akka-pi-os-display.yml
163 lines (141 loc) · 4.16 KB
/
akka-pi-os-display.yml
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#cloud-config
# vim: syntax=yaml
#
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
hostname: static
manage_etc_hosts: false
# don't write debian.org into apt mirrors
apt_preserve_sources_list: true
packages:
# You could modify this for your own user information
users:
- name: pirate
gecos: "Hypriot Pirate"
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
groups: users,docker,video
plain_text_passwd: hypriot
lock_passwd: false
ssh_pwauth: true
chpasswd: { expire: false }
- name: akkapi
gecos: "Akka Cluster Pi User"
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
groups: users,docker,video
plain_text_passwd: akkapi
lock_passwd: false
ssh_pwauth: true
chpasswd: { expire: false }
package_upgrade: false
# Static IP address
write_files:
- content: |
persistent
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# static IP configuration:
interface eth0
static ip_address=192.168.1.100/24
# static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1 8.8.8.8
interface wlan0
metric 204
static ip_address=192.168.8.100/24
static routers=192.168.8.1
static domain_name_servers=192.168.8.1 8.8.8.8
path: /etc/dhcpcd.conf
- content: |
# Cluster #0
192.168.1.100 node-0
192.168.1.101 node-1
192.168.1.102 node-2
192.168.1.103 node-3
192.168.1.104 node-4
path: /etc/cluster-hosts
- content: |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get -y upgrade
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -qy kubelet kubeadm kubectl kubernetes-cni
owner: root:staff
permissions: '0755'
path: /usr/local/bin/install-kubernetes
- content: |
hdmi_force_hotplug=1
enable_uart=0
start_x=0
disable_camera_led=1
gpu_mem=16
dtparam=audio=on
#turn spi on for display
dtparam=spi=on
path: /boot/config.txt
- content: |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="GL-MT300N-V2-e9f"
psk="goodlife"
}
path: /etc/wpa_supplicant/wpa_supplicant.conf
- content: |
#!/bin/bash -e
cat > /home/akkapi/.profile-tmux <<EOF
tnr() {
tmux new -s run
}
tr() {
tmux attach -t run
}
tnl() {
tmux new -s log
}
tl() {
tmux attach -t log
}
tkillall() {
for session in \`tmux ls | sed -e 's/:.*//'\`;do
tmux kill-session -t \$session
done
}
EOF
cat >> /home/akkapi/.profile <<EOF
. .profile-tmux
EOF
owner: root:staff
permissions: '0755'
path: /usr/local/bin/finish-install
# These commands will be ran once on first boot only
runcmd:
- systemctl restart dhcpcd
# need some time while node joined wifi network
- sleep 5s
# debig info if wifi is connected
- iwconfig wlan0
# Install a few extra packages - this could be done in the package section
- apt-get update
- apt-get -y install tmux
- apt-get -y install file
- apt-get -y install jq
- apt-get -y install dnsutils
- apt-get -y apt-install transport-https
- apt-get -y install zip
- apt-get -y install iftop
- apt-get -y install wiringpi
# Add cluster hosts to /etc/hosts
- cat /etc/cluster-hosts >> /etc/hosts
- rm /etc/cluster-hosts
- systemctl restart avahi-daemon
# Install AdoptOpenJDK 11
- wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
- echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb buster main" | tee /etc/apt/sources.list.d/adoptopenjdk.list
- apt-get update
- apt-get install -y adoptopenjdk-11-hotspot
#need reboot to make spi=on
power_state:
mode: reboot