@bluedynamics/cdk8s-plone 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.jsii +2 -2
  2. package/lib/config/plone-vinyl-backend-response.vcl +25 -0
  3. package/lib/config/plone-vinyl-recv.vcl +18 -0
  4. package/{examples/volto → lib}/config/varnish.tpl.vcl +1 -1
  5. package/lib/httpcache.js +1 -1
  6. package/lib/plone.js +1 -1
  7. package/lib/vinylcache.js +1 -1
  8. package/package.json +3 -2
  9. package/.claude/claude.md +0 -39
  10. package/.claude/settings.local.json +0 -31
  11. package/CLAUDE.md +0 -352
  12. package/docs/superpowers/plans/2026-06-12-configurable-service-spec.md +0 -608
  13. package/docs/superpowers/specs/2026-06-12-configurable-service-spec-design.md +0 -192
  14. package/documentation/Makefile +0 -357
  15. package/documentation/README.md +0 -284
  16. package/documentation/mx.ini +0 -3
  17. package/documentation/sources/_static/logo.svg +0 -79
  18. package/documentation/sources/conf.py +0 -145
  19. package/documentation/sources/explanation/architecture.md +0 -336
  20. package/documentation/sources/explanation/cdk8s-workflow.md +0 -66
  21. package/documentation/sources/explanation/features.md +0 -374
  22. package/documentation/sources/explanation/index.md +0 -34
  23. package/documentation/sources/how-to/backup-and-restore.md +0 -107
  24. package/documentation/sources/how-to/configure-env-and-secrets.md +0 -184
  25. package/documentation/sources/how-to/configure-ingress-tls.md +0 -108
  26. package/documentation/sources/how-to/configure-security-context.md +0 -143
  27. package/documentation/sources/how-to/deploy-blicca.md +0 -334
  28. package/documentation/sources/how-to/deploy-volto.md +0 -324
  29. package/documentation/sources/how-to/deploy-with-httpcache.md +0 -224
  30. package/documentation/sources/how-to/deploy-with-vinyl-cache.md +0 -273
  31. package/documentation/sources/how-to/enable-prometheus-monitoring.md +0 -122
  32. package/documentation/sources/how-to/index.md +0 -85
  33. package/documentation/sources/how-to/scale-and-high-availability.md +0 -122
  34. package/documentation/sources/how-to/schedule-pods.md +0 -145
  35. package/documentation/sources/how-to/setup-prerequisites.md +0 -363
  36. package/documentation/sources/how-to/troubleshooting.md +0 -113
  37. package/documentation/sources/how-to/upgrade-and-rollout.md +0 -140
  38. package/documentation/sources/index.md +0 -109
  39. package/documentation/sources/reference/api/index.md +0 -40
  40. package/documentation/sources/reference/configuration-options.md +0 -352
  41. package/documentation/sources/reference/index.md +0 -41
  42. package/documentation/sources/tutorials/01-quick-start.md +0 -165
  43. package/documentation/sources/tutorials/index.md +0 -53
  44. package/examples/blicca/.env.example +0 -20
  45. package/examples/blicca/README.md +0 -339
  46. package/examples/blicca/__snapshots__/main.test.ts.snap +0 -1035
  47. package/examples/blicca/cdk8s.yaml +0 -6
  48. package/examples/blicca/config/varnish.tpl.vcl +0 -217
  49. package/examples/blicca/ingress.ts +0 -217
  50. package/examples/blicca/jest.config.js +0 -11
  51. package/examples/blicca/main.test.ts +0 -18
  52. package/examples/blicca/main.ts +0 -101
  53. package/examples/blicca/package.json +0 -36
  54. package/examples/blicca/postgres.cloudnativepg.ts +0 -63
  55. package/examples/blicca/postgres.plain.ts +0 -115
  56. package/examples/blicca/tsconfig.json +0 -33
  57. package/examples/volto/.env.example +0 -21
  58. package/examples/volto/README.md +0 -292
  59. package/examples/volto/__snapshots__/main.test.ts.snap +0 -1206
  60. package/examples/volto/cdk8s.yaml +0 -6
  61. package/examples/volto/ingress.ts +0 -229
  62. package/examples/volto/jest.config.js +0 -11
  63. package/examples/volto/main.test.ts +0 -18
  64. package/examples/volto/main.ts +0 -105
  65. package/examples/volto/package.json +0 -36
  66. package/examples/volto/postgres.cloudnativepg.ts +0 -63
  67. package/examples/volto/postgres.plain.ts +0 -115
  68. package/examples/volto/tsconfig.json +0 -33
