0% found this document useful (0 votes)
17 views4 pages

Ingress

The document provides YAML configurations for deploying NGINX and Apache HTTP server applications on Kubernetes, including their respective services. It also outlines path-based and host-name based routing rules using Ingress resources for managing traffic to these applications. Additionally, it includes contact information and links to the NextOps website and YouTube channel.

Uploaded by

srinivasonwork
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views4 pages

Ingress

The document provides YAML configurations for deploying NGINX and Apache HTTP server applications on Kubernetes, including their respective services. It also outlines path-based and host-name based routing rules using Ingress resources for managing traffic to these applications. Additionally, it includes contact information and links to the NextOps website and YouTube channel.

Uploaded by

srinivasonwork
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Ingress controller deployment yaml url

https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-
v1.2.1/deploy/static/provider/cloud/deploy.yaml

nginx-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
env:
- name: TITLE
value: "NGINX APP1"
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
type: ClusterIP
ports:
- port: 80
selector:
app: nginx

Website: https://www.nextops.in, YouTube: https://www.youtube.com/c/nextopsvideos


WhatsApp: +91 73309 77091, Email: [email protected]
httpd-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: httpd
spec:
replicas: 1
selector:
matchLabels:
app: httpd
template:
metadata:
labels:
app: httpd
spec:
containers:
- name: httpd
image: httpd
ports:
- containerPort: 80
env:
- name: TITLE
value: "APACHE APP2"
---
apiVersion: v1
kind: Service
metadata:
name: httpd
spec:
type: ClusterIP
ports:
- port: 80
selector:
app: httpd

Website: https://www.nextops.in, YouTube: https://www.youtube.com/c/nextopsvideos


WhatsApp: +91 73309 77091, Email: [email protected]
Path based routing rules – Ingress resource

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: k8s-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: nginx
rules:
- http:
paths:
- path: /nginx(/|$)(.*)
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80
- path: /httpd(/|$)(.*)
pathType: Prefix
backend:
service:
name: httpd
port:
number: 80
- path: /(.*)
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80

Website: https://www.nextops.in, YouTube: https://www.youtube.com/c/nextopsvideos


WhatsApp: +91 73309 77091, Email: [email protected]
Host-name based routing rules – Ingress resource

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: k8s-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: nginx
rules:
- host: www.nextopsnginx.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80
- host: www.nextopshttpd.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: httpd
port:
number: 80

Website: https://www.nextops.in, YouTube: https://www.youtube.com/c/nextopsvideos


WhatsApp: +91 73309 77091, Email: [email protected]

You might also like