-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·320 lines (269 loc) · 12.9 KB
/
init.sh
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
#!/usr/bin/env bash
main() {
# @see https://github.com/hashicorp/packer/issues/2639
/usr/bin/cloud-init status --wait
# Manage software versions installed here
AGE_VERSION=1.1.1
ARGO_VERSION=3.5.5
ARGOCD_VERSION=2.10.7
BOSH_VERSION=7.5.6
CF_VERSION=8.7.10
CREDHUB_VERSION=2.9.22
HELM_VERSION=3.14.4
HELMFILE_VERSION=0.158.1
AWS_IAM_AUTHENTICATOR_VERSION=0.6.20
IMGPKG_VERSION=0.42.1
K9S_VERSION=0.32.4
KAPP_VERSION=0.62.0
KBLD_VERSION=0.43.0
KCTRL_VERSION=0.52.0
KIND_VERSION=0.23.0
KPACK_CLI_VERSION=0.13.0
KWT_VERSION=0.0.8
KUBECTL_VERSION=1.29.4
KNATIVE_VERSION=1.13.0
LEFTOVERS_VERSION=0.62.0
OCI_CLI_VERSION=3.40.3
OM_VERSION=7.10.1
PINNIPED_VERSION=0.29.0
PIVNET_VERSION=4.1.1
RELOK8S_VERSION=0.5.4
SOPS_VERSION=3.8.1
TEKTONCD_VERSION=0.36.0
TERRAFORM_VERSION=1.8.0
TERRAFORM_DOCS_VERSION=0.17.0
VELERO_VERSION=1.13.2
VENDIR_VERSION=0.40.1
YTT_VERSION=0.49.0
DEBIAN_FRONTEND=noninteractive
# Place ourselves in a temporary directory; don't clutter user.home directory w/ downloaded artifacts
cd /tmp || exit
# Set timezone
TZ=America/Los_Angeles
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Bring OS package management up-to-date
apt update -y
apt upgrade -y
# Install packages from APT
apt install build-essential curl default-jre git golang-go gpg graphviz gzip httpie libnss3-tools jq openssl pv python3-pip python3-dev python3-venv ruby-dev snapd sudo tmux tree tzdata unzip wget -y
apt install apt-transport-https ca-certificates gnupg lsb-release software-properties-common dirmngr vim -y
add-apt-repository ppa:cncf-buildpacks/pack-cli -y
apt install pack-cli -y
# Install packages from Snap
sudo snap install snap-store
sudo snap install cvescan
# Install Github CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
# Install K9s
curl -LO https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/k9s_Linux_amd64.tar.gz
tar -xvf k9s_Linux_amd64.tar.gz
rm -Rf k9s_Linux_amd64.tar.gz
sudo mv k9s /usr/local/bin
# Install NodeJS
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install Python 3
python3 -m pip install --user --upgrade pip
python3 -m pip install --user virtualenv
# Install eksctl
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
# Install Docker Engine
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
sudo groupadd docker
sudo usermod -aG docker ubuntu
newgrp docker
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
docker run --rm hello-world
# Install AWS CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
# Install AWS IAM Authenticator
curl -Lo aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${AWS_IAM_AUTHENTICATOR_VERSION}/aws-iam-authenticator_${AWS_IAM_AUTHENTICATOR_VERSION}_linux_amd64
chmod +x aws-iam-authenticator
sudo mv aws-iam-authenticator /usr/local/bin
# Install Azure CLI
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# Install Google Cloud SDK
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
apt update -y && apt install google-cloud-cli google-cloud-sdk-gke-gcloud-auth-plugin -y
# Install Oracle Cloud CLI
curl -LO https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh
chmod +x install.sh
./install.sh --accept-all-defaults --oci-cli-version ${OCI_CLI_VERSION}
# Install Cloud Foundry UAA CLI
gem install cf-uaac
# Install age file encryption
curl -LO https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-linux-amd64.tar.gz
tar -xvf age-v${AGE_VERSION}-linux-amd64.tar.gz
rm -Rf age-v${AGE_VERSION}-linux-amd64.tar.gz
sudo mv age/age* /usr/local/bin
# Install BOSH CLI
wget https://github.com/cloudfoundry/bosh-cli/releases/download/v${BOSH_VERSION}/bosh-cli-${BOSH_VERSION}-linux-amd64
mv bosh-cli-${BOSH_VERSION}-linux-amd64 bosh
chmod +x bosh
sudo mv bosh /usr/local/bin
# Install Cloud Foundry CLI
wget -O cf.tgz "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=${CF_VERSION}&source=github-rel"
tar -xvf cf.tgz
rm -Rf cf.tgz
sudo cp cf8 /usr/local/bin/cf
# Install Credhub CLI
wget https://github.com/cloudfoundry/credhub-cli/releases/download/${CREDHUB_VERSION}/credhub-linux-${CREDHUB_VERSION}.tgz
tar -xvzf credhub-linux-${CREDHUB_VERSION}.tgz
rm -Rf credhub-linux-${CREDHUB_VERSION}.tgz
sudo mv credhub /usr/local/bin
# Install kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl
chmod +x kubectl
sudo mv kubectl /usr/local/bin
# Install Knative
curl -L -o kn https://github.com/knative/client/releases/download/knative-v${KNATIVE_VERSION}/kn-linux-amd64
chmod +x kn
sudo mv kn /usr/local/bin
# Install Operations Manager CLI (for Cloud Foundry)
wget https://github.com/pivotal-cf/om/releases/download/${OM_VERSION}/om-linux-amd64-${OM_VERSION}
mv om-linux-amd64-${OM_VERSION} om
chmod +x om
sudo mv om /usr/local/bin
# Install Tanzu Network CLI (formerly Pivotal Network CLI)
wget https://github.com/pivotal-cf/pivnet-cli/releases/download/v${PIVNET_VERSION}/pivnet-linux-amd64-${PIVNET_VERSION}
mv pivnet-linux-amd64-${PIVNET_VERSION} pivnet
chmod +x pivnet
sudo mv pivnet /usr/local/bin
# Install Terraform
wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip
rm -f terraform_${TERRAFORM_VERSION}_linux_amd64.zip
sudo mv terraform /usr/local/bin
# Install Terraform-Docs
curl -Lo ./terraform-docs https://github.com/segmentio/terraform-docs/releases/download/v${TERRAFORM_DOCS_VERSION}/terraform-docs-v${TERRAFORM_DOCS_VERSION}-"$(uname | tr '[:upper:]' '[:lower:]')-amd64"
chmod +x ./terraform-docs
sudo mv terraform-docs /usr/local/bin
# Install leftovers - helps to clean up orphaned resources created in a public cloud
wget https://github.com/genevieve/leftovers/releases/download/v${LEFTOVERS_VERSION}/leftovers-v${LEFTOVERS_VERSION}-linux-amd64
mv leftovers-v${LEFTOVERS_VERSION}-linux-amd64 leftovers
chmod +x leftovers
sudo mv leftovers /usr/local/bin
# Install Tanzu CLI (and plugins)
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub | sudo gpg --dearmor -o /etc/apt/keyrings/tanzu-archive-keyring.gpg
echo "deb [signed-by=/etc/apt/keyrings/tanzu-archive-keyring.gpg] https://storage.googleapis.com/tanzu-cli-os-packages/apt tanzu-cli-jessie main" | sudo tee /etc/apt/sources.list.d/tanzu.list
sudo apt update
sudo apt install -y tanzu-cli
tanzu config eula accept
TANZU_CLI_CEIP_OPT_IN_PROMPT_ANSWER="no"
tanzu plugin group search
tanzu plugin install --group vmware-tanzucli/essentials
tanzu plugin install --group vmware-tap/default
tanzu plugin install --group vmware-tap_saas/app-developer
tanzu plugin install --group vmware-tap_saas/platform-engineer
tanzu plugin install --group vmware-tkg/default
tanzu plugin install --group vmware-tmc/default
tanzu plugin install --group vmware-vsphere/default
# Install Helm
curl -LO "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz"
tar -xvf helm-v${HELM_VERSION}-linux-amd64.tar.gz
sudo mv linux-amd64/helm /usr/local/bin
# Install Helmfile
curl -LO "https://github.com/helmfile/helmfile/releases/download/v${HELMFILE_VERSION}/helmfile_${HELMFILE_VERSION}_linux_amd64.tar.gz"
tar -xvf helmfile_${HELMFILE_VERSION}_linux_amd64.tar.gz
sudo mv helmfile /usr/local/bin
# Install full complement of Carvel toolset
wget -O imgpkg https://github.com/vmware-tanzu/carvel-imgpkg/releases/download/v${IMGPKG_VERSION}/imgpkg-linux-amd64
chmod +x imgpkg
sudo mv imgpkg /usr/local/bin
wget -O ytt https://github.com/vmware-tanzu/carvel-ytt/releases/download/v${YTT_VERSION}/ytt-linux-amd64
chmod +x ytt
sudo mv ytt /usr/local/bin
wget -O vendir https://github.com/vmware-tanzu/carvel-vendir/releases/download/v${VENDIR_VERSION}/vendir-linux-amd64
chmod +x vendir
sudo mv vendir /usr/local/bin
wget -O kapp https://github.com/vmware-tanzu/carvel-kapp/releases/download/v${KAPP_VERSION}/kapp-linux-amd64
chmod +x kapp
sudo mv kapp /usr/local/bin
wget -O kbld https://github.com/vmware-tanzu/carvel-kbld/releases/download/v${KBLD_VERSION}/kbld-linux-amd64
chmod +x kbld
sudo mv kbld /usr/local/bin
wget -O kwt https://github.com/vmware-tanzu/carvel-kwt/releases/download/v${KWT_VERSION}/kwt-linux-amd64
chmod +x kwt
sudo mv kwt /usr/local/bin
wget -O kctrl https://github.com/vmware-tanzu/carvel-kapp-controller/releases/download/v${KCTRL_VERSION}/kctrl-linux-amd64
chmod +x kctrl
sudo mv kctrl /usr/local/bin
# Install Minio CLI
curl -LO https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo mv mc /usr/local/bin
# Install Argo CD and Argo Workflows CLIs
wget -O argocd https://github.com/argoproj/argo-cd/releases/download/v${ARGOCD_VERSION}/argocd-linux-amd64
chmod +x argocd
sudo mv argocd /usr/local/bin
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v${ARGO_VERSION}/argo-linux-amd64.gz
gunzip argo-linux-amd64.gz
chmod +x argo-linux-amd64
sudo mv argo-linux-amd64 /usr/local/bin/argo
# Install Tekton CD CLI
curl -LO https://github.com/tektoncd/cli/releases/download/v${TEKTONCD_VERSION}/tkn_${TEKTONCD_VERSION}_Linux_x86_64.tar.gz
tar -xvf tkn_${TEKTONCD_VERSION}_Linux_x86_64.tar.gz
chmod +x tkn
sudo mv tkn /usr/local/bin
# Install mkcert
git clone https://github.com/FiloSottile/mkcert && cd mkcert || exit
go build -ldflags "-X main.Version=$(git describe --tags)"
sudo mv mkcert /usr/local/bin
cd ..
rm -Rf mkcert
# Install kpack-cli
curl -Lo ./kp https://github.com/vmware-tanzu/kpack-cli/releases/download/v${KPACK_CLI_VERSION}/kp-linux-${KPACK_CLI_VERSION}
chmod +x ./kp
sudo mv ./kp /usr/local/bin
# Install kind
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin
# Install Velero
curl -LO https://github.com/vmware-tanzu/velero/releases/download/v${VELERO_VERSION}/velero-v${VELERO_VERSION}-linux-amd64.tar.gz
tar -xvf velero-v${VELERO_VERSION}-linux-amd64.tar.gz
chmod +x velero-v${VELERO_VERSION}-linux-amd64/velero
sudo mv velero-v${VELERO_VERSION}-linux-amd64/velero /usr/local/bin
# Install cmctl; @see https://cert-manager.io/docs/usage/cmctl/
curl -L -o cmctl.tar.gz https://github.com/jetstack/cert-manager/releases/latest/download/cmctl-linux-amd64.tar.gz
tar xzf cmctl.tar.gz
sudo mv cmctl /usr/local/bin
# Install relok8s
curl -LO https://github.com/vmware-tanzu/asset-relocation-tool-for-kubernetes/releases/download/v${RELOK8S_VERSION}/relok8s_${RELOK8S_VERSION}_linux_x86_64.tar.gz
tar -xvf relok8s_${RELOK8S_VERSION}_linux_x86_64.tar.gz
chmod +x relok8s
sudo mv relok8s /usr/local/bin
# Install Mozilla Secrets for Operations
curl -LO https://github.com/mozilla/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64
mv sops-v${SOPS_VERSION}.linux.amd64 sops
chmod +x sops
sudo mv sops /usr/local/bin
# Install pinniped
curl -Lso pinniped https://get.pinniped.dev/v${PINNIPED_VERSION}/pinniped-cli-linux-amd64
chmod +x pinniped
sudo mv pinniped /usr/local/bin
# Install yq
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod a+x /usr/local/bin/yq
# Clean-up APT cache
rm -Rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
apt clean
}
main