From f9687c6773716707c0197d7d6e1593c627931baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Busse?= Date: Thu, 15 Feb 2024 17:23:57 +0100 Subject: [PATCH] terraform: Download for Macos, increase mem --- clusters/minikube/spinnaker-config.yaml | 22 ++++++++++++++++++ setup-cluster | 30 +++++++++++++++++-------- 2 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 clusters/minikube/spinnaker-config.yaml diff --git a/clusters/minikube/spinnaker-config.yaml b/clusters/minikube/spinnaker-config.yaml new file mode 100644 index 0000000..2e078be --- /dev/null +++ b/clusters/minikube/spinnaker-config.yaml @@ -0,0 +1,22 @@ +apiVersion: spinnaker.io/v1alpha2 +kind: SpinnakerService +metadata: + name: spinnaker +spec: + spinnakerConfig: + config: + version: 1.33.0 + persistentStorage: + persistentStoreType: s3 + # Spinnaker stores application and pipeline definitions here + # Create an S3 bucket and provide the name here + s3: + bucket: ob-spinnaker-artifacts-dev + rootFolder: front50 + # spec.expose - This section defines how Spinnaker should be publicly exposed + expose: + # Kubernetes LoadBalancer type (service/ingress) + # Only "service" is supported for now + type: service + service: + type: LoadBalancer diff --git a/setup-cluster b/setup-cluster index 425b894..6d12e0d 100755 --- a/setup-cluster +++ b/setup-cluster @@ -30,12 +30,12 @@ FLUX_FORCE_LOCAL=1 readonly FLUX_FORCE_LOCAL TF_VERSION="1.6.6" readonly TF_VERSION -TF_ARCHIVE="terraform_${TF_VERSION}_linux_amd64.zip" -readonly TF_ARCHIVE +TF_ARCHIVE_LINUX="terraform_${TF_VERSION}_linux_amd64.zip" +readonly TF_ARCHIVE_LINUX +TF_ARCHIVE_MACOS="terraform_${TF_VERSION}_darwin_arm64.zip" +readonly TF_ARCHIVE_MACOS TF_CHECKSUM="" readonly TF_CHECKSUM -TF_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ARCHIVE}" -readonly TF_URL TF_FORCE_LOCAL=1 readonly TF_FORCE_LOCAL OS="Linux" @@ -55,9 +55,13 @@ printf "Running on ${OS}\n" if [[ "$OS" = "macos" ]]; then FLUX_URL="${FLUX_URL_MACOS}" FLUX_ARCHIVE="${FLUX_ARCHIVE_MACOS}" + TF_ARCHIVE="${TF_ARCHIVE_MACOS}" + TF_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ARCHIVE}" else FLUX_URL="${FLUX_URL_LINUX}" - FLUX_ARCHIVE="${FLUX_ARCHIVE_MACOS}" + FLUX_ARCHIVE="${FLUX_ARCHIVE_LINUX}" + TF_ARCHIVE="${TF_ARCHIVE_LINUX}" + TF_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ARCHIVE}" fi # We prefer podman but Ubuntu's podman is too old @@ -67,7 +71,11 @@ fi # Start minikube if ! $(minikube status | grep Nonexistent\|Stopped); then - printf 'minikube is not running\nStarting minikube..' + printf 'minikube is not running\nStarting minikube..\n' + # Increase memory from default 2G + podman machine set --memory=4096 + podman machine start + minikube config set memory 3800 if [[ 0 == "${VERBOSE}" ]]; then minikube start --driver="${minikube_driver}" else @@ -93,9 +101,13 @@ fi # Install terraform if local version enforced if [[ "$TF_FORCE_LOCAL" = 1 ]]; then - printf "Fetching terraform archive..\n" - curl -LO "${TF_URL}" - unzip "${TF_ARCHIVE}" + if [[ -e "$TF_ARCHIVE}" ]]; then + printf "terraform binary exists\n" + else + printf "Fetching terraform archive..\n" + curl -LO "${TF_URL}" + unzip -n "${TF_ARCHIVE}" + fi TF_CMD="./terraform" else TF_CMD="terraform"