mirror of https://github.com/sgoudham/k8s
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
2 years ago
|
apiVersion: networking.k8s.io/v1
|
||
|
kind: Ingress
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: website
|
||
|
name: website
|
||
|
namespace: website
|
||
|
annotations:
|
||
|
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
|
||
|
traefik.ingress.kubernetes.io/router.middlewares: website-drop-www-redirect@kubernetescrd
|
||
|
spec:
|
||
|
ingressClassName: traefik
|
||
|
rules:
|
||
|
- host: goudham.com
|
||
|
http:
|
||
|
paths:
|
||
|
- backend:
|
||
|
service:
|
||
|
name: website
|
||
|
port:
|
||
|
number: 3000
|
||
|
path: /
|
||
|
pathType: Prefix
|
||
|
- host: www.goudham.com
|
||
|
http:
|
||
|
paths:
|
||
|
- backend:
|
||
|
service:
|
||
|
name: website
|
||
|
port:
|
||
|
number: 3000
|
||
|
path: /
|
||
|
pathType: Prefix
|
||
|
tls:
|
||
|
- hosts:
|
||
|
- goudham.com
|
||
|
---
|
||
|
apiVersion: traefik.containo.us/v1alpha1
|
||
|
kind: Middleware
|
||
|
metadata:
|
||
|
name: drop-www-redirect
|
||
|
spec:
|
||
|
redirectRegex:
|
||
|
regex: ^https://www.goudham.com/(.*)
|
||
|
replacement: https://goudham.com/${1}
|