@@ -1,1035 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Blicca Example Synthesizes correctly 1`] = `
4
- [
5
- {
6
- "apiVersion": "v1",
7
- "kind": "Secret",
8
- "metadata": {
9
- "labels": {
10
- "app.kubernetes.io/component": "database",
11
- "app.kubernetes.io/instance": "postgresql",
12
- "app.kubernetes.io/name": "plone-postgresql",
13
- "app.kubernetes.io/part-of": "plone",
14
- },
15
- "name": "test-chart-db-secret-c8d5f897",
16
- },
17
- "stringData": {
18
- "database": "plone",
19
- "password": "admin@plone",
20
- "username": "plone",
21
- },
22
- },
23
- {
24
- "apiVersion": "v1",
25
- "kind": "Service",
26
- "metadata": {
27
- "labels": {
28
- "app.kubernetes.io/component": "database",
29
- "app.kubernetes.io/instance": "postgresql",
30
- "app.kubernetes.io/name": "plone-postgresql",
31
- "app.kubernetes.io/part-of": "plone",
32
- },
33
- "name": "test-chart-db-service-c87c80f5",
34
- },
35
- "spec": {
36
- "ports": [
37
- {
38
- "name": "postgresql",
39
- "port": 5432,
40
- "targetPort": 5432,
41
- },
42
- ],
43
- "selector": {
44
- "app.kubernetes.io/component": "database",
45
- "app.kubernetes.io/instance": "postgresql",
46
- "app.kubernetes.io/name": "plone-postgresql",
47
- "app.kubernetes.io/part-of": "plone",
48
- },
49
- },
50
- },
51
- {
52
- "apiVersion": "apps/v1",
53
- "kind": "StatefulSet",
54
- "metadata": {
55
- "labels": {
56
- "app.kubernetes.io/component": "database",
57
- "app.kubernetes.io/instance": "postgresql",
58
- "app.kubernetes.io/name": "plone-postgresql",
59
- "app.kubernetes.io/part-of": "plone",
60
- },
61
- "name": "test-chart-db-c879c687",
62
- },
63
- "spec": {
64
- "replicas": 1,
65
- "selector": {
66
- "matchLabels": {
67
- "app.kubernetes.io/component": "database",
68
- "app.kubernetes.io/instance": "postgresql",
69
- "app.kubernetes.io/name": "plone-postgresql",
70
- "app.kubernetes.io/part-of": "plone",
71
- },
72
- },
73
- "serviceName": "test-chart-db-service-c87c80f5",
74
- "template": {
75
- "metadata": {
76
- "labels": {
77
- "app.kubernetes.io/component": "database",
78
- "app.kubernetes.io/instance": "postgresql",
79
- "app.kubernetes.io/name": "plone-postgresql",
80
- "app.kubernetes.io/part-of": "plone",
81
- },
82
- },
83
- "spec": {
84
- "containers": [
85
- {
86
- "env": [
87
- {
88
- "name": "POSTGRES_USER",
89
- "valueFrom": {
90
- "secretKeyRef": {
91
- "key": "username",
92
- "name": "test-chart-db-secret-c8d5f897",
93
- },
94
- },
95
- },
96
- {
97
- "name": "POSTGRES_PASSWORD",
98
- "valueFrom": {
99
- "secretKeyRef": {
100
- "key": "password",
101
- "name": "test-chart-db-secret-c8d5f897",
102
- },
103
- },
104
- },
105
- {
106
- "name": "POSTGRES_DB",
107
- "valueFrom": {
108
- "secretKeyRef": {
109
- "key": "database",
110
- "name": "test-chart-db-secret-c8d5f897",
111
- },
112
- },
113
- },
114
- {
115
- "name": "PGDATA",
116
- "value": "/var/lib/postgresql/data/pgdata",
117
- },
118
- ],
119
- "image": "postgres:18",
120
- "livenessProbe": {
121
- "exec": {
122
- "command": [
123
- "pg_isready",
124
- "-U",
125
- "plone",
126
- "-d",
127
- "plone",
128
- ],
129
- },
130
- "initialDelaySeconds": 30,
131
- "periodSeconds": 15,
132
- "timeoutSeconds": 5,
133
- },
134
- "name": "postgresql",
135
- "ports": [
136
- {
137
- "containerPort": 5432,
138
- "name": "postgresql",
139
- },
140
- ],
141
- "readinessProbe": {
142
- "exec": {
143
- "command": [
144
- "pg_isready",
145
- "-U",
146
- "plone",
147
- "-d",
148
- "plone",
149
- ],
150
- },
151
- "initialDelaySeconds": 10,
152
- "periodSeconds": 10,
153
- "timeoutSeconds": 5,
154
- },
155
- "resources": {
156
- "limits": {
157
- "cpu": "1",
158
- "memory": "1Gi",
159
- },
160
- "requests": {
161
- "cpu": "100m",
162
- "memory": "256Mi",
163
- },
164
- },
165
- "volumeMounts": [
166
- {
167
- "mountPath": "/var/lib/postgresql/data",
168
- "name": "data",
169
- },
170
- ],
171
- },
172
- ],
173
- "securityContext": {
174
- "fsGroup": 999,
175
- },
176
- },
177
- },
178
- "volumeClaimTemplates": [
179
- {
180
- "metadata": {
181
- "labels": {
182
- "app.kubernetes.io/component": "database",
183
- "app.kubernetes.io/instance": "postgresql",
184
- "app.kubernetes.io/name": "plone-postgresql",
185
- "app.kubernetes.io/part-of": "plone",
186
- },
187
- "name": "data",
188
- },
189
- "spec": {
190
- "accessModes": [
191
- "ReadWriteOnce",
192
- ],
193
- "resources": {
194
- "requests": {
195
- "storage": "10Gi",
196
- },
197
- },
198
- },
199
- },
200
- ],
201
- },
202
- },
203
- {
204
- "apiVersion": "apps/v1",
205
- "kind": "Deployment",
206
- "metadata": {
207
- "labels": {
208
- "app.kubernetes.io/component": "backend",
209
- "app.kubernetes.io/name": "plone-backend-deployment",
210
- },
211
- "name": "test-chart-plone-backend-deployment-c8a3055e",
212
- },
213
- "spec": {
214
- "replicas": 2,
215
- "selector": {
216
- "matchLabels": {
217
- "app": "test-chart-plone-backend-c8848738",
218
- },
219
- },
220
- "template": {
221
- "metadata": {
222
- "labels": {
223
- "app": "test-chart-plone-backend-c8848738",
224
- "app.kubernetes.io/component": "backend",
225
- "app.kubernetes.io/managed-by": "cdk8s-plone",
226
- "app.kubernetes.io/name": "plone-backend",
227
- "app.kubernetes.io/part-of": "plone",
228
- "app.kubernetes.io/version": "blicca.version",
229
- },
230
- },
231
- "spec": {
232
- "containers": [
233
- {
234
- "env": [
235
- {
236
- "name": "SECRET_POSTGRESQL_USERNAME",
237
- "valueFrom": {
238
- "secretKeyRef": {
239
- "key": "username",
240
- "name": "test-chart-db-secret-c8d5f897",
241
- },
242
- },
243
- },
244
- {
245
- "name": "SECRET_POSTGRESQL_PASSWORD",
246
- "valueFrom": {
247
- "secretKeyRef": {
248
- "key": "password",
249
- "name": "test-chart-db-secret-c8d5f897",
250
- },
251
- },
252
- },
253
- {
254
- "name": "INSTANCE_db_storage",
255
- "value": "relstorage",
256
- },
257
- {
258
- "name": "INSTANCE_db_blob_mode",
259
- "value": "cache",
260
- },
261
- {
262
- "name": "INSTANCE_db_cache_size",
263
- "value": "5000",
264
- },
265
- {
266
- "name": "INSTANCE_db_cache_size_bytes",
267
- "value": "1500MB",
268
- },
269
- {
270
- "name": "INSTANCE_db_relstorage",
271
- "value": "postgresql",
272
- },
273
- {
274
- "name": "INSTANCE_db_relstorage_postgresql_dsn",
275
- "value": "host='test-chart-db-service-c87c80f5' dbname='plone' user='$(SECRET_POSTGRESQL_USERNAME)' password='$(SECRET_POSTGRESQL_PASSWORD)'",
276
- },
277
- {
278
- "name": "INSTANCE_db_relstorage_cache_local_mb",
279
- "value": "800",
280
- },
281
- ],
282
- "envFrom": [],
283
- "image": "plone/plone-backend:6.1.3",
284
- "imagePullPolicy": "IfNotPresent",
285
- "name": "backend-container",
286
- "readinessProbe": {
287
- "failureThreshold": 3,
288
- "httpGet": {
289
- "path": "/",
290
- "port": 8080,
291
- },
292
- "initialDelaySeconds": 10,
293
- "periodSeconds": 10,
294
- "successThreshold": 1,
295
- "timeoutSeconds": 15,
296
- },
297
- "resources": {
298
- "limits": {
299
- "cpu": "500m",
300
- "memory": "512Mi",
301
- },
302
- "requests": {
303
- "cpu": "200m",
304
- "memory": "256Mi",
305
- },
306
- },
307
- },
308
- ],
309
- "imagePullSecrets": [],
310
- },
311
- },
312
- },
313
- },
314
- {
315
- "apiVersion": "policy/v1",
316
- "kind": "PodDisruptionBudget",
317
- "metadata": {
318
- "labels": {
319
- "app.kubernetes.io/managed-by": "cdk8s-plone",
320
- "app.kubernetes.io/part-of": "plone",
321
- },
322
- "name": "test-chart-plone-backend-pdb-c8a5ffa9",
323
- },
324
- "spec": {
325
- "minAvailable": 1,
326
- "selector": {
327
- "matchLabels": {
328
- "app": "test-chart-plone-backend-c8848738",
329
- },
330
- },
331
- "unhealthyPodEvictionPolicy": "AlwaysAllow",
332
- },
333
- },
334
- {
335
- "apiVersion": "v1",
336
- "kind": "Service",
337
- "metadata": {
338
- "labels": {
339
- "app.kubernetes.io/component": "service",
340
- "app.kubernetes.io/managed-by": "cdk8s-plone",
341
- "app.kubernetes.io/name": "plone-backend-service",
342
- "app.kubernetes.io/part-of": "plone",
343
- },
344
- "name": "test-chart-plone-backend-service-c81ad65d",
345
- },
346
- "spec": {
347
- "ports": [
348
- {
349
- "name": "backend-http",
350
- "port": 8080,
351
- "targetPort": 8080,
352
- },
353
- ],
354
- "selector": {
355
- "app": "test-chart-plone-backend-c8848738",
356
- },
357
- },
358
- },
359
- {
360
- "apiVersion": "policy/v1",
361
- "kind": "PodDisruptionBudget",
362
- "metadata": {
363
- "labels": {
364
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
365
- "app.kubernetes.io/managed-by": "Helm",
366
- "app.kubernetes.io/name": "kube-httpcache",
367
- "app.kubernetes.io/version": "v0.9.1",
368
- "helm.sh/chart": "kube-httpcache-0.9.1",
369
- },
370
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
371
- },
372
- "spec": {
373
- "maxUnavailable": 1,
374
- "selector": {
375
- "matchLabels": {
376
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
377
- "app.kubernetes.io/name": "kube-httpcache",
378
- },
379
- },
380
- },
381
- },
382
- {
383
- "apiVersion": "v1",
384
- "kind": "ServiceAccount",
385
- "metadata": {
386
- "labels": {
387
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
388
- "app.kubernetes.io/managed-by": "Helm",
389
- "app.kubernetes.io/name": "kube-httpcache",
390
- "app.kubernetes.io/version": "v0.9.1",
391
- "helm.sh/chart": "kube-httpcache-0.9.1",
392
- },
393
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
394
- },
395
- },
396
- {
397
- "apiVersion": "v1",
398
- "data": {
399
- "secret": "<redacted-for-snapshot>",
400
- },
401
- "kind": "Secret",
402
- "metadata": {
403
- "labels": {
404
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
405
- "app.kubernetes.io/managed-by": "Helm",
406
- "app.kubernetes.io/name": "kube-httpcache",
407
- "app.kubernetes.io/version": "v0.9.1",
408
- "helm.sh/chart": "kube-httpcache-0.9.1",
409
- },
410
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
411
- },
412
- "type": "Opaque",
413
- },
414
- {
415
- "apiVersion": "v1",
416
- "data": {
417
- "default.vcl.tmpl": "vcl 4.0;
418
-
419
- import std;
420
- import directors;
421
-
422
- probe ploneBackendProbe {
423
- .url = "/";
424
- .timeout = 5s;
425
- .interval = 15s;
426
- .window = 10;
427
- .threshold = 8;
428
- }
429
-
430
- backend ploneBackend {
431
- .host = "{{ .Env.BACKEND_SERVICE_NAME }}";
432
- .port = "{{ .Env.BACKEND_SERVICE_PORT }}";
433
- .probe = ploneBackendProbe;
434
- .connect_timeout = 0.5s;
435
- .first_byte_timeout = 120s;
436
- .between_bytes_timeout = 60s;
437
- }
438
-
439
- /* Only allow PURGE from kubernetes network */
440
- acl purge {
441
- "10.0.0.0/8";
442
- }
443
-
444
- sub detect_debug{
445
- # Requests with X-Varnish-Debug will display additional
446
- # information about requests
447
- unset req.http.x-vcl-debug;
448
- set req.http.x-vcl-debug = true;
449
- }
450
-
451
- sub detect_auth{
452
- unset req.http.x-auth;
453
- if (
454
- (req.http.Cookie && (
455
- req.http.Cookie ~ "__ac(_(name|password|persistent))?=" ||
456
- req.http.Cookie ~ "_ZopeId" ||
457
- req.http.Cookie ~ "auth_token")) ||
458
- (req.http.Authenticate) ||
459
- (req.http.Authorization)
460
- ) {
461
- set req.http.x-auth = true;
462
- }
463
- }
464
-
465
- sub vcl_init {
466
- new lbPloneBackend = directors.round_robin();
467
- lbPloneBackend.add_backend(ploneBackend);
468
- }
469
-
470
- sub vcl_recv {
471
- # Annotate request with x-vcl-debug
472
- call detect_debug;
473
-
474
- # Annotate request with x-auth indicating if request is authenticated or not
475
- call detect_auth;
476
-
477
- # Routing: All traffic goes to Plone backend for Blicca
478
- set req.backend_hint = lbPloneBackend.backend();
479
-
480
- # short cut authenticated requests to pass
481
- if (req.http.x-auth) {
482
- return(pass);
483
- }
484
-
485
- # Sanitize cookies so they do not needlessly destroy cacheability for anonymous pages
486
- if (req.http.Cookie) {
487
- set req.http.Cookie = ";" + req.http.Cookie;
488
- set req.http.Cookie = regsuball(req.http.Cookie, "; +", ";");
489
- set req.http.Cookie = regsuball(req.http.Cookie, ";(sticky|I18N_LANGUAGE|statusmessages|__ac|_ZopeId|__cp|beaker\\.session|authomatic|serverid|__rf|auth_token)=", "; \\1=");
490
- set req.http.Cookie = regsuball(req.http.Cookie, ";[^ ][^;]*", "");
491
- set req.http.Cookie = regsuball(req.http.Cookie, "^[; ]+|[; ]+$", "");
492
-
493
- if (req.http.Cookie == "") {
494
- unset req.http.Cookie;
495
- }
496
- }
497
-
498
- # Handle the different request types
499
- if (req.method == "PURGE") {
500
- if (!client.ip ~ purge) {
501
- return (synth(405, "Not allowed."));
502
- } else {
503
- ban("req.url == " + req.url);
504
- return (synth(200, "Purged."));
505
- }
506
-
507
- } elseif (req.method == "BAN") {
508
- # Same ACL check as above:
509
- if (!client.ip ~ purge) {
510
- return (synth(405, "Not allowed."));
511
- }
512
- ban("req.http.host == " + req.http.host + "&& req.url == " + req.url);
513
- # Throw a synthetic page so the
514
- # request won't go to the backend.
515
- return (synth(200, "Ban added"));
516
-
517
- } elseif (req.method != "GET" &&
518
- req.method != "HEAD" &&
519
- req.method != "PUT" &&
520
- req.method != "POST" &&
521
- req.method != "PATCH" &&
522
- req.method != "TRACE" &&
523
- req.method != "OPTIONS" &&
524
- req.method != "DELETE") {
525
- /* Non-RFC2616 or CONNECT which is weird. */
526
- return (pipe);
527
- } elseif (req.method != "GET" &&
528
- req.method != "HEAD" &&
529
- req.method != "OPTIONS") {
530
- /* POST, PUT, PATCH will pass, always */
531
- return(pass);
532
- }
533
-
534
- return(hash);
535
- }
536
-
537
- sub vcl_pipe {
538
- /* This is not necessary if you do not do any request rewriting. */
539
- set req.http.connection = "close";
540
- }
541
-
542
- sub vcl_purge {
543
- return (synth(200, "PURGE: " + req.url + " - " + req.hash));
544
- }
545
-
546
- sub vcl_synth {
547
- if (resp.status == 301) {
548
- set resp.http.location = resp.reason;
549
- set resp.reason = "Moved";
550
- return (deliver);
551
- }
552
- }
553
-
554
- sub vcl_hit {
555
- if (obj.ttl >= 0s) {
556
- // A pure unadulterated hit, deliver it
557
- return (deliver);
558
- } elsif (obj.ttl + obj.grace > 0s) {
559
- // Object is in grace, deliver it
560
- // Automatically triggers a background fetch
561
- return (deliver);
562
- } else {
563
- return (restart);
564
- }
565
- }
566
-
567
-
568
- sub vcl_backend_response {
569
- # Don't allow static files to set cookies.
570
- # (?i) denotes case insensitive in PCRE (perl compatible regular expressions).
571
- if (bereq.url ~ "(?i)\\.(pdf|asc|dat|txt|doc|xls|ppt|tgz|png|gif|jpeg|jpg|ico|swf|css|js)(\\?.*)?$") {
572
- unset beresp.http.set-cookie;
573
- }
574
- if (beresp.http.Set-Cookie) {
575
- set beresp.http.x-varnish-action = "FETCH (pass - response sets cookie)";
576
- set beresp.uncacheable = true;
577
- set beresp.ttl = 120s;
578
- return(deliver);
579
- }
580
- if (beresp.http.Cache-Control ~ "(private|no-cache|no-store)") {
581
- set beresp.http.x-varnish-action = "FETCH (pass - cache control disallows)";
582
- set beresp.uncacheable = true;
583
- set beresp.ttl = 120s;
584
- return(deliver);
585
- }
586
-
587
- if (beresp.http.Authorization) {
588
- set beresp.http.x-varnish-action = "FETCH (pass - authorized and no public cache control)";
589
- set beresp.uncacheable = true;
590
- set beresp.ttl = 120s;
591
- return(deliver);
592
- }
593
-
594
- if (!beresp.http.Cache-Control) {
595
- set beresp.http.x-varnish-action = "FETCH (override - backend not setting cache control)";
596
- set beresp.uncacheable = true;
597
- set beresp.ttl = 120s;
598
- return (deliver);
599
- }
600
-
601
- if (beresp.http.X-Anonymous && !beresp.http.Cache-Control) {
602
- set beresp.http.x-varnish-action = "FETCH (override - anonymous backend not setting cache control)";
603
- set beresp.ttl = 600s;
604
- return (deliver);
605
- }
606
-
607
- set beresp.http.x-varnish-action = "FETCH (insert)";
608
- return (deliver);
609
- }
610
-
611
- sub vcl_deliver {
612
-
613
- if (req.http.x-vcl-debug) {
614
- set resp.http.x-varnish-ttl = obj.ttl;
615
- set resp.http.x-varnish-grace = obj.grace;
616
- set resp.http.x-hits = obj.hits;
617
- if (req.http.x-auth) {
618
- set resp.http.x-auth = "Logged-in";
619
- } else {
620
- set resp.http.x-auth = "Anon";
621
- }
622
- if (obj.hits > 0) {
623
- set resp.http.x-cache = "HIT";
624
- } else {
625
- set resp.http.x-cache = "MISS";
626
- }
627
- } else {
628
- unset resp.http.x-varnish-action;
629
- unset resp.http.x-cache-operation;
630
- unset resp.http.x-cache-rule;
631
- unset resp.http.x-powered-by;
632
- }
633
- }
634
- ",
635
- },
636
- "kind": "ConfigMap",
637
- "metadata": {
638
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
639
- },
640
- },
641
- {
642
- "apiVersion": "rbac.authorization.k8s.io/v1",
643
- "kind": "Role",
644
- "metadata": {
645
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
646
- },
647
- "rules": [
648
- {
649
- "apiGroups": [
650
- "",
651
- ],
652
- "resources": [
653
- "endpoints",
654
- "pods",
655
- ],
656
- "verbs": [
657
- "watch",
658
- "get",
659
- ],
660
- },
661
- ],
662
- },
663
- {
664
- "apiVersion": "rbac.authorization.k8s.io/v1",
665
- "kind": "RoleBinding",
666
- "metadata": {
667
- "labels": {
668
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
669
- "app.kubernetes.io/managed-by": "Helm",
670
- "app.kubernetes.io/name": "kube-httpcache",
671
- "app.kubernetes.io/version": "v0.9.1",
672
- "helm.sh/chart": "kube-httpcache-0.9.1",
673
- },
674
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
675
- },
676
- "roleRef": {
677
- "apiGroup": "rbac.authorization.k8s.io",
678
- "kind": "Role",
679
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
680
- },
681
- "subjects": [
682
- {
683
- "kind": "ServiceAccount",
684
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
685
- },
686
- ],
687
- },
688
- {
689
- "apiVersion": "v1",
690
- "kind": "Service",
691
- "metadata": {
692
- "labels": {
693
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
694
- "app.kubernetes.io/managed-by": "Helm",
695
- "app.kubernetes.io/name": "kube-httpcache",
696
- "app.kubernetes.io/version": "v0.9.1",
697
- "helm.sh/chart": "kube-httpcache-0.9.1",
698
- },
699
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
700
- },
701
- "spec": {
702
- "ports": [
703
- {
704
- "name": "http",
705
- "port": 80,
706
- "protocol": "TCP",
707
- "targetPort": 8080,
708
- },
709
- {
710
- "name": "signaller",
711
- "port": 8090,
712
- "targetPort": 8090,
713
- },
714
- {
715
- "name": "metrics",
716
- "port": 9131,
717
- "targetPort": 9131,
718
- },
719
- ],
720
- "selector": {
721
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
722
- "app.kubernetes.io/name": "kube-httpcache",
723
- },
724
- "type": "ClusterIP",
725
- },
726
- },
727
- {
728
- "apiVersion": "apps/v1",
729
- "kind": "StatefulSet",
730
- "metadata": {
731
- "labels": {
732
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
733
- "app.kubernetes.io/managed-by": "Helm",
734
- "app.kubernetes.io/name": "kube-httpcache",
735
- "app.kubernetes.io/version": "v0.9.1",
736
- "helm.sh/chart": "kube-httpcache-0.9.1",
737
- },
738
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
739
- },
740
- "spec": {
741
- "replicas": 2,
742
- "selector": {
743
- "matchLabels": {
744
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
745
- "app.kubernetes.io/name": "kube-httpcache",
746
- },
747
- },
748
- "serviceName": "test-chart-httpcache-c89dd29d-kube-httpcache",
749
- "template": {
750
- "metadata": {
751
- "labels": {
752
- "app.kubernetes.io/instance": "test-chart-httpcache-c89dd29d",
753
- "app.kubernetes.io/name": "kube-httpcache",
754
- },
755
- },
756
- "spec": {
757
- "containers": [
758
- {
759
- "args": [
760
- "-admin-addr=0.0.0.0",
761
- "-admin-port=6083",
762
- "-signaller-enable",
763
- "-signaller-port=8090",
764
- "-frontend-port=8080",
765
- "-frontend-watch=false",
766
- "-frontend-namespace=$(NAMESPACE)",
767
- "-frontend-service=test-chart-httpcache-c89dd29d-kube-httpcache",
768
- "-backend-watch",
769
- "-backend-namespace=$(NAMESPACE)",
770
- "-backend-service=test-chart-plone-backend-service-c81ad65d",
771
- "-varnish-secret-file=/etc/varnish/k8s-secret/secret",
772
- "-varnish-vcl-template=/etc/varnish/tmpl/default.vcl.tmpl",
773
- "-varnish-storage=malloc,128M",
774
- "-varnish-vcl-template-poll",
775
- "-backend-portname=backend-http",
776
- ],
777
- "env": [
778
- {
779
- "name": "NAMESPACE",
780
- "valueFrom": {
781
- "fieldRef": {
782
- "fieldPath": "metadata.namespace",
783
- },
784
- },
785
- },
786
- {
787
- "name": "BACKEND_SERVICE_NAME",
788
- "value": "test-chart-plone-backend-service-c81ad65d",
789
- },
790
- {
791
- "name": "BACKEND_SERVICE_PORT",
792
- "value": "8080",
793
- },
794
- {
795
- "name": "BACKEND_SITE_ID",
796
- "value": "Plone",
797
- },
798
- {
799
- "name": "FRONTEND_SERVICE_NAME",
800
- },
801
- {
802
- "name": "FRONTEND_SERVICE_PORT",
803
- "value": "3000",
804
- },
805
- ],
806
- "image": "quay.io/mittwald/kube-httpcache:stable",
807
- "imagePullPolicy": "IfNotPresent",
808
- "name": "kube-httpcache",
809
- "resources": {
810
- "limits": {
811
- "cpu": "500m",
812
- "memory": "500Mi",
813
- },
814
- "requests": {
815
- "cpu": "100m",
816
- "memory": "100Mi",
817
- },
818
- },
819
- "securityContext": {},
820
- "volumeMounts": [
821
- {
822
- "mountPath": "/etc/varnish/tmpl",
823
- "name": "template",
824
- },
825
- {
826
- "mountPath": "/etc/varnish/k8s-secret",
827
- "name": "secret",
828
- },
829
- {
830
- "mountPath": "/var/lib/varnish",
831
- "name": "var",
832
- },
833
- ],
834
- },
835
- {
836
- "args": [
837
- "-no-exit",
838
- ],
839
- "command": [
840
- "/exporter/prometheus_varnish_exporter",
841
- ],
842
- "env": [
843
- {
844
- "name": "VSM_NOPID",
845
- "value": "1",
846
- },
847
- ],
848
- "image": "quay.io/mittwald/kube-httpcache:stable",
849
- "imagePullPolicy": "IfNotPresent",
850
- "name": "exporter",
851
- "ports": [
852
- {
853
- "containerPort": 9131,
854
- "name": "metrics",
855
- },
856
- ],
857
- "resources": {
858
- "limits": {
859
- "cpu": "100m",
860
- "memory": "100Mi",
861
- },
862
- "requests": {
863
- "cpu": "10m",
864
- "memory": "50Mi",
865
- },
866
- },
867
- "securityContext": {},
868
- "volumeMounts": [
869
- {
870
- "mountPath": "/var/lib/varnish",
871
- "name": "var",
872
- },
873
- ],
874
- },
875
- ],
876
- "nodeSelector": {
877
- "kubernetes.io/arch": "amd64",
878
- },
879
- "securityContext": {},
880
- "serviceAccountName": "test-chart-httpcache-c89dd29d-kube-httpcache",
881
- "volumes": [
882
- {
883
- "configMap": {
884
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
885
- },
886
- "name": "template",
887
- },
888
- {
889
- "name": "secret",
890
- "secret": {
891
- "secretName": "test-chart-httpcache-c89dd29d-kube-httpcache",
892
- },
893
- },
894
- {
895
- "emptyDir": {},
896
- "name": "var",
897
- },
898
- ],
899
- },
900
- },
901
- },
902
- },
903
- {
904
- "apiVersion": "networking.k8s.io/v1",
905
- "kind": "Ingress",
906
- "metadata": {
907
- "annotations": {
908
- "cert-manager.io/cluster-issuer": "letsencrypt-prod",
909
- "kubernetes.io/ingress.class": "traefik",
910
- },
911
- "name": "test-chart-ingress-main-cached-c8b108e1",
912
- },
913
- "spec": {
914
- "ingressClassName": "traefik",
915
- "rules": [
916
- {
917
- "host": "plone-cached.example.com",
918
- "http": {
919
- "paths": [
920
- {
921
- "backend": {
922
- "service": {
923
- "name": "test-chart-httpcache-c89dd29d-kube-httpcache",
924
- "port": {
925
- "number": 80,
926
- },
927
- },
928
- },
929
- "path": "/",
930
- "pathType": "Prefix",
931
- },
932
- ],
933
- },
934
- },
935
- ],
936
- },
937
- },
938
- {
939
- "apiVersion": "traefik.io/v1alpha1",
940
- "kind": "Middleware",
941
- "metadata": {
942
- "name": "test-chart-ingress-main-uncached-addprefix-c820ef43",
943
- },
944
- "spec": {
945
- "addPrefix": {
946
- "prefix": "/VirtualHostBase/https/plone-uncached.example.com/Plone/VirtualHostRoot/",
947
- },
948
- },
949
- },
950
- {
951
- "apiVersion": "networking.k8s.io/v1",
952
- "kind": "Ingress",
953
- "metadata": {
954
- "annotations": {
955
- "cert-manager.io/cluster-issuer": "letsencrypt-prod",
956
- "kubernetes.io/ingress.class": "traefik",
957
- "traefik.ingress.kubernetes.io/router.middlewares": "plone-test-chart-ingress-main-uncached-addprefix-c820ef43@kubernetescrd",
958
- },
959
- "name": "test-chart-ingress-main-uncached-c85166a3",
960
- },
961
- "spec": {
962
- "ingressClassName": "traefik",
963
- "rules": [
964
- {
965
- "host": "plone-uncached.example.com",
966
- "http": {
967
- "paths": [
968
- {
969
- "backend": {
970
- "service": {
971
- "name": "test-chart-plone-backend-service-c81ad65d",
972
- "port": {
973
- "number": 8080,
974
- },
975
- },
976
- },
977
- "path": "/",
978
- "pathType": "Prefix",
979
- },
980
- ],
981
- },
982
- },
983
- ],
984
- },
985
- },
986
- {
987
- "apiVersion": "traefik.io/v1alpha1",
988
- "kind": "Middleware",
989
- "metadata": {
990
- "name": "test-chart-ingress-main-maintenance-addprefix-c8dc1efe",
991
- },
992
- "spec": {
993
- "addPrefix": {
994
- "prefix": "/VirtualHostBase/https/plone-maintenance.example.com/VirtualHostRoot/",
995
- },
996
- },
997
- },
998
- {
999
- "apiVersion": "networking.k8s.io/v1",
1000
- "kind": "Ingress",
1001
- "metadata": {
1002
- "annotations": {
1003
- "cert-manager.io/cluster-issuer": "letsencrypt-prod",
1004
- "kubernetes.io/ingress.class": "traefik",
1005
- "traefik.ingress.kubernetes.io/router.middlewares": "plone-test-chart-ingress-main-maintenance-addprefix-c8dc1efe@kubernetescrd",
1006
- },
1007
- "name": "test-chart-ingress-main-maintenance-c874242e",
1008
- },
1009
- "spec": {
1010
- "ingressClassName": "traefik",
1011
- "rules": [
1012
- {
1013
- "host": "plone-maintenance.example.com",
1014
- "http": {
1015
- "paths": [
1016
- {
1017
- "backend": {
1018
- "service": {
1019
- "name": "test-chart-plone-backend-service-c81ad65d",
1020
- "port": {
1021
- "number": 8080,
1022
- },
1023
- },
1024
- },
1025
- "path": "/",
1026
- "pathType": "Prefix",
1027
- },
1028
- ],
1029
- },
1030
- },
1031
- ],
1032
- },
1033
- },
1034
- ]
1035
- `;