Skip to content

Commit

Permalink
microservices: add hands on script.result
Browse files Browse the repository at this point in the history
  • Loading branch information
tungbq committed May 11, 2024
1 parent 770399c commit 9e7ef71
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions topics/microservices/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ Run:
```bash
./hello-microservices.sh
```

## 3. Check the result
Visit localhost:8080, you should get the similar result like this
![first-demo-microservices-result](../assets/first-demo-microservices-result.png)
18 changes: 15 additions & 3 deletions topics/microservices/basic/hello-microservices.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,23 @@ else
fi

kubectl apply -n $NAME_SPACE -f https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/main/release/kubernetes-manifests.yaml
kubectl get pods -n $NAME_SPACE

# Wait for services up
kubectl get pods -n $NAME_SPACE
console_log "Waiting for all services are up. Sleeping 120s"
sleep 120
console_log "Waiting for all services are up. Sleeping 120s..."
# sleep 120

console_log "Checking all resouces in namespace '$NAME_SPACE'"
kubectl get all -n $NAME_SPACE

console_log "Checking pods"
kubectl get pods -n $NAME_SPACE

# Port forward
console_log "Forward the 'service/frontend' service"
## NOTE: You can change the '8080' port to whatever works on your machine
kubectl port-forward service/frontend -n $NAME_SPACE 8080:80

# Access the application
## Visit http://localhost:8080 to check your application

0 comments on commit 9e7ef71

Please sign in to comment.