imfreedom/k8s-cluster

Move nest to the traefik cdr ingress

2020-02-11, Gary Kramlich
e01adf01abde
Parents 5f7efa25b905
Children c6c741eb3df2
Move nest to the traefik cdr ingress
--- a/50-nest.pidgin.im.yaml Tue Feb 11 21:07:13 2020 -0600
+++ b/50-nest.pidgin.im.yaml Tue Feb 11 21:07:36 2020 -0600
@@ -44,57 +44,109 @@
- www.pidg.in
- nest.pidgin.im
---
-apiVersion: extensions/v1beta1
-kind: Ingress
+apiVersion: traefik.containo.us/v1alpha1
+kind: Middleware
+metadata:
+ name: nest-redirect-documentation
+ namespace: roost
+spec:
+ redirectRegex:
+ regex: ^https?:\/\/[^\/]+(\/documentation(\.php)?)$
+ replacement: https://pidgin.im/help
+ permanent: true
+---
+apiVersion: traefik.containo.us/v1alpha1
+kind: Middleware
+metadata:
+ name: nest-redirect-pipermail-support
+ namespace: roost
+spec:
+ redirectRegex:
+ regex: ^https?:\/\/[^\/]+(\/pipermail\/support)$
+ replacement: https://lists.pidgin.im/pipermail/support/
+ permanent: true
+---
+apiVersion: traefik.containo.us/v1alpha1
+kind: IngressRoute
+metadata:
+ name: nest-http
+ namespace: roost
+spec:
+ entryPoints:
+ - http
+ routes:
+ - match: Host(`pidgin.im`) || Host(`www.pidgin.im`)
+ kind: Rule
+ services:
+ - name: nest
+ port: 3000
+ middlewares:
+ - name: nest-redirect-documentation
+ - name: nest-redirect-pipermail-support
+ - name: common-headers
+ - match: (Host(`pidgin.im`) || Host(`www.pidgin.im`)) && PathPrefix(`/win32`)
+ kind: Rule
+ services:
+ - name: oldsite
+ port: 80
+ middlewares:
+ - name: common-headers
+ - match: (Host(`pidgin.im`) || Host(`www.pidgin.im`)) && Path(`/version.php`)
+ kind: Rule
+ services:
+ - name: oldsite
+ port: 80
+ middlewares:
+ - name: common-headers
+---
+apiVersion: traefik.containo.us/v1alpha1
+kind: IngressRoute
+metadata:
+ name: nest
+ namespace: roost
+spec:
+ entryPoints:
+ - https
+ routes:
+ - match: Host(`pidgin.im`) || Host(`www.pidgin.im`)
+ kind: Rule
+ services:
+ - name: nest
+ port: 3000
+ middlewares:
+ - name: nest-redirect-documentation
+ - name: nest-redirect-pipermail-support
+ - name: common-headers
+ - match: (Host(`pidgin.im`) || Host(`www.pidgin.im`)) && PathPrefix(`/win32`)
+ kind: Rule
+ services:
+ - name: oldsite
+ port: 80
+ middlewares:
+ - name: common-headers
+ - match: (Host(`pidgin.im`) || Host(`www.pidgin.im`)) && Path(`/version.php`)
+ kind: Rule
+ services:
+ - name: oldsite
+ port: 80
+ middlewares:
+ - name: common-headers
+ tls:
+ secretName: nest-tls
+---
+apiVersion: cert-manager.io/v1alpha2
+kind: Certificate
metadata:
namespace: roost
- name: nest
- annotations:
- cert-manager.io/issuer: letsencrypt
- nginx.ingress.kubernetes.io/ssl-redirect: "false"
- nginx.ingress.kubernetes.io/configuration-snippet: |
- more_set_headers "X-Frame-Options: SAMEORIGIN";
- rewrite /documentation /help permanent;
- rewrite /pipermail/support https://lists.pidgin.im/pipermail/support/ permanent;
- labels:
- app: nest
+ name: nest-tls
spec:
- rules:
- - host: pidgin.im
- http:
- paths:
- - backend:
- serviceName: nest
- servicePort: 3000
- path: /
- - backend:
- serviceName: oldsite
- servicePort: 80
- path: /win32
- - backend:
- serviceName: oldsite
- servicePort: 80
- path: /version.php
- - host: www.pidgin.im
- http:
- paths:
- - backend:
- serviceName: nest
- servicePort: 3000
- path: /
- - backend:
- serviceName: oldsite
- servicePort: 80
- path: /win32
- - backend:
- serviceName: oldsite
- servicePort: 80
- path: /version.php
- tls:
- - hosts:
- - pidgin.im
- - www.pidgin.im
- secretName: nest-tls
+ secretName: nest-tls
+ issuerRef:
+ name: letsencrypt
+ commonName: pidgin.im
+ dnsNames:
+ - pidgin.im
+ - www.pidgin.im
---
apiVersion: v1
kind: Service