Skip to content

Commit eaee0fe

Browse files
committed
apply changes from @fernandezcuesta
Signed-off-by: kiblik <5609770+kiblik@users.noreply.github.com>
1 parent d02ce03 commit eaee0fe

File tree

5 files changed

+46
-7
lines changed

5 files changed

+46
-7
lines changed

helm/defectdojo/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,9 @@ A Helm chart for Kubernetes to install DefectDojo
748748
| postgresql.primary.podSecurityContext.enabled | bool | `true` | Default is true for K8s. Enabled needs to false for OpenShift restricted SCC and true for anyuid SCC |
749749
| postgresql.primary.podSecurityContext.fsGroup | int | `1001` | fsGroup specification below is not applied if enabled=false. enabled=false is the required setting for OpenShift "restricted SCC" to work successfully. |
750750
| postgresql.volumePermissions.containerSecurityContext | object | `{"runAsUser":1001}` | if using restricted SCC set runAsUser: "auto" and if running under anyuid SCC - runAsUser needs to match the line above |
751-
| redisParams | string | `""` | Parameters attached to the redis connection string, defaults to "ssl_cert_reqs=optional" if `valkey.tls.enabled` |
751+
| redisParams | string | `""` | Parameters attached to the redis connection string, defaults to "ssl_cert_reqs=optional" if `redisScheme` is `rediss` |
752+
| redisScheme | string | `"redis"` | Define the protocol to use with the external Redis instance |
753+
| redisServer | string | `nil` | To use an external Redis instance, set `redis.enabled` to false and set the address here: |
752754
| redisServer | string | `nil` | To use an external Redis instance, set `redis.enabled` to false and set the address here: |
753755
| revisionHistoryLimit | int | `10` | Allow overriding of revisionHistoryLimit across all deployments. |
754756
| secrets.annotations | object | `{}` | Add annotations for secret resources |
@@ -769,6 +771,7 @@ A Helm chart for Kubernetes to install DefectDojo
769771
| valkey.enabled | bool | `true` | To use an external instance, switch enabled to `false` and set the address in `redisServer` below |
770772
| valkey.service | object | `{"port":6379}` | To use a different port for Redis (default: 6379) |
771773
| valkey.tls.enabled | bool | `false` | If TLS is enabled, the Redis broker will use the redis:// and optionally mount the certificates from an existing secret. |
774+
| valkeyParams | string | `""` | Parameters attached to the valkey connection string, defaults to "ssl_cert_reqs=optional" if `valkey.tls.enabled` |
772775
773776
----------------------------------------------
774777
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

helm/defectdojo/templates/_helpers.tpl

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,33 @@
6565
{{- end -}}
6666
{{- end -}}
6767

68+
{{- /*
69+
Determine the default params to use for Redis.
70+
*/}}
71+
{{- define "redis.params" -}}
72+
{{- $redisScheme := include "redis.scheme" . -}}
73+
{{- $defaultBrokerParams := ternary "ssl_cert_reqs=optional" "" (eq "rediss" $redisScheme) -}}
74+
{{- if .Values.valkey.enabled -}}
75+
{{- default $defaultBrokerParams .Values.valkeyParams -}}
76+
{{- else -}}
77+
{{- default $defaultBrokerParams .Values.redisParams -}}
78+
{{- end -}}
79+
{{- end -}}
80+
6881
{{- /*
6982
Determine the protocol to use for Redis.
7083
*/}}
7184
{{- define "redis.scheme" -}}
85+
{{- if .Values.valkey.enabled -}}
7286
{{- if .Values.valkey.tls.enabled -}}
73-
{{- printf "rediss" -}}
87+
rediss
7488
{{- else if .Values.valkey.sentinel.enabled -}}
75-
{{- printf "sentinel" -}}
89+
sentinel
90+
{{- else -}}
91+
redis
92+
{{- end -}}
7693
{{- else -}}
77-
{{- printf "redis" -}}
94+
{{- .Values.redisScheme -}}
7895
{{- end -}}
7996
{{- end -}}
8097

helm/defectdojo/templates/configmap.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{- $fullName := include "defectdojo.fullname" . -}}
2-
{{- $defaultBrokerParams := ternary "ssl_cert_reqs=optional" "" .Values.valkey.tls.enabled -}}
2+
{{- $redisScheme := include "redis.scheme" . -}}
3+
{{- $defaultBrokerParams := ternary "ssl_cert_reqs=optional" "" (eq "rediss" $redisScheme) -}}
34
apiVersion: v1
45
kind: ConfigMap
56
metadata:

helm/defectdojo/values.schema.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,11 @@
13211321
}
13221322
},
13231323
"redisParams": {
1324-
"description": "Parameters attached to the redis connection string, defaults to \"ssl_cert_reqs=optional\" if `valkey.tls.enabled`",
1324+
"description": "Parameters attached to the redis connection string, defaults to \"ssl_cert_reqs=optional\" if `redisScheme` is `rediss`",
1325+
"type": "string"
1326+
},
1327+
"redisScheme": {
1328+
"description": "Define the protocol to use with the external Redis instance",
13251329
"type": "string"
13261330
},
13271331
"redisServer": {
@@ -1505,6 +1509,10 @@
15051509
}
15061510
}
15071511
}
1512+
},
1513+
"valkeyParams": {
1514+
"description": "Parameters attached to the valkey connection string, defaults to \"ssl_cert_reqs=optional\" if `valkey.tls.enabled`",
1515+
"type": "string"
15081516
}
15091517
}
15101518
}

helm/defectdojo/values.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,18 @@ localsettingspy: ""
702702
# @schema type:[string, null]
703703
# -- To use an external Redis instance, set `redis.enabled` to false and set the address here:
704704
redisServer: ~
705-
# -- Parameters attached to the redis connection string, defaults to "ssl_cert_reqs=optional" if `valkey.tls.enabled`
705+
# -- Parameters attached to the valkey connection string, defaults to "ssl_cert_reqs=optional" if `valkey.tls.enabled`
706+
valkeyParams: ""
707+
#
708+
# External database support.
709+
#
710+
# @schema type:[string, null]
711+
# -- To use an external Redis instance, set `redis.enabled` to false and set the address here:
712+
redisServer: ~
713+
# -- Parameters attached to the redis connection string, defaults to "ssl_cert_reqs=optional" if `redisScheme` is `rediss`
706714
redisParams: ""
715+
# -- Define the protocol to use with the external Redis instance
716+
redisScheme: redis
707717
#
708718
# @schema type:[string, null]
709719
# -- To use an external PostgreSQL instance (like CloudSQL), set `postgresql.enabled` to false,

0 commit comments

Comments
 (0)