@@ -388,31 +388,20 @@ volumes:
388
388
List of volumes for controller.
389
389
*/} }
390
390
{ {- define " nginx-ingress.volumeEntries" -} }
391
- { {- /* detect if a VCT named nginx-cache exists */ -} }
392
- { {- $flags := dict " hasCacheVCT" false -} }
393
- { {- range $i , $tpl := (.Values.controller.statefulset.volumeClaimTemplates | default (list)) -} }
394
- { {- if eq (default " " $tpl .metadata.name) " nginx-cache" -} }
395
- { {- $_ := set $flags " hasCacheVCT" true -} }
396
- { {- end -} }
397
- { {- end -} }
398
-
399
391
{ {- if eq (include " nginx-ingress.readOnlyRootFilesystem" .) " true" } }
400
392
- name: nginx-etc
401
393
emptyDir: { }
402
- { {- if .Values.controller.cache.enableShared } }
403
- - name: nginx-cache
404
- persistentVolumeClaim:
405
- claimName: { { .Values.controller.cache.sharedPVCName } }
406
- { {- else if not (get $flags " hasCacheVCT" ) } }
407
- - name: nginx-cache
408
- emptyDir: { }
409
- { {- end } }
410
394
- name: nginx-lib
411
395
emptyDir: { }
412
396
- name: nginx-state
413
397
emptyDir: { }
414
398
- name: nginx-log
415
399
emptyDir: { }
400
+ { {- /* For StatefulSet, nginx-cache volume is always provided via volumeClaimTemplates */ -} }
401
+ { {- if ne .Values.controller.kind " statefulset" } }
402
+ - name: nginx-cache
403
+ emptyDir: { }
404
+ { {- end } }
416
405
{ {- end } }
417
406
{ {- if .Values.controller.appprotect.v5 } }
418
407
{ { toYaml .Values.controller.appprotect.volumes } }
@@ -472,6 +461,9 @@ volumeMounts:
472
461
name: nginx-state
473
462
- mountPath: /var/log/nginx
474
463
name: nginx-log
464
+ { {- else if eq .Values.controller.kind " statefulset" } }
465
+ - mountPath: /var/cache/nginx
466
+ name: nginx-cache
475
467
{ {- end } }
476
468
{ {- if .Values.controller.appprotect.v5 } }
477
469
- name: app-protect-bd-config
0 commit comments