-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sample yaml file for NGINX Mon Pattern Traffic Routing and NGINX reso…
…urce issue (#34) * add nginx sample yaml file for nginx accelerator * fix syntax error
- Loading branch information
Showing
1 changed file
with
125 additions
and
0 deletions.
There are no files selected for viewing
125 changes: 125 additions & 0 deletions
125
artifacts/k8s-deployment-manifest-templates/nginx/nginx-traffic-sample.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,125 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: {{namespace}} | ||
labels: | ||
name: {{namespace}} | ||
|
||
--- | ||
|
||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: banana-app | ||
namespace: {{namespace}} | ||
labels: | ||
app: banana | ||
spec: | ||
containers: | ||
- name: banana-app | ||
image: hashicorp/http-echo | ||
args: | ||
- "-text=banana" | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
requests: | ||
cpu: 50m | ||
memory: 50Mi | ||
--- | ||
|
||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: banana-service | ||
namespace: {{namespace}} | ||
spec: | ||
selector: | ||
app: banana | ||
ports: | ||
- port: 5678 # Default port for image | ||
|
||
--- | ||
|
||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: apple-app | ||
namespace: {{namespace}} | ||
labels: | ||
app: apple | ||
spec: | ||
containers: | ||
- name: apple-app | ||
image: hashicorp/http-echo | ||
args: | ||
- "-text=apple" | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
requests: | ||
cpu: 50m | ||
memory: 50Mi | ||
--- | ||
|
||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: apple-service | ||
namespace: {{namespace}} | ||
spec: | ||
selector: | ||
app: apple | ||
ports: | ||
- port: 5678 # Default port for image | ||
|
||
--- | ||
|
||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: ingress-nginx-demo | ||
namespace: {{namespace}} | ||
spec: | ||
rules: | ||
- host: {{external_ip}} | ||
http: | ||
paths: | ||
- path: /apple | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: apple-service | ||
port: | ||
number: 5678 | ||
- path: /banana | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: banana-service | ||
port: | ||
number: 5678 | ||
ingressClassName: nginx | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: traffic-generator | ||
namespace: {{namespace}} | ||
spec: | ||
containers: | ||
- name: traffic-generator | ||
image: ellerbrock/alpine-bash-curl-ssl | ||
command: ["/bin/bash"] | ||
args: ["-c", "while :; do curl http://{{external_ip}}/apple > /dev/null 2>&1; curl http://{{external_ip}}/banana > /dev/null 2>&1; sleep 0.05; done"] | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
requests: | ||
cpu: 50m | ||
memory: 50Mi |