Setting Up Google Cloud Shell

Setting Up Google Cloud Shell #

Throughout the course of the workshop, you will use various tools to complete the labs. Cloud Shell comes with most of the tools you will need but we will install an additional few now.

Create a Local Bin Directory #

Cloud Shell is an ephemeral work environment. On restarts, only the contents within your home directory will persist. Create a dedicated bin directory in your home:

cd $HOME

mkdir $HOME/bin

PATH=$HOME/bin:$PATH

Installing Helm #

Helm is a package manager for Kubernetes applications. Helm Charts help you define, install, and upgrade Kubernetes applications easily. To install Helm, run the following commands:

curl -fsSL -o $HOME/bin/helm-v3.12.1-linux-amd64.tar.gz https://get.helm.sh/helm-v3.12.1-linux-amd64.tar.gz

tar -zxvf $HOME/bin/helm-v3.12.1-linux-amd64.tar.gz -C $HOME/bin && mv $HOME/bin/linux-amd64/helm $HOME/bin/helm

Installing Terraform #

Terraform is an Infrastructure as Code (IaC) tool to provision and manage infrastructure. To install Terraform, run the following commands:

curl -fsSL -o $HOME/bin/terraform_1.5.7_linux_amd64.zip https://releases.hashicorp.com/terraform/1.5.7/terraform_1.5.7_linux_amd64.zip

unzip $HOME/bin/terraform_1.5.7_linux_amd64.zip -d $HOME/bin/

rm $HOME/bin/terraform_1.5.7_linux_amd64.zip

Installing Vault #

HashiCorp Vault is an identity-based secrets and encryption management system. To install Vault, run the following command:

curl -fsSL -o $HOME/bin/vault_1.14.2_linux_amd64.zip https://releases.hashicorp.com/vault/1.14.2/vault_1.14.2_linux_amd64.zip

unzip $HOME/bin/vault_1.14.2_linux_amd64.zip -d $HOME/bin/

rm $HOME/bin/vault_1.14.2_linux_amd64.zip

Installing the Apache HTTP Server Benchmarking Tool #

The Apache ab tool is used for benchmarking your HTTP servers. To install it, run the following command:

sudo apt-get update
sudo apt install apache2-utils -y

Installing ArgoCD CLI #

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. To install the ArgoCD CLI, run the following commands:

curl -sSL -o $HOME/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64

chmod u+x $HOME/bin/argocd

Installing Trivy #

curl -fsSL -o $HOME/bin/trivy_0.45.0_Linux-64bit.tar.gz https://github.com/aquasecurity/trivy/releases/download/v0.45.0/trivy_0.45.0_Linux-64bit.tar.gz

tar -zxvf $HOME/bin/trivy_0.45.0_Linux-64bit.tar.gz -C $HOME/bin

rm -rf $HOME/bin/trivy_0.45.0_Linux-64bit.tar.gz $HOME/bin/contrib $HOME/bin/README.md $HOME/bin/LICENSE

Configuring kubectl to Connect to Your GKE Cluster #

To connect to your GKE cluster, navigate to the hamburger icon in the top left of the Cloud Console and click “Kubernetes Engine”. You will see your GKE cluster listed. Click the three vertical dots and click “Connect”. Finally, click “RUN IN CLOUD SHELL” and hit enter.