Skip to content

Commit

Permalink
Merge pull request #439 from joachimBurket/fix/support-sslrootcert-op…
Browse files Browse the repository at this point in the history
…tion

Improve database client options templating
  • Loading branch information
RangerRick authored Dec 18, 2024
2 parents 1e2ee30 + b75ef57 commit ab76db1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charts/netbox/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: netbox
version: 5.0.0-beta.173
version: 5.0.0-beta.174
appVersion: "v4.1.8"
type: application
kubeVersion: ^1.25.0-0
Expand Down
3 changes: 1 addition & 2 deletions charts/netbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,9 @@ The following table lists the configurable parameters for this chart and their d
| `externalDatabase.password` | Password for external PostgreSQL (see also `existingSecret`) | `""` |
| `externalDatabase.existingSecretName` | Fetch password for external PostgreSQL from a different `Secret` | `""` |
| `externalDatabase.existingSecretKey` | Key to fetch the password in the above `Secret` | `postgresql-password` |
| `externalDatabase.sslMode` | PostgreSQL client SSL Mode setting | `prefer` |
| `externalDatabase.connMaxAge` | The lifetime of a database connection, as an integer of seconds | `300` |
| `externalDatabase.disableServerSideCursors` | Disable the use of server-side cursors transaction pooling | `false` |
| `externalDatabase.targetSessionAttrs` | Determines whether the session must have certain properties | `read-write` |
| `externalDatabase.options` | Additional PostgreSQL client parameters | `{}` |
| `redis.enabled` | Deploy Redis using bundled Bitnami Redis chart | `true` |
| `redis.*` | Values under this key are passed to the bundled Redis chart | n/a |
| `tasksRedis.database` | Redis database number used for NetBox task queue | `0` |
Expand Down
4 changes: 1 addition & 3 deletions charts/netbox/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ data:
NAME: {{ .Values.externalDatabase.database | quote }}
PORT: {{ .Values.externalDatabase.port | int }}
{{- end }}
OPTIONS:
sslmode: {{ .Values.externalDatabase.sslMode | quote }}
target_session_attrs: {{ .Values.externalDatabase.targetSessionAttrs | default "read-write" | quote }}
OPTIONS: {{- include "common.tplvalues.render" (dict "value" .Values.externalDatabase.options "context" $) | nindent 8 }}
CONN_MAX_AGE: {{ .Values.externalDatabase.connMaxAge | int }}
DISABLE_SERVER_SIDE_CURSORS: {{ toJson .Values.externalDatabase.disableServerSideCursors }}
Expand Down
7 changes: 2 additions & 5 deletions charts/netbox/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,8 @@
"port": {
"type": "integer"
},
"sslMode": {
"type": "string"
},
"targetSessionAttrs": {
"type": "string"
"options": {
"type": "object"
},
"username": {
"type": "string"
Expand Down
8 changes: 6 additions & 2 deletions charts/netbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1027,10 +1027,14 @@ externalDatabase:
existingSecretKey: postgresql-password

# The following settings also apply when using the bundled PostgreSQL chart:
sslMode: prefer
connMaxAge: 300
disableServerSideCursors: false
targetSessionAttrs: read-write
## @param externalDatabase.options Additional PostgreSQL client parameters
## Ref: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
##
options:
sslmode: "prefer"
target_session_attrs: "read-write"

## Redis chart configuration
## https://github.com/bitnami/charts/blob/main/bitnami/redis/values.yaml
Expand Down

0 comments on commit ab76db1

Please sign in to comment.