blob: 774205d851e50e9b43c6ab54c3f890fda8f14d73 [file] [log] [blame]
garciadeblasd7f51852025-11-30 19:54:43 +01001#!/bin/bash
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16set -e -o pipefail
17
18export DEBIAN_FRONTEND=noninteractive
19apt-get update
20
21# Install git, curl, tar
22DEBIAN_FRONTEND=noninteractive apt-get install -y git curl tar
23
24# Helm
25HELM_VERSION="v3.15.1"
26# Helm releases can be found here: https://github.com/helm/helm/releases
27if ! [[ "$(helm version --short 2>/dev/null)" =~ ^v3.* ]]; then
28 # Helm is not installed. Install helm
29 echo "Helm3 is not installed, installing ..."
30 curl https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz -o helm-${HELM_VERSION}.tar.gz
31 tar -zxvf helm-${HELM_VERSION}.tar.gz
32 mv linux-amd64/helm /usr/local/bin/helm
33 rm -r linux-amd64
34 rm helm-${HELM_VERSION}.tar.gz
35else
36 echo "Helm3 is already installed. Skipping installation..."
37fi
38helm version || FATAL_TRACK k8scluster "Could not obtain helm version. Maybe helm client was not installed"
39helm repo add stable https://charts.helm.sh/stable || FATAL_TRACK k8scluster "Helm repo stable could not be added"
40helm repo update || FATAL_TRACK k8scluster "Helm repo stable could not be updated"
41echo "helm installed"
42
43# Install kubectl client
44K8S_CLIENT_VERSION="v1.29.3"
45curl -LO "https://dl.k8s.io/release/${K8S_CLIENT_VERSION}/bin/linux/amd64/kubectl"
46install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
47rm kubectl
48echo "kubectl installed"
49
50# Install `gnupg` and `gpg` - Typically pre-installed in Ubuntu
51DEBIAN_FRONTEND=noninteractive apt-get install gnupg gpg -y
52echo "gnupg and gpg installed"
53
54# Install `sops`
55curl -LO https://github.com/getsops/sops/releases/download/v3.8.1/sops-v3.8.1.linux.amd64
56mv sops-v3.8.1.linux.amd64 /usr/local/bin/sops
57chmod +x /usr/local/bin/sops
58echo "sops client installed"
59
60# Install `envsubst`
61DEBIAN_FRONTEND=noninteractive apt-get install gettext-base -y
62echo "envsubst installed"
63
64# Install `age`
65AGE_VERSION="v1.1.0"
66curl -LO https://github.com/FiloSottile/age/releases/download/${AGE_VERSION}/age-${AGE_VERSION}-linux-amd64.tar.gz
67tar xvfz age-${AGE_VERSION}-linux-amd64.tar.gz
68mv age/age age/age-keygen /usr/local/bin/
69chmod +x /usr/local/bin/age*
70rm -rf age age-${AGE_VERSION}-linux-amd64.tar.gz
71echo "age installed"
72
73# (Only for Gitea) Install `apg`
74DEBIAN_FRONTEND=noninteractive apt-get install apg -y
75echo "apg installed"
76
77# # (Only for Minio) `kubectl minio` plugin and Minio Client
78MINIO_CLIENT_VERSION="5.0.12"
79if [ -n "${INSTALL_MINIO}" ]; then
80 curl https://github.com/minio/operator/releases/download/v${MINIO_CLIENT_VERSION}/kubectl-minio_${MINIO_CLIENT_VERSION}_linux_amd64 -Lo kubectl-minio
81 curl https://dl.min.io/client/mc/release/linux-amd64/mc -o minioc
82 chmod +x kubectl-minio minioc
83 mv kubectl-minio minioc /usr/local/bin/
84 # (Only for HTTPS Ingress for Minio tenant) Install `openssl`
85 DEBIAN_FRONTEND=noninteractive apt-get install openssl -y
86fi
87echo "minio client installed"
88
89# Flux client
90FLUX_CLI_VERSION="2.4.0"
91curl -s https://fluxcd.io/install.sh | FLUX_VERSION=${FLUX_CLI_VERSION} bash
92# Autocompletion
93. <(flux completion bash)
94echo "flux client installed"
95
96# Argo client
97ARGO_VERSION="v3.5.7"
98curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz
99gunzip argo-linux-amd64.gz
100chmod +x argo-linux-amd64
101mv ./argo-linux-amd64 /usr/local/bin/argo
102echo "argo client installed"
103
104# Kustomize
105KUSTOMIZE_VERSION="5.4.3"
106curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- ${KUSTOMIZE_VERSION}
107install -o root -g root -m 0755 kustomize /usr/local/bin/kustomize
108rm kustomize
109echo "kustomized installed"
110
111# yq
112VERSION=v4.33.3
113BINARY=yq_linux_amd64
114curl -L https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -o yq
115mv yq /usr/local/bin/yq
116chmod +x /usr/local/bin/yq
117echo "yq installed"