Member-only story
What is Ingress?
Kubernetes Service
Is L4 control, but Kubernetes Ingress
is L7 control.
This is very convenient because you can control path-based routing.
YAML file which we can apply
Please apply in order from the top.
Namespace definition:
apiVersion: v1
kind: Namespace
metadata:
name: ingress-sample
App definition:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ingress-deploy-nginx
namespace: ingress-sample
spec:
replicas: 8
selector:
matchLabels:
app: ingress-deploy-nginx
template:
metadata:
labels:
app: ingress-deploy-nginx
spec:
containers:
- name: ingress-deploy-nginx
image: nginx
resources:
limits:
memory: "50Mi"
cpu: "100m"
ports:
- containerPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ingress-deploy-apache
namespace: ingress-sample
spec:
replicas: 8
selector:
matchLabels:
app: ingress-deploy-apache
template:
metadata:
labels:
app: ingress-deploy-apache
spec:
containers:
- name: ingress-deploy-apache
image: httpd
resources:
limits:
memory: "50Mi"
cpu: "100m"
ports:
- containerPort: 80
---
apiVersion: apps/v1
kind…