From b588e3667e4f84b6205c14d0e6d647385b438c31 Mon Sep 17 00:00:00 2001 From: balaramesh2 Date: Thu, 25 Jul 2024 12:04:56 -0400 Subject: [PATCH 1/5] Add yarn to list of prereqs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d0f6a73..685e4c8 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ You will need a Kubernetes cluster to deploy the workshop applications. You will * [docker](https://docs.docker.com/engine/install/) * [kubectl](https://kubernetes.io/docs/tasks/tools/) * [helm](https://helm.sh/docs/intro/install/) +* [yarn](https://classic.yarnpkg.com/en/docs/install#mac-stable) Verify your installations by running these commands in your terminal: From c5dc38a6bcb3684f5abd9943df27e9fab04340bc Mon Sep 17 00:00:00 2001 From: balaramesh2 Date: Thu, 25 Jul 2024 12:23:07 -0400 Subject: [PATCH 2/5] Create init.sh Installs kind, helm, kubectl, docker, homebrew (for yarn and Docker desktop) --- init.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 init.sh diff --git a/init.sh b/init.sh new file mode 100644 index 0000000..751bcc3 --- /dev/null +++ b/init.sh @@ -0,0 +1,52 @@ +#!/bin/bash +#Install dependencies + +#export PATH +# +export PATH=$PATH + +echo "######################################################## Installing Kind ########################################################" + +# For Intel Macs +[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-darwin-amd64 +# For M1 / ARM Macs +[ $(uname -m) = arm64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-darwin-arm64 +chmod +x ./kind +sudo mv ./kind /usr/local/bin/kind +echo "######################################################## Kind Install Complete ########################################################" + +echo "######################################################## Installing Helm ########################################################" +curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 +chmod 700 get_helm.sh +./get_helm.sh +echo "######################################################## Helm Install Complete ########################################################" + +echo "######################################################## Installing Homebrew ########################################################" + +echo "######################################################## Homebrew is required for installing Docker Desktop on Mac ########################################################" + +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + +echo "######################################################## Homebrew installation complete ########################################################" + +echo "######################################################## Installing Docker Desktop with homebrew cask ########################################################" + +brew cask install docker + +echo "######################################################## Docker Desktop installation complete ########################################################" + +echo "######################################################## Installing Kubectl ########################################################" + +# For Intel Macs +[ $(uname -m) = x86_64 ] && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" +# For M1 / ARM Macs +[ $(uname -m) = arm64 ] && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl" +#Make executable +chmod +x ./kubectl +#Move to system PATH +sudo mv ./kubectl /usr/local/bin/kubectl +sudo chown root: /usr/local/bin/kubectl + +echo "######################################################## kubectl has been installed! ########################################################" + +echo "######################################################## Dependency installation complete ########################################################" From 0eef4e9954f1d66a88e396f3bf4c8745928e2543 Mon Sep 17 00:00:00 2001 From: balaramesh2 Date: Thu, 25 Jul 2024 12:24:59 -0400 Subject: [PATCH 3/5] include yarn install --- init.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.sh b/init.sh index 751bcc3..1adb217 100644 --- a/init.sh +++ b/init.sh @@ -49,4 +49,10 @@ sudo chown root: /usr/local/bin/kubectl echo "######################################################## kubectl has been installed! ########################################################" +echo "######################################################## Installing yarn ########################################################" + +brew install yarn + +echo "######################################################## Yarn installation complete ########################################################" + echo "######################################################## Dependency installation complete ########################################################" From ac0e2b3f9075ed32ec762575e17494e0f47d5a68 Mon Sep 17 00:00:00 2001 From: balaramesh2 Date: Thu, 25 Jul 2024 12:30:18 -0400 Subject: [PATCH 4/5] cask must be used as `--cask` --- init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.sh b/init.sh index 1adb217..b88467a 100644 --- a/init.sh +++ b/init.sh @@ -31,7 +31,7 @@ echo "######################################################## Homebrew installa echo "######################################################## Installing Docker Desktop with homebrew cask ########################################################" -brew cask install docker +brew list docker || brew install docker --cask echo "######################################################## Docker Desktop installation complete ########################################################" @@ -51,7 +51,7 @@ echo "######################################################## kubectl has been echo "######################################################## Installing yarn ########################################################" -brew install yarn +brew list yarn || brew install yarn echo "######################################################## Yarn installation complete ########################################################" From cc3033143b6df3e34e93ee52f04c29da645a4a82 Mon Sep 17 00:00:00 2001 From: balaramesh2 Date: Thu, 25 Jul 2024 12:32:39 -0400 Subject: [PATCH 5/5] Start Docker --- init.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.sh b/init.sh index b88467a..d95c43b 100644 --- a/init.sh +++ b/init.sh @@ -35,6 +35,10 @@ brew list docker || brew install docker --cask echo "######################################################## Docker Desktop installation complete ########################################################" +echo "######################################################## Starting Docker engine ########################################################" + +open -a Docker & + echo "######################################################## Installing Kubectl ########################################################" # For Intel Macs