diff --git a/production/helm/README.md b/production/helm/README.md index d2a3055b0e890..8bfc136c9606b 100644 --- a/production/helm/README.md +++ b/production/helm/README.md @@ -125,6 +125,30 @@ tls: - {{ .Values.ingress.host }} ``` +## Run promtail with syslog support + +In order to receive and process syslog message into promtail, the following changes will be necessary: + +* Review the [promtail syslog-receiver configuration documentation](/docs/clients/promtail/scraping.md#syslog-receiver) + +* Configure the promtail helm chart with the syslog configuration added to the `extraScrapeConfigs` section and associated service definition to listen for syslog messages. For example: + +```yaml +extraScrapeConfigs: + - job_name: syslog + syslog: + listen_address: 0.0.0.0:1514 + labels: + job: "syslog" + relabel_configs: + - source_labels: ['__syslog_message_hostname'] + target_label: 'host' +syslogService: + enabled: true + type: LoadBalancer + port: 1514 +``` + ## How to contribute After adding your new feature to the appropriate chart, you can build and deploy it locally to test: diff --git a/production/helm/loki-stack/Chart.yaml b/production/helm/loki-stack/Chart.yaml index 3e98b4c692d93..72a295b41d9b5 100644 --- a/production/helm/loki-stack/Chart.yaml +++ b/production/helm/loki-stack/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: "v1" name: loki-stack -version: 0.31.2 +version: 0.32.0 appVersion: v1.3.0 kubeVersion: "^1.10.0-0" description: "Loki: like Prometheus, but for logs." diff --git a/production/helm/promtail/Chart.yaml b/production/helm/promtail/Chart.yaml index 0f4a060bf74e8..41c87a72be7e3 100644 --- a/production/helm/promtail/Chart.yaml +++ b/production/helm/promtail/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: "v1" name: promtail -version: 0.18.1 +version: 0.19.0 appVersion: v1.3.0 kubeVersion: "^1.10.0-0" description: "Responsible for gathering logs and sending them to Loki" diff --git a/production/helm/promtail/templates/daemonset.yaml b/production/helm/promtail/templates/daemonset.yaml index afab81bd5bee0..cf5a15091b992 100644 --- a/production/helm/promtail/templates/daemonset.yaml +++ b/production/helm/promtail/templates/daemonset.yaml @@ -86,6 +86,10 @@ spec: ports: - containerPort: {{ .Values.config.server.http_listen_port }} name: http-metrics + {{- if .Values.syslogService.enabled }} + - containerPort: {{ .Values.syslogService.port }} + name: syslog + {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} {{- if .Values.livenessProbe }} diff --git a/production/helm/promtail/templates/service-syslog.yaml b/production/helm/promtail/templates/service-syslog.yaml new file mode 100644 index 0000000000000..6c31ab8ef2064 --- /dev/null +++ b/production/helm/promtail/templates/service-syslog.yaml @@ -0,0 +1,42 @@ +{{- if .Values.syslogService.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "promtail.fullname" . }}-syslog + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "promtail.name" . }} + chart: {{ template "promtail.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- with .Values.syslogService.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- toYaml .Values.syslogService.annotations | nindent 4 }} +spec: + type: {{ .Values.syslogService.type }} +{{- if (and (eq .Values.syslogService.type "ClusterIP") (not (empty .Values.syslogService.clusterIP))) }} + clusterIP: {{ .Values.syslogService.clusterIP }} +{{- end }} +{{- if .Values.syslogService.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.syslogService.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} + ports: + - port: {{ .Values.syslogService.port }} + protocol: TCP + name: syslog + targetPort: syslog +{{- if (and (eq .Values.syslogService.type "NodePort") (not (empty .Values.syslogService.nodePort))) }} + nodePort: {{ .Values.syslogService.nodePort }} +{{- end }} +{{- if .Values.extraPorts }} +{{ toYaml .Values.extraPorts | indent 4}} +{{- end }} + selector: + app: {{ template "promtail.name" . }} + release: {{ .Release.Name }} +{{- end }} diff --git a/production/helm/promtail/values.yaml b/production/helm/promtail/values.yaml index 5ea0b7aa9d729..0fe4a15e92d37 100644 --- a/production/helm/promtail/values.yaml +++ b/production/helm/promtail/values.yaml @@ -127,6 +127,7 @@ config: server: http_listen_port: 3101 + positions: filename: /run/promtail/positions.yaml target_config: @@ -141,3 +142,26 @@ serviceMonitor: # Extra env variables to pass to the promtail container env: [] + +# enable and configure if using the syslog scrape config +syslogService: + enabled: false + type: ClusterIP + port: 1514 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + # nodePort: + ## Provide any additional annotations which may be required. This can be used to + ## set the LoadBalancer service type to internal only. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + annotations: {} + labels: {} + ## Use loadBalancerIP to request a specific static IP, + ## otherwise leave blank + ## + loadBalancerIP: + # loadBalancerSourceRanges: [] + ## Set the externalTrafficPolicy in the Service to either Cluster or Local + # externalTrafficPolicy: Cluster