https://github.com/emalm/cff-info-demo
CFF Info App demo
https://github.com/emalm/cff-info-demo
Last synced: 11 days ago
JSON representation
CFF Info App demo
- Host: GitHub
- URL: https://github.com/emalm/cff-info-demo
- Owner: emalm
- Created: 2019-09-10T19:50:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-18T15:25:59.000Z (almost 7 years ago)
- Last Synced: 2025-11-12T11:32:12.136Z (8 months ago)
- Language: Go
- Size: 806 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cff-info-demo
A small two-tier web app to illustrate some of the service-mesh routing and networking features in the Cloud Foundry Application Runtime (CFAR).
## Prerequisites
- Install the `cf` CLI.
- Install the `jq` command-line tool.
- Log into a CFAR installation with the Istio service mesh enabled.
- Change to the root directory of this repository.
- Run `export CF_DOMAIN=` with `` replaced with the base apps domain for your CFAR installation.
## Service-Mesh Load Balancing
Push the front-end CFF info apps:
```
cf push -f manifests/cff-info-v1.yml
cf push -f manifests/cff-info-v2.yml
```
Map an Istio ingress route to the `cff-info-v1` app
```
cf map-route cff-info-v1 "istio.$CF_DOMAIN" -n cff-info
```
Push the back-end CFF member info apps:
```
for n in abby chip swarna;
do
cf push -f "manifests/member-$n.yml"
done
```
Add network policies from the front-end apps to the back-end member apps:
```
./scripts/set-network-policies
```
Make a request to the front-end app:
```
curl "cff-info.istio.$CF_DOMAIN/random"
```
Make additional requests and observe that the member info changes while the URL and resolved IP in the member request metadata remain the same.
### Fault handling
Change the `member-chip` app to listen on port 9999 instead of on 8080:
```
cf set-env member-chip BAD_LISTENER true
cf restart member-chip
```
Make several requests to the random CFF info page and observe that sometimes the front-end app makes several requests to the back-end internal route before getting a successful response.
Change the `member-chip` app to listening on 8080:
```
cf unset-env member-chip BAD_LISTENER
cf restart member-chip
```
## Weighted Routing
Set the weighted-routing rules to send 80% of traffic to the v1 CFF info app and 20% to the v2 CFF info app:
```
./scripts/set-route-weights 80
```
Make many requests to the random info page and observe differences in styling.
Set the weighted-routing rules to send 10% of traffic to the v1 CFF info app and 90% to the v2 CFF info app:
```
./scripts/set-route-weights 90
```
Make many more requests to the random info page and observe the new style eventually occurs much more frequently.
Return to routing 100% of traffic to the v1 CFF info app:
```
./scripts/clear-route-weights
```