Skip to content

Commit

Permalink
Add cache with healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdijk committed Oct 24, 2024
1 parent 7e24981 commit 8f6ac90
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
6 changes: 4 additions & 2 deletions apps/varnish-proxy/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ data:
sub vcl_recv {
# Healthcheck
if(req.url == "/healthcheck") {
return(synth(200,"OK"));
}
# Only a single backend
set req.backend_hint= default;
Expand Down
6 changes: 5 additions & 1 deletion apps/varnish-proxy/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ spec:
volumeMounts:
- name: varnish-config
mountPath: /etc/varnish/
readinessProbe:
httpGet:
path: /healthcheck
port: 80
volumes:
- name: varnish-config
configMap:
name: varnish-vcl
items:
- key: default.vcl
path: default.vcl
path: default.vcl
44 changes: 22 additions & 22 deletions apps/website/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,25 @@ spec:
- name: website-storage
persistentVolumeClaim:
claimName: website-storage
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
metadata:
namespace: default
name: website
spec:
default:
checkIntervalSec: 60
timeoutSec: 30
config:
type: HTTP
httpHealthCheck:
port: 80
host: ch.tudelft.nl
requestPath: /wp-json/
logConfig:
enabled: true
targetRef:
group: ""
kind: Service
name: website
# ---
# apiVersion: networking.gke.io/v1
# kind: HealthCheckPolicy
# metadata:
# namespace: default
# name: website
# spec:
# default:
# checkIntervalSec: 60
# timeoutSec: 30
# config:
# type: HTTP
# httpHealthCheck:
# port: 80
# host: ch.tudelft.nl
# requestPath: /wp-json/
# logConfig:
# enabled: true
# targetRef:
# group: ""
# kind: Service
# name: website
2 changes: 1 addition & 1 deletion apps/website/httproute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
- www.ch.tudelft.nl
rules:
- backendRefs:
- name: website
- name: varnish-svc
port: 80
- matches:
- path:
Expand Down

0 comments on commit 8f6ac90

Please sign in to comment.