From fbd10be8754420338216cab10000cbb692c24256 Mon Sep 17 00:00:00 2001 From: Eythor Magnusson Date: Fri, 1 Mar 2024 09:04:12 +0100 Subject: [PATCH] Remove unneeded script and docs After introducing ephemeral K8s, the start.sh script and Minikube tutorial no longer apply --- start.sh | 49 ------------------------- tutorial.md | 101 ---------------------------------------------------- 2 files changed, 150 deletions(-) delete mode 100644 start.sh delete mode 100644 tutorial.md diff --git a/start.sh b/start.sh deleted file mode 100644 index a65a152..0000000 --- a/start.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -# Install required dependencies if they're not already installed -command -v rsync &> /dev/null || sudo apt-get install -y rsync -command -v jq &> /dev/null || sudo apt-get install -y jq - -# Install Garden if it's not already installed -command -v garden &> /dev/null || ( - ASSET_URL=$(curl -s https://api.github.com/repos/garden-io/garden/releases/latest | \ - jq -r '.assets[] | select(.browser_download_url | test("linux-amd64.tar.gz$")) | .browser_download_url') - curl -sSL $ASSET_URL | tar xz && \ - sudo mv linux-amd64/* /usr/local/bin) - -# Download k3s if it's not already installed -if [ ! -f "./k3s" ]; then - K3S_URL=$(curl -s https://api.github.com/repos/k3s-io/k3s/releases/latest | \ - jq -r '.assets[] | select(.browser_download_url | endswith("k3s")) | .browser_download_url') - curl -sSL -o k3s $K3S_URL && \ - chmod +x k3s -else - # Check if k3s is already running and stop it - if ps aux | grep '[k]3s server' > /dev/null; then - sudo kill $(ps aux | grep '[k]3s server' | awk '{print $2}') - fi -fi - -# Start k3s server with host Docker image support and Traefik ingress controller disabled -nohup sudo ./k3s server --docker --disable=traefik --write-kubeconfig-mode=644 --snapshotter native > /dev/null 2>&1 & - -# Copy k3s config to user's home directory -mkdir -p ~/.kube -sleep 5 -sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config - -# Do not install NGINX ingress controller -sed -i 's/\(providers:\)/\1\n - name: local-kubernetes\n environments: [local]\n namespace: ${environment.namespace}\n defaultHostname: ${var.baseHostname}\n setupIngressController: null/' project.garden.yml - -# Update the garden.yml file for the vote container -sed -i 's/servicePort: 80/nodePort: 30000/' vote/garden.yml -sed -i 's/vote.${var.baseHostname}/http:\/\/localhost:30000/' vote/garden.yml -sed -i 's/hostname:/linkUrl:/' vote/garden.yml - -# Remove ingress blocks from result and api containers -sed -i '/ingresses:/, /hostname: result.\${var.baseHostname}/d' api/garden.yml result/garden.yml - -# Exit with a success code -exit 0 diff --git a/tutorial.md b/tutorial.md deleted file mode 100644 index 115a892..0000000 --- a/tutorial.md +++ /dev/null @@ -1,101 +0,0 @@ -# Garden quickstart for Cloud Shell - -## Let's get started - -This quickstart will show you how to start a minikube cluster and deploy a simple application to it using Garden. - -* **Setup your environment** - * Install Garden and start a k3d Kubernetes cluster you'll use to deploy your app to. -* **Deploy the app** - * You will be guided through the process of deploying a simple app to the cluster using Garden. -* **Explore the dev console** - * Run tests, view logs, and more. -___ - -**Time to complete**: -Click the **Start** button to move to the next step. - -## Setup your environment - -### Open the Cloud Shell - -Open Cloud Shell by clicking - in the navigation bar at the top of the console. - -### Run the setup script - -Run the start script to prepare the environment. The script will install the latest version of `garden` and its dependencies, and start a local k3d Kubernetes cluster. - -```bash -chmod +x start.sh && ./start.sh -``` - -## Deploy the app - -Garden ships with an interactive command center we call the **dev console**. To start the dev console, run: - -```sh -garden dev -``` - -The first time you run `garden dev`, Garden will initialize then await further instructions inside a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop). From inside the REPL you can command Garden to build, test, and deploy your project. - -After running `garden dev`, you're ready to deploy your project. Run: - -```sh -deploy -``` - -### Try it out - -In under 2 minutes, the dev console will print a `localhost` URL you can use to access the app. Open it by clicking the URL in the dev console or access it by tapping this link -> http://localhost:30000 and cast your vote! - -![vote UI](https://github.com/garden-io/quickstart-example/assets/59834693/f120848a-7467-40f8-840c-791b7b4a8fb2) - -## Explore the dev console - -Still in the dev console, run a unit test: - -```sh -test unit-vote -``` - -And end-to-end tests: - -```sh -test e2e -``` - -### Make your own - -These are tests shipped in the quickstart. Inspect their contents (or write your own!) by opening the `garden.yml` files inside the `vote` and `result` directories. - -### Cleanup - -Cleanup your environment with: - -``` -cleanup namespace -``` - -And exit the dev console by typing: - -```sh -exit -```` - -## Next Steps - - - -Now that you have Garden installed and seen its basic capabilities it's time to take the next steps. - -Join our [community on Discord](https://go.garden.io/discord) 🧑‍🤝‍🧑 - -If you'd like to better understand how a Garden project is configured, we recommend going -through our [first project tutorial](https://docs.garden.io/tutorials/your-first-project) which walks you through configuring a Garden project step-by-step. 🐾 - -If you like to dive right in and configure your own project for Garden, we recommend referencing our [example projects on GitHub](https://github.com/garden-io/garden/tree/main/examples) and the section of our docs titled [Using Garden](https://docs.garden.io/using-garden/configuration-overview), which covers all parts of Garden in detail. 🕵 - - -If you have any questions or feedback—or just want to say hi 🙂—we encourage you to join our [Discord community](https://go.garden.io/discord)!