| garciadeblas | 64e1a8e | 2025-11-27 17:47:18 +0100 | [diff] [blame] | 1 | #!/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 | |
| 16 | set -e -o pipefail |
| 17 | |
| 18 | apk add --no-cache curl tar |
| 19 | |
| 20 | # Helm |
| 21 | HELM_VERSION="v3.15.1" |
| 22 | # Helm releases can be found here: https://github.com/helm/helm/releases |
| 23 | if ! [[ "$(helm version --short 2>/dev/null)" =~ ^v3.* ]]; then |
| 24 | # Helm is not installed. Install helm |
| 25 | echo "Helm3 is not installed, installing ..." |
| 26 | curl https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz -o helm-${HELM_VERSION}.tar.gz |
| 27 | tar -zxvf helm-${HELM_VERSION}.tar.gz |
| 28 | mv linux-amd64/helm /usr/local/bin/helm |
| 29 | rm -r linux-amd64 |
| 30 | rm helm-${HELM_VERSION}.tar.gz |
| 31 | else |
| 32 | echo "Helm3 is already installed. Skipping installation..." |
| 33 | fi |
| 34 | helm version || FATAL_TRACK k8scluster "Could not obtain helm version. Maybe helm client was not installed" |
| 35 | helm repo add stable https://charts.helm.sh/stable || FATAL_TRACK k8scluster "Helm repo stable could not be added" |
| 36 | helm repo update || FATAL_TRACK k8scluster "Helm repo stable could not be updated" |
| 37 | echo "helm installed" |
| 38 | |
| 39 | # Install kubectl client |
| 40 | K8S_CLIENT_VERSION="v1.29.3" |
| 41 | curl -LO "https://dl.k8s.io/release/${K8S_CLIENT_VERSION}/bin/linux/amd64/kubectl" |
| 42 | install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl |
| 43 | rm kubectl |
| 44 | echo "kubectl installed" |
| 45 | |
| 46 | # Install `gnupg` and `gpg` - Typically pre-installed in Ubuntu |
| 47 | apk add --no-cache gnupg gpg |
| 48 | echo "gnupg and gpg installed" |
| 49 | |
| 50 | # Install `sops` |
| 51 | curl -LO https://github.com/getsops/sops/releases/download/v3.8.1/sops-v3.8.1.linux.amd64 |
| 52 | mv sops-v3.8.1.linux.amd64 /usr/local/bin/sops |
| 53 | chmod +x /usr/local/bin/sops |
| 54 | echo "sops client installed" |
| 55 | |
| 56 | # Install `envsubst` |
| 57 | apk add --no-cache envsubst |
| 58 | echo "envsubst installed" |
| 59 | |
| 60 | # Install `age` |
| 61 | AGE_VERSION="v1.1.0" |
| 62 | curl -LO https://github.com/FiloSottile/age/releases/download/${AGE_VERSION}/age-${AGE_VERSION}-linux-amd64.tar.gz |
| 63 | tar xvfz age-${AGE_VERSION}-linux-amd64.tar.gz |
| 64 | mv age/age age/age-keygen /usr/local/bin/ |
| 65 | chmod +x /usr/local/bin/age* |
| 66 | rm -rf age age-${AGE_VERSION}-linux-amd64.tar.gz |
| 67 | echo "age installed" |
| 68 | |
| 69 | # (Only for Gitea) Install `apg` |
| 70 | apk add --no-cache apg |
| 71 | echo "apg installed" |
| 72 | |
| 73 | # # (Only for Minio) `kubectl minio` plugin and Minio Client |
| 74 | MINIO_CLIENT_VERSION="5.0.12" |
| 75 | if [ -n "${INSTALL_MINIO}" ]; then |
| 76 | curl https://github.com/minio/operator/releases/download/v${MINIO_CLIENT_VERSION}/kubectl-minio_${MINIO_CLIENT_VERSION}_linux_amd64 -Lo kubectl-minio |
| 77 | curl https://dl.min.io/client/mc/release/linux-amd64/mc -o minioc |
| 78 | chmod +x kubectl-minio minioc |
| 79 | mv kubectl-minio minioc /usr/local/bin/ |
| 80 | # (Only for HTTPS Ingress for Minio tenant) Install `openssl` |
| 81 | apk add --no-cache openssl |
| 82 | fi |
| 83 | echo "minio client installed" |
| 84 | |
| 85 | # Flux client |
| 86 | FLUX_CLI_VERSION="2.4.0" |
| 87 | curl -s https://fluxcd.io/install.sh | FLUX_VERSION=${FLUX_CLI_VERSION} bash |
| 88 | # Autocompletion |
| 89 | . <(flux completion bash) |
| 90 | echo "flux client installed" |
| 91 | |
| 92 | # Argo client |
| 93 | ARGO_VERSION="v3.5.7" |
| 94 | curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz |
| 95 | gunzip argo-linux-amd64.gz |
| 96 | chmod +x argo-linux-amd64 |
| 97 | mv ./argo-linux-amd64 /usr/local/bin/argo |
| 98 | echo "argo client installed" |
| 99 | |
| 100 | # Kustomize |
| 101 | KUSTOMIZE_VERSION="5.4.3" |
| 102 | curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- ${KUSTOMIZE_VERSION} |
| 103 | install -o root -g root -m 0755 kustomize /usr/local/bin/kustomize |
| 104 | rm kustomize |
| 105 | echo "kustomized installed" |
| 106 | |
| 107 | # yq |
| 108 | VERSION=v4.33.3 |
| 109 | BINARY=yq_linux_amd64 |
| 110 | curl -L https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -o yq |
| 111 | mv yq /usr/local/bin/yq |
| 112 | chmod +x /usr/local/bin/yq |
| 113 | echo "yq installed" |