Skip to content

Commit 2197639

Browse files
authored
Upgrade logzio-logs-collector chart to v1.0.4 (#493)
* Upgrade `logzio-logs-collector` chart to v1.0.4 - Add standalone deployment mode - Rename `LogzioRegion` to camelCase - `logzioRegion` - Add user-agent header * Rename configmap and remove packaged file
1 parent 3b1a142 commit 2197639

File tree

8 files changed

+79
-5
lines changed

8 files changed

+79
-5
lines changed

charts/logzio-logs-collector/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: logzio-logs-collector
3-
version: 1.0.3
3+
version: 1.0.4
44
description: kubernetes logs collection agent for logz.io based on opentelemetry collector
55
type: application
66
home: https://logz.io/

charts/logzio-logs-collector/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ Multi line logs configuration
142142
The collector supports by default various log formats (including multiline logs) such as `CRI-O` `CRI-Containerd` `Docker` formats. You can configure the chart to parse custom multiline logs pattern according to your needs, please read [Customizing Multiline Log Handling](./examples/multiline.md) guide for more details.
143143

144144
## Change log
145+
* 1.0.4
146+
- Add standalone deployment mode
147+
- Rename `LogzioRegion` to camelCase - `logzioRegion`
148+
- Add user-agent header
145149
* 1.0.3
146150
- Replace dots (".") with underscores ("_") in log attributes keys:
147151
- Added `transform/dedot` proccesor.

charts/logzio-logs-collector/templates/_config.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
{{- tpl $config . -}}
1313
{{- end }}
1414

15+
# Build config file for standalone logs Collector
16+
{{- define "logs-collector.loggingStandaloneConfig" -}}
17+
{{- $values := deepCopy .Values -}}
18+
{{- $data := dict "Values" $values | mustMergeOverwrite (deepCopy .) -}}
19+
{{- $config := include "logs-collector.baseLoggingConfig" $data -}}
20+
{{- tpl $config . -}}
21+
{{- end }}
22+
1523
{{/* Build the list of port for service */}}
1624
{{- define "logs-collector.servicePortsConfig" -}}
1725
{{- $ports := deepCopy .Values.ports }}

charts/logzio-logs-collector/templates/_helpers.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Get component name
1515
{{- define "logs-collector.component" -}}
1616
{{- if eq .Values.mode "daemonset" -}}
1717
component: logs-collector
18+
{{- else if eq .Values.mode "standalone" -}}
19+
component: logs-collector-standalone
1820
{{- end -}}
1921
{{- end }}
2022

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{ if .Values.enabled}}
2+
{{- if and (eq .Values.mode "standalone") (.Values.configMap.create) -}}
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: {{ include "logs-collector.fullname" . }}-standalone
7+
namespace: {{ template "logs-collector.namespace" . }}
8+
labels:
9+
{{- include "logs-collector.labels" . | nindent 4 }}
10+
data:
11+
relay: {{- include "logs-collector.loggingStandaloneConfig" . | nindent 4 }}
12+
{{- end }}
13+
{{ end }}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{{ if .Values.enabled}}
2+
{{- if eq .Values.mode "standalone" -}}
3+
apiVersion: apps/v1
4+
kind: Deployment
5+
metadata:
6+
name: {{ include "logs-collector.fullname" . }}
7+
namespace: {{ template "logs-collector.namespace" . }}
8+
labels:
9+
{{- include "logs-collector.labels" . | nindent 4 }}
10+
{{- if .Values.annotations }}
11+
annotations:
12+
{{- range $key, $value := .Values.annotations }}
13+
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
14+
{{- end }}
15+
{{- end }}
16+
spec:
17+
replicas: {{ .Values.standaloneCollector.replicaCount }}
18+
selector:
19+
matchLabels:
20+
{{- include "logs-collector.selectorLabels" . | nindent 6 }}
21+
template:
22+
metadata:
23+
annotations:
24+
checksum/config: {{ include (print $.Template.BasePath "/configmap-standalone.yaml") . | sha256sum }}
25+
{{- include "logs-collector.podAnnotations" . | nindent 8 }}
26+
labels:
27+
{{- include "logs-collector.selectorLabels" . | nindent 8 }}
28+
{{- include "logs-collector.podLabels" . | nindent 8 }}
29+
spec:
30+
{{- $podValues := deepCopy .Values }}
31+
{{- $podData := dict "Values" $podValues "configmapSuffix" "-standalone" "isAgent" true }}
32+
{{- include "logs-collector.loggingPod" ($podData | mustMergeOverwrite (deepCopy .)) | nindent 6 }}
33+
hostNetwork: {{ .Values.hostNetwork }}
34+
{{- with .Values.dnsPolicy }}
35+
dnsPolicy: {{ . }}
36+
{{- end }}
37+
{{- with .Values.dnsConfig }}
38+
dnsConfig:
39+
{{- toYaml . | nindent 8 }}
40+
{{- end }}
41+
{{- end }}
42+
{{ end }}

charts/logzio-logs-collector/templates/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type: Opaque
1010
stringData:
1111
env-id: {{.Values.secrets.env_id | quote}}
1212
log-type: {{ .Values.secrets.logType}}
13-
logzio-listener-region: {{ .Values.secrets.LogzioRegion}}
13+
logzio-listener-region: {{ .Values.secrets.logzioRegion}}
1414
{{ if .Values.secrets.logzioLogsToken}}
1515
logzio-logs-token: {{ .Values.secrets.logzioLogsToken }}
1616
{{ end }}

charts/logzio-logs-collector/values.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ enabled: true
88
nameOverride: ""
99
fullnameOverride: ""
1010

11-
# Valid value for log collection is "daemonset". More modes may be added in the future
11+
# Valid values for log collection are "daemonset","standalone". More modes may be added in the future
1212
mode: "daemonset"
1313

1414
# Specify which namespace should be used to deploy the resources into
@@ -29,14 +29,18 @@ secrets:
2929
# Secret with your logzio logs shipping token
3030
logzioLogsToken: "token"
3131
# Secret with your logzio region
32-
LogzioRegion: "us"
32+
logzioRegion: "us"
3333
# Secret with your custom endpoint, for example:http://endpoint:8080. Overrides secrets.LogzioRegion listener adress
3434
customEndpoint: ""
3535

3636
configMap:
3737
# Specifies whether a configMap should be created (true by default)
3838
create: true
3939

40+
standaloneCollector:
41+
# Number of replicas in standalone collector mode
42+
replicaCount: 1
43+
4044
# Base collector configuration.
4145
# Supports templating. To escape existing instances of {{ }}, use {{` <original content> `}}.
4246
# For example, {{ REDACTED_EMAIL }} becomes {{` {{ REDACTED_EMAIL }} `}}.
@@ -47,6 +51,8 @@ config:
4751
account_token: ${env:LOGZIO_LOGS_TOKEN}
4852
region: ${env:LOGZIO_REGION}
4953
endpoint: ${env:CUSTOM_ENDPOINT}
54+
headers:
55+
user-agent: "{{ .Chart.Name }}-{{ .Chart.Version }}-helm"
5056
extensions:
5157
health_check: {}
5258
file_storage:
@@ -333,7 +339,6 @@ affinity:
333339
- matchExpressions:
334340
- key: eks.amazonaws.com/compute-type
335341
operator: DoesNotExist
336-
337342
# Allows for pod scheduler prioritisation
338343
priorityClassName: ""
339344

0 commit comments

Comments
 (0)