-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Update development guide #3185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ricardoamaro
wants to merge
2
commits into
GoogleCloudPlatform:main
Choose a base branch
from
ricardoamaro:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update development guide #3185
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,21 @@ This doc explains how to build and run the Online Boutique source code locally u | |
|
|
||
| - [Docker for Desktop](https://www.docker.com/products/docker-desktop) | ||
| - [kubectl](https://kubernetes.io/docs/tasks/tools/) (can be installed via `gcloud components install kubectl` for Option 1 - GKE) | ||
| - [skaffold **2.0.2+**](https://skaffold.dev/docs/install/) (latest version recommended), a tool that builds and deploys Docker images in bulk. | ||
| - [skaffold **2.0.2+**](https://skaffold.dev/docs/install/) (latest version recommended), a tool that builds and deploys Docker images in bulk. | ||
|
|
||
| **Install skaffold:** | ||
| ```sh | ||
| # Linux | ||
| curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 | ||
| chmod +x skaffold | ||
| sudo mv skaffold /usr/local/bin/ | ||
|
|
||
| # macOS | ||
| brew install skaffold | ||
|
|
||
| # Or download from: https://skaffold.dev/docs/install/ | ||
| ``` | ||
|
|
||
| - Clone the repository. | ||
| ```sh | ||
| git clone https://github.com/GoogleCloudPlatform/microservices-demo | ||
|
|
@@ -15,6 +29,19 @@ This doc explains how to build and run the Online Boutique source code locally u | |
| - A Google Cloud project with Google Container Registry enabled. (for Option 1 - GKE) | ||
| - [Minikube](https://minikube.sigs.k8s.io/docs/start/) (optional for Option 2 - Local Cluster) | ||
| - [Kind](https://kind.sigs.k8s.io/) (optional for Option 2 - Local Cluster) | ||
| - [k3d](https://k3d.io/) (optional for Option 2 - Local Cluster) | ||
|
|
||
| ### Verify Prerequisites | ||
|
|
||
| Before starting, verify all required tools are installed: | ||
|
|
||
| ```sh | ||
| docker --version # Should show Docker 20.10+ | ||
| kubectl version --client # Should show kubectl 1.19+ | ||
| skaffold version # Should show skaffold 2.0.2+ | ||
| ``` | ||
|
|
||
| If any command fails, install the missing tool using the links above. | ||
|
|
||
| ## Option 1: Google Kubernetes Engine (GKE) | ||
|
|
||
|
|
@@ -113,11 +140,33 @@ This doc explains how to build and run the Online Boutique source code locally u | |
| This will build and deploy the application. If you need to rebuild the images | ||
| automatically as you refactor the code, run `skaffold dev` command. | ||
|
|
||
| **If you encounter build errors** (see Troubleshooting section below), use pre-built images instead: | ||
| ```shell | ||
| kubectl apply -f ./release/kubernetes-manifests.yaml | ||
| ``` | ||
|
Comment on lines
+143
to
+146
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would remove this text. This doc is for developing on Bank of Anthos, so pulling pre-built images defeats the purpose of this guide) |
||
|
|
||
| 4. Run `kubectl get pods` to verify the Pods are ready and running. | ||
|
|
||
| After a few minutes, you should see output similar to: | ||
| ``` | ||
| NAME READY STATUS RESTARTS AGE | ||
| adservice-xxx 1/1 Running 0 2m | ||
| cartservice-xxx 1/1 Running 0 2m | ||
| checkoutservice-xxx 1/1 Running 0 2m | ||
| currencyservice-xxx 1/1 Running 0 2m | ||
| emailservice-xxx 1/1 Running 0 2m | ||
| frontend-xxx 1/1 Running 0 2m | ||
| loadgenerator-xxx 1/1 Running 0 2m | ||
| paymentservice-xxx 1/1 Running 0 2m | ||
| productcatalogservice-xxx 1/1 Running 0 2m | ||
| recommendationservice-xxx 1/1 Running 0 2m | ||
| redis-cart-xxx 1/1 Running 0 2m | ||
| shippingservice-xxx 1/1 Running 0 2m | ||
| ``` | ||
|
|
||
| 5. Run `kubectl port-forward deployment/frontend 8080:8080` to forward a port to the frontend service. | ||
|
|
||
| 6. Navigate to `localhost:8080` to access the web frontend. | ||
| 6. Navigate to `http://localhost:8080` to access the web frontend. | ||
|
|
||
| ## Adding a new microservice | ||
|
|
||
|
|
@@ -129,3 +178,20 @@ See the [Adding a new microservice](adding-new-microservice.md) guide for instru | |
|
|
||
| If you've deployed the application with `skaffold run` command, you can run | ||
| `skaffold delete` to clean up the deployed resources. | ||
|
|
||
| If you used `kubectl apply`, run: | ||
| ```shell | ||
| kubectl delete -f ./release/kubernetes-manifests.yaml | ||
| ``` | ||
|
|
||
| To delete your local cluster: | ||
| ```shell | ||
| # k3d | ||
| k3d cluster delete mycluster | ||
|
|
||
| # Minikube | ||
| minikube delete | ||
|
|
||
| # Kind | ||
| kind delete cluster | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not have these instructions here, since we'd be duplicating a source of truth that already exists (which is linked in the doc: https://skaffold.dev/docs/install/)