Skip to content

Instantly share code, notes, and snippets.

@winggundamth
Last active March 6, 2023 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save winggundamth/ee8b986d68d09214018b8ed20e130316 to your computer and use it in GitHub Desktop.
Save winggundamth/ee8b986d68d09214018b8ed20e130316 to your computer and use it in GitHub Desktop.
Cloud Shell Preparation Script for SDT1 Training
#!/bin/sh
# Generate SSH
[[ ! -f ~/.ssh/id_rsa ]] && ssh-keygen -f ~/.ssh/id_rsa -N ""
# Install Docker Compose v2
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
docker compose version
# Install Helm
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
helm version
# Install Hashicorp Vault CLI
sudo apt update
sudo apt install vault
# Install ArgoCD CLI
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64
# Put Bash Completion into .bashrc file
if ! grep -q 'kubectl completion bash' ~/.bashrc
then
tee -a ~/.bashrc > /dev/null <<EOT
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
if ! grep -q 'kubectl completion bash' ~/.bashrc &> /dev/null
then
# Bash Completion
. <(kubectl completion bash)
. <(helm completion bash)
fi
EOT
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment