forked from jkneubuh/full-stack-asset-transfer-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathec2-cloud-config.yaml
More file actions
59 lines (50 loc) · 2.13 KB
/
ec2-cloud-config.yaml
File metadata and controls
59 lines (50 loc) · 2.13 KB
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
#cloud-config
write_files:
- path: /config/provision-root.sh
permissions: '0744'
content: |
#!/usr/bin/env bash
set -ex
# set -o errexit
# set -o pipefail
# APT setup for kubectl
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
# Install kubectl
apt-get -y --no-upgrade install kubectl
# Install yq
YQ_VERSION=4.23.1
if [ ! -x "/usr/local/bin/yq" ]; then
curl --fail --silent --show-error -L "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64" -o /usr/local/bin/yq
chmod 755 /usr/local/bin/yq
fi
# Install kind
KIND_VERSION=0.14.0
if [ ! -x "/usr/local/bin/kind" ]; then
curl --fail --silent --show-error -L "https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-linux-amd64" -o /usr/local/bin/kind
chmod 755 /usr/local/bin/kind
fi
# Install k9s
K9S_VERSION=0.25.3
if [ ! -x "/usr/local/bin/k9s" ]; then
curl --fail --silent --show-error -L "https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/k9s_Linux_x86_64.tar.gz" -o "/tmp/k9s_Linux_x86_64.tar.gz"
tar -zxf "/tmp/k9s_Linux_x86_64.tar.gz" -C /usr/local/bin k9s
chown root:root /usr/local/bin/k9s
chmod 755 /usr/local/bin/k9s
fi
# Install just
JUST_VERSION=1.2.0
if [ ! -x "/usr/local/bin/just" ]; then
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --tag ${JUST_VERSION} --to /usr/local/bin
chown root:root /usr/local/bin/just
chmod 755 /usr/local/bin/just
fi
runcmd:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
- add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- apt-get update -y
- apt-get install -y docker.io
- usermod -a -G docker ubuntu
- apt-get install -y jq
- /config/provision-root.sh
final_message: "The system is finally up, after $UPTIME seconds"