This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
forked from mittwald/kube-httpcache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
values.yaml
293 lines (250 loc) · 7.05 KB
/
values.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# Default values for kube-httpcache.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: quay.io/mittwald/kube-httpcache
pullPolicy: IfNotPresent
tag: "stable"
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
# Enable StatefulSet (Deployment is default)
useStatefulset:
enabled: true
# Enable configMap for Varnish Template File (see below vclTemplate)
# OR use extravolume with name "template" if the file is too big
configmap:
enabled: true
# kube-httpcache specific configuration
cache:
# name of frontend service
# frontendService: kube-httpcache-headless
# name of backend service
backendService: backend-service
# name of backend service namespace
# backendServiceNamespace: backend-service-namespace
# watching for frontend changes is true by default
frontendWatch: true
# watching for backend changes is true by default
backendWatch: true
# Varnish storage backend type (https://varnish-cache.org/docs/trunk/users-guide/storage-backends.html)
varnishStorage: malloc # default,malloc,umem,file...
# Varnish storage backend size
storageSize: 128M # K(ibibytes), M(ebibytes), G(ibibytes), T(ebibytes) ... unlimited
# Varnish transient storage backend type (https://varnish-cache.org/docs/trunk/users-guide/storage-backends.html)
#varnishTransientStorage: malloc
# Varnish transient storage backend size
#transientStorageSize: 128M # K(ibibytes), M(ebibytes), G(ibibytes), T(ebibytes) ... unlimited
# Secret for Varnish admin credentials
#secret: "12345678"
# Read admin credentials from user provided secret
#existingSecret: kubecache-secret
cacheExtraArgs: {}
# cacheExtraArgs: |
# - -v=8
# - -varnish-additional-parameters=vcc_allow_inline_c=on
serviceAccount:
# Specifies whether a service account should be created
enabled: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
rbac:
enabled: true
# create a prometheus operator ServiceMonitor
serviceMonitor: false
podSecurityPolicy:
enabled: false
# name: unrestricted-psp
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
lifecycle: {}
# preStop:
# exec:
# command:
# - /bin/sh
# - -c
# - touch /etc/varnish/fail_probes; sleep 25
topologySpreadConstraints: {}
# - topologyKey: topology.kubernetes.io/zone
# maxSkew: 1
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchLabels:
# app.kubernetes.io/name: kube-httpcache
# - topologyKey: kubernetes.io/hostname
# maxSkew: 1
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchLabels:
# app.kubernetes.io/name: kube-httpcache
initContainers: {}
# initContainers: |
# - args:
# - -c
# - |
# echo "Copying external varnish template from..."
# command:
# - sh
# image: busybox:latest
# imagePullPolicy: IfNotPresent
# name: varnishtemplate
# resources: {}
# terminationMessagePath: /dev/termination-log
# terminationMessagePolicy: File
# volumeMounts:
# - name: template
# mountPath: /etc/varnish/tmpl
extraContainers: []
# - name: my-sidecar
# image: myapp/my-sidecar
# command:
# - my-sidecar-command
extraVolumes: {}
# extraVolumes:
# - emptyDir: {}
# name: template
extraMounts: {}
# extraMounts:
# - name: geoip
# mountPath: /var/lib/geoip
exporter:
enabled: false
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
resources: {}
livenessProbe: {}
# livenessProbe:
# httpGet:
# path: /
# port: 6083
readinessProbe: {}
service:
type: ClusterIP
port: 80
target: 8080
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts: []
# hosts:
# - host: www.example.com
# paths:
# - path: /
# pathType: Prefix
# backend:
# service:
# name: kube-httpcache
# port:
# number: 80
# - path: /backend
# backend:
# name: backend-service
# port:
# number: 8080
# - host: www2.example.com
# paths:
# - path: /
# pathType: Prefix
# backend:
# name: kube-httpcache
# port:
# number: 80
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
#terminationGracePeriodSeconds: 60
affinity: {}
livenessProbe: {}
# livenessProbe:
# httpGet:
# path: /
# port: 6083
readinessProbe: {}
vclTemplate: |
vcl 4.0;
import std;
import directors;
// ".Frontends" is a slice that contains all known Varnish instances
// (as selected by the service specified by -frontend-service).
// The backend name needs to be the Pod name, since this value is compared
// to the server identity ("server.identity" [1]) later.
//
// [1]: https://varnish-cache.org/docs/6.4/reference/vcl.html#local-server-remote-and-client
{{ range .Frontends }}
backend {{ .Name }} {
.host = "{{ .Host }}";
.port = "{{ .Port }}";
}
{{- end }}
{{ range .Backends }}
backend be-{{ .Name }} {
.host = "{{ .Host }}";
.port = "{{ .Port }}";
}
{{- end }}
sub vcl_init {
new cluster = directors.hash();
{{ range .Frontends -}}
cluster.add_backend({{ .Name }}, 1);
{{ end }}
new lb = directors.round_robin();
{{ range .Backends -}}
lb.add_backend(be-{{ .Name }});
{{ end }}
}
sub vcl_recv
{
# Set backend hint for non cachable objects.
set req.backend_hint = lb.backend();
# ...
# Routing logic. Pass a request to an appropriate Varnish node.
# See https://info.varnish-software.com/blog/creating-self-routing-varnish-cluster for more info.
unset req.http.x-cache;
set req.backend_hint = cluster.backend(req.url);
set req.http.x-shard = req.backend_hint;
if (req.http.x-shard != server.identity) {
return(pass);
}
set req.backend_hint = lb.backend();
# ...
return(hash);
}