Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ingress for Kubernetes >v1.22 #120

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## Sample Nginx-Igress Application Yaml File for Demo
## Sample Nginx-Ingress Application Yaml File for Demo
Please refer to [Set Up NGINX with Sample Traffic](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-Sample-Workloads-nginx.html) for installation guide.
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
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: ImplementationSpecific
backend:
service:
name: apple-service
port:
number: 5678
- path: /banana
pathType: ImplementationSpecific
backend:
service:
name: banana-service
port:
number: 5678

---

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 1; done"]
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 50m
memory: 50Mi