refactor(website): split into `preview` & `release`

main
sgoudham 1 year ago
parent a73b06bb15
commit 7fde8427c5
Signed by: hammy
GPG Key ID: 44E818FD5457EEA4

@ -2,14 +2,18 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: website
name: website
app: website-preview
name: website-preview
namespace: website
annotations:
keel.sh/policy: force
keel.sh/trigger: poll
keel.sh/match-tag: "true"
spec:
replicas: 1
selector:
matchLabels:
app: website
app: website-preview
strategy:
rollingUpdate:
maxSurge: 25%
@ -18,12 +22,12 @@ spec:
template:
metadata:
labels:
app: website
app: website-preview
spec:
containers:
- image: sgoudham/website:latest
- image: sgoudham/website:preview
imagePullPolicy: IfNotPresent
name: website
name: website-preview
ports:
- containerPort: 3000
protocol: TCP

@ -0,0 +1,46 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
labels:
app: website-preview
name: website-preview
namespace: website
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
traefik.ingress.kubernetes.io/router.middlewares: website-drop-www-redirect-preview@kubernetescrd
spec:
ingressClassName: traefik
rules:
- host: preview.goudham.com
http:
paths:
- backend:
service:
name: website-preview
port:
number: 3000
path: /
pathType: Prefix
- host: www.preview.goudham.com
http:
paths:
- backend:
service:
name: website-preview
port:
number: 3000
path: /
pathType: Prefix
tls:
- hosts:
- preview.goudham.com
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: drop-www-redirect-preview
namespace: website
spec:
redirectRegex:
regex: ^https://www.preview.goudham.com/(.*)
replacement: https://preview.goudham.com/${1}

@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: website-preview
name: website-preview
namespace: website
spec:
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- port: 3000
protocol: TCP
targetPort: 3000
selector:
app: website-preview
sessionAffinity: None
type: ClusterIP

@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: website
name: website
namespace: website
annotations:
keel.sh/policy: major
keel.sh/trigger: poll
spec:
replicas: 1
selector:
matchLabels:
app: website
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: website
spec:
containers:
- image: sgoudham/website:1.0.1
imagePullPolicy: IfNotPresent
name: website
ports:
- containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 3000
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always

@ -39,6 +39,7 @@ apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: drop-www-redirect
namespace: website
spec:
redirectRegex:
regex: ^https://www.goudham.com/(.*)
Loading…
Cancel
Save