Skip to content

Commit

Permalink
Upgrade logzio-logs-collector chart to v1.0.4 (#493)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ralongit authored Jun 5, 2024
1 parent 3b1a142 commit 2197639
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/logzio-logs-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: logzio-logs-collector
version: 1.0.3
version: 1.0.4
description: kubernetes logs collection agent for logz.io based on opentelemetry collector
type: application
home: https://logz.io/
Expand Down
4 changes: 4 additions & 0 deletions charts/logzio-logs-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ Multi line logs configuration
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.

## Change log
* 1.0.4
- Add standalone deployment mode
- Rename `LogzioRegion` to camelCase - `logzioRegion`
- Add user-agent header
* 1.0.3
- Replace dots (".") with underscores ("_") in log attributes keys:
- Added `transform/dedot` proccesor.
Expand Down
8 changes: 8 additions & 0 deletions charts/logzio-logs-collector/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
{{- tpl $config . -}}
{{- end }}

# Build config file for standalone logs Collector
{{- define "logs-collector.loggingStandaloneConfig" -}}
{{- $values := deepCopy .Values -}}
{{- $data := dict "Values" $values | mustMergeOverwrite (deepCopy .) -}}
{{- $config := include "logs-collector.baseLoggingConfig" $data -}}
{{- tpl $config . -}}
{{- end }}

{{/* Build the list of port for service */}}
{{- define "logs-collector.servicePortsConfig" -}}
{{- $ports := deepCopy .Values.ports }}
Expand Down
2 changes: 2 additions & 0 deletions charts/logzio-logs-collector/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Get component name
{{- define "logs-collector.component" -}}
{{- if eq .Values.mode "daemonset" -}}
component: logs-collector
{{- else if eq .Values.mode "standalone" -}}
component: logs-collector-standalone
{{- end -}}
{{- end }}

Expand Down
13 changes: 13 additions & 0 deletions charts/logzio-logs-collector/templates/configmap-standalone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ if .Values.enabled}}
{{- if and (eq .Values.mode "standalone") (.Values.configMap.create) -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "logs-collector.fullname" . }}-standalone
namespace: {{ template "logs-collector.namespace" . }}
labels:
{{- include "logs-collector.labels" . | nindent 4 }}
data:
relay: {{- include "logs-collector.loggingStandaloneConfig" . | nindent 4 }}
{{- end }}
{{ end }}
42 changes: 42 additions & 0 deletions charts/logzio-logs-collector/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{ if .Values.enabled}}
{{- if eq .Values.mode "standalone" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "logs-collector.fullname" . }}
namespace: {{ template "logs-collector.namespace" . }}
labels:
{{- include "logs-collector.labels" . | nindent 4 }}
{{- if .Values.annotations }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
{{- end }}
spec:
replicas: {{ .Values.standaloneCollector.replicaCount }}
selector:
matchLabels:
{{- include "logs-collector.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-standalone.yaml") . | sha256sum }}
{{- include "logs-collector.podAnnotations" . | nindent 8 }}
labels:
{{- include "logs-collector.selectorLabels" . | nindent 8 }}
{{- include "logs-collector.podLabels" . | nindent 8 }}
spec:
{{- $podValues := deepCopy .Values }}
{{- $podData := dict "Values" $podValues "configmapSuffix" "-standalone" "isAgent" true }}
{{- include "logs-collector.loggingPod" ($podData | mustMergeOverwrite (deepCopy .)) | nindent 6 }}
hostNetwork: {{ .Values.hostNetwork }}
{{- with .Values.dnsPolicy }}
dnsPolicy: {{ . }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{ end }}
2 changes: 1 addition & 1 deletion charts/logzio-logs-collector/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: Opaque
stringData:
env-id: {{.Values.secrets.env_id | quote}}
log-type: {{ .Values.secrets.logType}}
logzio-listener-region: {{ .Values.secrets.LogzioRegion}}
logzio-listener-region: {{ .Values.secrets.logzioRegion}}
{{ if .Values.secrets.logzioLogsToken}}
logzio-logs-token: {{ .Values.secrets.logzioLogsToken }}
{{ end }}
Expand Down
11 changes: 8 additions & 3 deletions charts/logzio-logs-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ enabled: true
nameOverride: ""
fullnameOverride: ""

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

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

configMap:
# Specifies whether a configMap should be created (true by default)
create: true

standaloneCollector:
# Number of replicas in standalone collector mode
replicaCount: 1

# Base collector configuration.
# Supports templating. To escape existing instances of {{ }}, use {{` <original content> `}}.
# For example, {{ REDACTED_EMAIL }} becomes {{` {{ REDACTED_EMAIL }} `}}.
Expand All @@ -47,6 +51,8 @@ config:
account_token: ${env:LOGZIO_LOGS_TOKEN}
region: ${env:LOGZIO_REGION}
endpoint: ${env:CUSTOM_ENDPOINT}
headers:
user-agent: "{{ .Chart.Name }}-{{ .Chart.Version }}-helm"
extensions:
health_check: {}
file_storage:
Expand Down Expand Up @@ -333,7 +339,6 @@ affinity:
- matchExpressions:
- key: eks.amazonaws.com/compute-type
operator: DoesNotExist

# Allows for pod scheduler prioritisation
priorityClassName: ""

Expand Down

0 comments on commit 2197639

Please sign in to comment.