Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/graylog] Add support for a single LB for all inputs
Browse files Browse the repository at this point in the history
Opens up the option to host all inputs behind a single service instead
of requiring n+2 services for UDP and TCP

Signed-off-by: Chris Barton <chris.barton@recurly.com>
  • Loading branch information
cbarton committed Mar 16, 2020
1 parent e8862ec commit 33fcf04
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
14 changes: 14 additions & 0 deletions stable/graylog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ The following table lists the configurable parameters of the Graylog chart and t
| `graylog.additionalJavaOpts` | Graylog service additional `JAVA_OPTS` | `` |
| `graylog.service.type` | Kubernetes Service type | `ClusterIP` |
| `graylog.service.port` | Graylog Service port | `9000` |
| `graylog.service.ports` | Graylog Service extra ports | `[]` |
| `graylog.service.master.enabled` | If true, Graylog Master Service will be created | `true` |
| `graylog.service.master.port` | Graylog Master Service port | `9000` |
| `graylog.service.master.annotations` | Graylog Master Service annotations | `{}` |
Expand Down Expand Up @@ -203,6 +204,19 @@ You can enable input ports by edit the `input` values. For example, you want to
port: 5410
```
OR, if you want to expose only a single service with all the input ports open, you can do so by specifying the `service.ports` value:
```
service:
ports:
- name: gelf
port: 12222
protocol: TCP
- name: syslog
port: 5410
protocol: UDP
```
Note: Name must be in IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])* and it must contains at least one letter [a-z], hyphens cannot be adjacent to other hyphens)
Note: The port list should be sorted by port number.
Expand Down
7 changes: 6 additions & 1 deletion stable/graylog/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ spec:
ports:
- containerPort: 9000
name: graylog
{{- range .Values.graylog.service.ports }}
- containerPort: {{ .port }}
name: {{ .name}}
protocol: {{ .protocol }}
{{- end }}
{{- with .Values.graylog.input }}
{{- if .udp }}
{{- range .udp.ports }}
Expand Down Expand Up @@ -220,7 +225,7 @@ spec:
- name: kubectl
emptyDir: {}
{{- if .Values.graylog.extraVolumes }}
{{ toYaml .Values.graylog.extraVolumes | indent 8}}
{{ toYaml .Values.graylog.extraVolumes | indent 8 }}
{{- end }}
{{- if not .Values.graylog.persistence.enabled }}
- name: journal
Expand Down
8 changes: 7 additions & 1 deletion stable/graylog/templates/web-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ spec:
nodePort: {{ .Values.graylog.service.nodePort }}
{{- end }}
{{- end }}
{{- range .Values.graylog.service.ports }}
- name: {{ .name }}
port: {{ .port }}
protocol: {{ .protocol }}
targetPort: {{ .port }}
{{- end }}
{{- if .Values.graylog.service.externalIPs }}
externalIPs:
{{ toYaml .Values.graylog.service.externalIPs | indent 4 }}
Expand All @@ -28,7 +34,7 @@ spec:
{{- if .Values.graylog.service.clusterIP }}
clusterIP: {{ .Values.graylog.service.clusterIP }}
{{- end }}
{{- end }}
{{- end }}
selector:
app.kubernetes.io/name: {{ template "graylog.name" . }}
app.kubernetes.io/instance: "{{ .Release.Name }}"
Expand Down
3 changes: 3 additions & 0 deletions stable/graylog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ graylog:
service:
type: ClusterIP
port: 9000
## Add additional ports for the service/statefulset to expose
##
ports: []

headless:
## Add suffix to headless service name
Expand Down

0 comments on commit 33fcf04

Please sign in to comment.