Skip to content

Commit

Permalink
- Adjust ES and mongodb secret name defaults to avoid potential colli…
Browse files Browse the repository at this point in the history
…sion with graylog secret (helm#21071)

- Allow prepending http scheme to the ES uri fetched from a secret

Signed-off-by: Mohamed Hazem <mhaz@hellofresh.com>
  • Loading branch information
CVirus authored and includerandom committed Jul 19, 2020
1 parent e2adf80 commit 0cea60d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion stable/graylog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: graylog
home: https://www.graylog.org
version: 1.5.9
version: 1.6.0
appVersion: 3.1
description: Graylog is the centralized log management solution built to open standards for capturing, storing, and enabling real-time analysis of terabytes of machine data.
keywords:
Expand Down
5 changes: 3 additions & 2 deletions stable/graylog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ The following table lists the configurable parameters of the Graylog chart and t
| `graylog.existingRootSecret` | Graylog existing root secret | `` |
| `graylog.rootTimezone` | Graylog root timezone. | `UTC` |
| `graylog.elasticsearch.hosts` | Graylog Elasticsearch host name. You need to specific where data will be stored. | `` |
| `graylog.elasticsearch.uriSecretName` | K8s secret name where elasticsearch hosts will be set from. | `{{ graylog.fullname }}` |
| `graylog.elasticsearch.uriSecretName` | K8s secret name where elasticsearch hosts will be set from. | `{{ graylog.fullname }}-es` |
| `graylog.elasticsearch.uriSecretKey` | K8s secret key name where elasticsearch hosts will be set from. | `` |
| `graylog.elasticsearch.uriSSL` | Prepends 'https://' to the URL fetched from 'uriSecretKey' if true. Prepends http:// otherwise. | false |
| `graylog.mongodb.uri` | Graylog MongoDB connection string. You need to specific where data will be stored. | `` |
| `graylog.mongodb.uriSecretName` | K8s secret name where MongoDB URI will be set from. | `{{ graylog.fullname }}` |
| `graylog.mongodb.uriSecretName` | K8s secret name where MongoDB URI will be set from. | `{{ graylog.fullname }}-mongodb` |
| `graylog.mongodb.uriSecretKey` | K8s secret key name where MongoDB URI will be set from. | `` |
| `graylog.transportEmail.enabled` | If true, enable transport email settings on Graylog | `false` |
| `graylog.transportEmail.hostname` | The hostname of the server used to send the email | `` |
Expand Down
6 changes: 5 additions & 1 deletion stable/graylog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ Or use chart dependencies with release name
*/}}
{{- define "graylog.elasticsearch.hosts" -}}
{{- if .Values.graylog.elasticsearch.uriSecretKey }}
{{- printf "${GRAYLOG_ELASTICSEARCH_HOST}" -}}
{{- if .Values.graylog.elasticsearch.uriSSL }}
{{- printf "https://${GRAYLOG_ELASTICSEARCH_HOST}" -}}
{{- else }}
{{- printf "http://${GRAYLOG_ELASTICSEARCH_HOST}" -}}
{{- end }}
{{- else if .Values.graylog.elasticsearch.hosts }}
{{- .Values.graylog.elasticsearch.hosts -}}
{{- else }}
Expand Down
4 changes: 2 additions & 2 deletions stable/graylog/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ spec:
- name: GRAYLOG_ELASTICSEARCH_HOST
valueFrom:
secretKeyRef:
name: {{ .Values.graylog.elasticsearch.uriSecretName | default (include "graylog.fullname" .) }}
name: {{ .Values.graylog.elasticsearch.uriSecretName | default (printf "%s-es" (include "graylog.fullname" .)) }}
key: {{ .Values.graylog.elasticsearch.uriSecretKey }}
{{- end }}
{{- if .Values.graylog.mongodb.uriSecretKey }}
- name: GRAYLOG_MONGODB_URI
valueFrom:
secretKeyRef:
name: {{ .Values.graylog.mongodb.uriSecretName | default (include "graylog.fullname" .) }}
name: {{ .Values.graylog.mongodb.uriSecretName | default (printf "%s-mongodb" (include "graylog.fullname" .)) }}
key: {{ .Values.graylog.mongodb.uriSecretKey }}
{{- end }}
{{- range $key, $value := .Values.graylog.env }}
Expand Down
5 changes: 3 additions & 2 deletions stable/graylog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,18 @@ graylog:
# hosts: http://elasticsearch-client.graylog.svc.cluster.local:9200
hosts: ""
# Allow elasticsearch hosts to be fetched from a k8s secret
# {{ graylog.fullname }} will be used as uriSecretName if left empty
# {{ graylog.fullname }}-es will be used as uriSecretName if left empty
uriSecretName: ""
uriSecretKey: ""
uriSSL: false

mongodb:
## MongoDB connection string
## See https://docs.mongodb.com/manual/reference/connection-string/ for details
# uri: mongodb://user:pass@host1:27017,host2:27017,host3:27017/graylog?replicaSet=rs01
uri: ""
# Allow mongodb uri to be fetched from a k8s secret
# {{ graylog.fullname }} will be used as uriSecretName if left empty
# {{ graylog.fullname }}-mongodb will be used as uriSecretName if left empty
uriSecretName: ""
uriSecretKey: ""

Expand Down

0 comments on commit 0cea60d

Please sign in to comment.