forked from crossplane/oam-kubernetes-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into trait_name
- Loading branch information
Showing
5 changed files
with
79 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Flight Tracker | ||
|
||
This is an example microservices application with a Javascript Web UI, a PostgreSQL database, and a series of API microservices. The idea is that various app developers would create Components for their corresponding apps. The overall config will add traits and allow the app to be fully deployed | ||
|
||
![](https://github.com/oam-dev/samples/raw/master/2.ServiceTracker_App/service-tracker-diagram.jpg) | ||
|
||
> Full application original source here: https://github.com/chzbrgr71/service-tracker | ||
## Apply Definition | ||
|
||
For this demo, it is necessary to create a `WorkloadDefinition` for the `ContainerizedWorkload` and `PostgreSQLInstance` workload types, and a `TraitDefinition` for the `ManualScalerTrait` type. | ||
|
||
```bash | ||
$ kubectl apply -f definitions/ | ||
workloaddefinition.core.oam.dev/containerizedworkloads.core.oam.dev created | ||
traitdefinition.core.oam.dev/manualscalertraits.core.oam.dev created | ||
``` | ||
|
||
## Install Component | ||
|
||
Register the `Components`. | ||
|
||
```bash | ||
$ kubectl apply -f components/ | ||
component.core.oam.dev/data-api created | ||
component.core.oam.dev/tracker-postgres-db created | ||
component.core.oam.dev/flights-api created | ||
component.core.oam.dev/quakes-api created | ||
component.core.oam.dev/service-tracker-ui created | ||
component.core.oam.dev/weather-api created | ||
``` | ||
|
||
## Run ApplicationConfiguration | ||
|
||
Install the `ApplicationConfiguration`. | ||
|
||
```bash | ||
$ kubectl apply -f tracker-app-config.yaml | ||
secret/dbuser created | ||
applicationconfiguration.core.oam.dev/service-tracker created | ||
``` | ||
|
||
## Result | ||
|
||
Visit your browser, and open `http://{your-ingress-address}/web-ui` for the Service Tracker website. Refresh the data on the dashboard for each of the microservices. | ||
|
||
![image](https://tvax2.sinaimg.cn/large/ad5fbf65ly1ggh2brro77j21hb0tan00.jpg) | ||
|
||
## Clean up | ||
|
||
clean resource of `flight-tracke`. | ||
|
||
```bash | ||
$ kubectl delete -f . | ||
$ kubectl delete -f components/ | ||
$ kubectl delete -f definitions/ | ||
``` | ||
|
||
> More info, please see https://github.com/oam-dev/samples/tree/master/2.ServiceTracker_App |
This file contains 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: core.oam.dev/v1alpha2 | ||
kind: TraitDefinition | ||
metadata: | ||
name: ingresses.extensions | ||
spec: | ||
definitionRef: | ||
name: ingresses.extensions |
This file contains 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
This file was deleted.
Oops, something went wrong.