forked from jaegertracing/jaeger
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add kubernetes example for hotrod app (jaegertracing#3645)
* Add kubernetes example for hotrod app Signed-off-by: Brandon High <[email protected]> * Remove grafana-agent optional configuration Signed-off-by: Brandon High <[email protected]> * Add redis container to kubernetes deployment example Also reduces the cpu/memory limits as they were excessive initially. Signed-off-by: Brandon High <[email protected]> * Move kubernetes example into hotrod/kubernetes Signed-off-by: Brandon High <[email protected]> * Add jaeger all-in-one to kubernetes example Signed-off-by: Brandon High <[email protected]> * Add one-liner for port-forward to see traces Signed-off-by: Brandon High <[email protected]> * Tracing port needs to be UDP not TCP Signed-off-by: Brandon High <[email protected]> * Update examples/hotrod/README.md Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Brandon High <[email protected]> * Move up kubernetes section in hotrod example README Signed-off-by: Brandon High <[email protected]> * Apply suggestions from code review Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Brandon High <[email protected]> * Add cleanup to k8s example READMEs Signed-off-by: Brandon High <[email protected]> * Remove redis from hotrod example Signed-off-by: Brandon High <[email protected]> * Use pod local/localhost for jaeger-all-in-one Signed-off-by: Brandon High <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Albert Teoh <[email protected]>
- Loading branch information
1 parent
4d55c58
commit d95de48
Showing
9 changed files
with
154 additions
and
0 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,17 @@ | ||
# Hot R.O.D. - Rides on Demand on Kubernetes | ||
|
||
Example k8s manifests for deploying the [hotrod app](..) to your k8s environment of choice. e.g. minikube, k3s, EKS, GKE | ||
|
||
## Usage | ||
|
||
```bash | ||
kustomize build . | kubectl apply -f - | ||
kubectl port-forward -n example-hotrod service/example-hotrod 8080:frontend | ||
# In another terminal | ||
kubectl port-forward -n example-hotrod service/jaeger 16686:frontend | ||
|
||
# To cleanup | ||
kustomize build . | kubectl delete -f - | ||
``` | ||
|
||
Access Jaeger UI at <http://localhost:16686> and HotROD app at <http://localhost:8080> |
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,40 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: example-hotrod | ||
name: example-hotrod | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: example-hotrod | ||
strategy: {} | ||
template: | ||
metadata: | ||
labels: | ||
app: example-hotrod | ||
spec: | ||
containers: | ||
- image: jaegertracing/example-hotrod:latest | ||
name: example-hotrod | ||
args: ["all"] | ||
env: | ||
- name: JAEGER_AGENT_HOST | ||
value: localhost | ||
- name: JAEGER_AGENT_PORT | ||
value: "6831" | ||
ports: | ||
- containerPort: 8080 | ||
name: frontend | ||
- containerPort: 8081 | ||
name: customer | ||
- containerPort: 8083 | ||
name: route | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100M | ||
requests: | ||
cpu: 100m | ||
memory: 100M |
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,6 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- deployment.yaml | ||
- service.yaml |
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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: example-hotrod | ||
spec: | ||
selector: | ||
app: example-hotrod | ||
ports: | ||
- name: frontend | ||
protocol: TCP | ||
port: 8080 | ||
targetPort: frontend |
33 changes: 33 additions & 0 deletions
33
examples/hotrod/kubernetes/base/jaeger-all-in-one/kustomization.yaml
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,33 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
bases: | ||
- ../hotrod | ||
|
||
resources: | ||
- service.yaml | ||
|
||
patches: | ||
- target: | ||
group: apps | ||
version: v1 | ||
kind: Deployment | ||
name: example-hotrod | ||
patch: |- | ||
- op: add | ||
path: /spec/template/spec/containers/- | ||
value: | ||
image: jaegertracing/all-in-one:latest | ||
name: jaeger | ||
ports: | ||
- containerPort: 6831 | ||
name: tracing-jaeger | ||
- containerPort: 16686 | ||
name: frontend-jaeger | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100M | ||
requests: | ||
cpu: 100m | ||
memory: 100M |
16 changes: 16 additions & 0 deletions
16
examples/hotrod/kubernetes/base/jaeger-all-in-one/service.yaml
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,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: jaeger | ||
spec: | ||
selector: | ||
app: example-hotrod | ||
ports: | ||
- name: tracing | ||
protocol: UDP | ||
port: 6831 | ||
targetPort: tracing-jaeger | ||
- name: frontend | ||
protocol: TCP | ||
port: 16686 | ||
targetPort: frontend-jaeger |
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,12 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
bases: | ||
# If you only want the hotrod application, uncomment this line and comment out jaeger-all-in-one | ||
# - base/hotrod | ||
- base/jaeger | ||
|
||
namespace: example-hotrod | ||
|
||
resources: | ||
- namespace.yaml |
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,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: example-hotrod |