-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloud-init.yaml
executable file
·124 lines (124 loc) · 4.16 KB
/
cloud-init.yaml
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
bootcmd:
- "curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -"
- "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -"
- "sed -ie '/GRUB_CMDLINE_LINUX=/s/\"\"/\"systemd.unified_cgroup_hierarchy=1\"/g' /etc/default/grub"
- "sudo update-grub"
apt:
sources:
kubernetes:
source: "deb https://apt.kubernetes.io/ kubernetes-xenial main"
docker:
source: "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
package_update: true
packages:
- colorized-logs
- containerd.io
- cowsay
- docker-ce
- docker-ce-cli
- git
- jq
- letsencrypt
- make
- net-tools
- pacman
- pv
- tmux
- tree
- socat
- wget
write_files:
- path: /etc/sysctl.d/vm-max_map_count.conf
content: |
vm.max_map_count=524288
- path: /etc/sysctl.d/inotify.conf
content: |
fs.inotify.max_user_watches = 131072
fs.inotify.max_user_instances = 131072
- path: /etc/sysctl.d/fs-file-max.conf
content: |
fs.file-max=131072
- path: /etc/security/limits.d/global.conf
content: |
* hard nofile 131072
* soft nofile 131072
* hard nproc 8192
* soft nproc 8192
- path: /etc/sysctl.d/k8s.conf
content: |
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
- path: /etc/docker/daemon.json
content: |
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
- path: /root/.tool-versions
content: |
##asdfdsa## grep -v '^#' ~/.tool-versions|while read -r line; do NAME=$(echo $line|awk '{print $1}'); URL=$(echo $line|grep -o "#https://.*$"|sed 's/^#//g'); echo "[*] adding asdf plugin $NAME $URL"; asdf plugin add $NAME $URL; done
##asdfdsa## asdf install
##asdfdsa## asdf direnv setup --shell bash --version latest
##asdfdsa## kubectl krew install < /root/krew-plugin-list.txt
##asdfdsa## asdf reshim
bat 0.23.0
bottom 0.8.0
direnv 2.32.3
flux2 2.1.1
golang 1.19.6
helm 3.13.0
helm-diff 3.8.1
istioctl 1.19.1
k3d 5.6.0
kind 0.20.0
krew 0.4.4
kubectl 1.27.6 system
kustomize 4.5.7
mkcert 1.4.4
nodejs 19.7.0
- path: /root/krew-plugin-list.txt
content: |
ctx
df-pv
get-all
grep
images
node-shell
ns
pod-dive
resource-snapshot
stern
tail
view-secret
whoami
- path: /root/final-setup.sh
content: |
echo "[*] OPTIONALLY CLONE THIS REPO..."
echo "git clone https://repo1.dso.mil/platform-one/big-bang/bigbang /root/bigbang-upstream"
read -p "[*] Press any key to continue... " -n1 -s; echo
asdfdsa
echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
echo "source <(flux completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
echo "alias k=kubectl" >> ~/.bashrc
echo "complete -o default -F __start_kubectl k" >> ~/.bashrc
runcmd:
- sed -ie '/GRUB_CMDLINE_LINUX=/s/\"\"/\"systemd.unified_cgroup_hierarchy=1\"/g' /etc/default/grub
- sudo update-grub
- sed -i '/^# end of pam-auth-update config/isession required pam_limits.so' /etc/pam.d/common-session
- printf "xt_REDIRECT\nxt_owner\nxt_statistic\n" | sudo tee -a /etc/modules
- sysctl --system
- git clone https://github.com/asdf-vm/asdf.git /root/.asdf --branch v0.13.1
- echo '. /root/.asdf/asdf.sh' >> /root/.bashrc
- echo '. /root/.asdf/completions/asdf.bash' >> /root/.bashrc
- echo '. /root/.asdf/lib/asdf-bash-fun.bash' >> /root/.bashrc
- echo 'export EDITOR=vi' >> /root/.bashrc
- echo 'set -o vi' >> /root/.bashrc
- echo 'export PATH="${PATH}:${HOME}/.krew/bin"' >> /root/.bashrc
- curl -sLo /root/.asdf/lib/asdf-bash-fun.bash https://gist.githubusercontent.com/MxNxPx/0e68b32f399736a60bb53657bea11ca7/raw/asdf-bash-fun
- curl -sLo /usr/local/share/demo-magic.sh https://raw.githubusercontent.com/paxtonhare/demo-magic/master/demo-magic.sh
- reboot
final_message: "[*] System setup complete | uptime: $UPTIME"