Skip to content

Commit

Permalink
Construct the folder as the base of rancher charts
Browse files Browse the repository at this point in the history
  • Loading branch information
Continuous Integration [bot] committed Dec 10, 2021
1 parent ced1f01 commit 6abecf7
Show file tree
Hide file tree
Showing 97 changed files with 10,602 additions and 0 deletions.
22 changes: 22 additions & 0 deletions charts/sumologic/2.3.0/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
21 changes: 21 additions & 0 deletions charts/sumologic/2.3.0/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
dependencies:
- name: fluent-bit
repository: https://fluent.github.io/helm-charts
version: 0.12.1
- name: kube-prometheus-stack
repository: https://prometheus-community.github.io/helm-charts
version: 14.7.1
- name: falco
repository: https://falcosecurity.github.io/charts
version: 1.16.2
- name: metrics-server
repository: https://charts.bitnami.com/bitnami
version: 5.8.4
- name: telegraf-operator
repository: https://helm.influxdata.com/
version: 1.3.3
- name: tailing-sidecar-operator
repository: https://sumologic.github.io/tailing-sidecar
version: 0.3.1
digest: sha256:cbc6b6660738e1c16fad981a8762a031d9e8656f48b53ca71103b1e84f8b9184
generated: "2021-12-09T16:13:21.417687-07:00"
38 changes: 38 additions & 0 deletions charts/sumologic/2.3.0/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: v2
name: sumologic
version: 2.3.0
appVersion: 2.3.0
description: A Helm chart for collecting Kubernetes logs, metrics, traces and events into Sumo Logic.
type: application
keywords:
- monitoring
- logging
icon: https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/main/images/sumo_logic_logo.png
home: https://github.com/SumoLogic/sumologic-kubernetes-collection
sources:
- https://github.com/SumoLogic/sumologic-kubernetes-collection
dependencies:
- name: fluent-bit
version: 0.12.1
repository: https://fluent.github.io/helm-charts
condition: fluent-bit.enabled,sumologic.logs.enabled
- name: kube-prometheus-stack
version: 12.10.0
repository: https://prometheus-community.github.io/helm-charts
condition: kube-prometheus-stack.enabled,sumologic.metrics.enabled
- name: falco
version: 1.16.2
repository: https://falcosecurity.github.io/charts
condition: falco.enabled
- name: metrics-server
version: 5.8.4
repository: https://charts.bitnami.com/bitnami
condition: metrics-server.enabled
- name: telegraf-operator
version: 1.3.3
repository: https://helm.influxdata.com/
condition: telegraf-operator.enabled
- name: tailing-sidecar-operator
version: 0.3.1
repository: https://sumologic.github.io/tailing-sidecar
condition: tailing-sidecar-operator.enabled
336 changes: 336 additions & 0 deletions charts/sumologic/2.3.0/README.md

Large diffs are not rendered by default.

Binary file added charts/sumologic/2.3.0/charts/falco-1.16.2.tgz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 25 additions & 0 deletions charts/sumologic/2.3.0/conf/cleanup/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

# Fix URL to remove "v1" or "v1/"
export SUMOLOGIC_BASE_URL=${SUMOLOGIC_BASE_URL%v1*}
# Support proxy for Terraform
export HTTP_PROXY=${HTTP_PROXY:=""}
export HTTPS_PROXY=${HTTPS_PROXY:=""}
export NO_PROXY=${NO_PROXY:=""}

cp /etc/terraform/*.tf /terraform/
cd /terraform || exit 1

terraform init

# shellcheck disable=SC1083
terraform import sumologic_collector.collector {{ template "terraform.collector.name" . }}
# shellcheck disable=SC1083
terraform import kubernetes_secret.sumologic_collection_secret {{ template "terraform.secret.fullname" . }}

terraform destroy -auto-approve .

# Cleanup env variables
export SUMOLOGIC_BASE_URL=
export SUMOLOGIC_ACCESSKEY=
export SUMOLOGIC_ACCESSID=
72 changes: 72 additions & 0 deletions charts/sumologic/2.3.0/conf/events/events.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{{- if .Values.fluentd.events.watchResourceEventsOverrides }}
{{- range $name, $version := .Values.fluentd.events.watchResourceEventsOverrides }}
<source>
@type events
deploy_namespace {{ $.Release.Namespace }}
resource_name {{ $name }}
api_version {{ $version }}
</source>
{{- end }}
{{- else }}
<source>
@type events
deploy_namespace {{ .Release.Namespace }}
</source>
{{- end }}
# Prevent fluentd from handling records containing its own logs.
<match fluentd.**>
@type null
</match>
# expose the Fluentd metrics to Prometheus
<source>
@type prometheus
metrics_path /metrics
port 24231
</source>
<source>
@type prometheus_output_monitor
</source>
<source>
@type http
port 9880
bind 0.0.0.0
</source>
{{- if .Values.fluentd.monitoring.input }}
{{ include "fluentd.prometheus-metrics.input" (dict "Tag" "kubernetes.**") | nindent 2}}
{{- end }}
{{- if .Values.fluentd.events.overrideOutputConf }}
{{ .Values.fluentd.events.overrideOutputConf | nindent 4 }}
{{- else }}
<match kubernetes.**>
@type copy
<store>
@type sumologic
@id sumologic.endpoint.events
sumo_client {{ include "sumologic.sumo_client" . | quote }}
endpoint "#{ENV['SUMO_ENDPOINT_DEFAULT_EVENTS_SOURCE']}"
data_type logs
disable_cookies true
verify_ssl {{ .Values.fluentd.verifySsl | quote }}
proxy_uri {{ .Values.fluentd.proxyUri | quote }}
compress {{ .Values.fluentd.compression.enabled | quote }}
compress_encoding {{ .Values.fluentd.compression.encoding | quote }}
<buffer>
{{- if or .Values.fluentd.persistence.enabled (eq .Values.fluentd.buffer.type "file") }}
@type file
path {{ .Values.fluentd.buffer.filePaths.events }}
{{- else }}
@type memory
{{- end }}
@include buffer.output.conf
</buffer>
</store>
{{- if .Values.fluentd.monitoring.output }}
{{ include "fluentd.prometheus-metrics.output" . | nindent 4 }}
{{- end }}
</match>
{{- end }}
{{- if .Values.fluentd.logLevel }}
<system>
log_level {{ .Values.fluentd.logLevel }}
</system>
{{- end }}
12 changes: 12 additions & 0 deletions charts/sumologic/2.3.0/conf/fluentd/buffer.output.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
compress {{ .Values.fluentd.buffer.compress | quote }}
flush_interval {{ .Values.fluentd.buffer.flushInterval | quote }}
flush_thread_count {{ .Values.fluentd.buffer.numThreads | quote }}
chunk_limit_size {{ .Values.fluentd.buffer.chunkLimitSize | quote }}
total_limit_size {{ .Values.fluentd.buffer.totalLimitSize | quote }}
queued_chunks_limit_size {{ .Values.fluentd.buffer.queueChunkLimitSize | quote }}
overflow_action drop_oldest_chunk
retry_max_interval {{ .Values.fluentd.buffer.retryMaxInterval | quote }}
retry_forever {{ .Values.fluentd.buffer.retryForever | quote }}
{{- if .Values.fluentd.buffer.extraConf }}
{{- .Values.fluentd.buffer.extraConf | nindent 2 }}
{{- end }}
29 changes: 29 additions & 0 deletions charts/sumologic/2.3.0/conf/fluentd/common.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Prevent fluentd from handling records containing its own logs and health checks.
<match fluentd.pod.healthcheck>
@type relabel
@label @FLUENT_LOG
</match>
<label @FLUENT_LOG>
<match **>
@type null
</match>
</label>
# expose the Fluentd metrics to Prometheus
<source>
@type prometheus
metrics_path /metrics
port 24231
</source>
<source>
@type prometheus_output_monitor
</source>
<source>
@type http
port 9880
bind 0.0.0.0
</source>
{{- if .Values.fluentd.logLevel }}
<system>
log_level {{ .Values.fluentd.logLevel }}
</system>
{{- end }}
12 changes: 12 additions & 0 deletions charts/sumologic/2.3.0/conf/logs/fluentd/logs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<source>
@type forward
port 24321
bind 0.0.0.0
{{- .Values.fluentd.logs.input.forwardExtraConf | nindent 4 }}
</source>
@include logs.source.containers.conf
@include logs.source.systemd.conf
{{- if .Values.fluentd.logs.extraLogs }}
{{- .Values.fluentd.logs.extraLogs | nindent 2 }}
{{- end }}
@include logs.source.default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cache_size {{ .Values.fluentd.metadata.cacheSize | quote }}
cache_ttl {{ .Values.fluentd.metadata.cacheTtl | quote }}
cache_refresh {{ .Values.fluentd.metadata.cacheRefresh | quote }}
cache_refresh_variation {{ .Values.fluentd.metadata.cacheRefreshVariation | quote }}
in_namespace_path '$.kubernetes.namespace_name'
in_pod_path '$.kubernetes.pod_name'
core_api_versions {{ join "," .Values.fluentd.metadata.coreApiVersions }}
api_groups {{ join "," .Values.fluentd.metadata.apiGroups }}
data_type logs
add_service {{ .Values.fluentd.metadata.addService }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
annotation_match {{ template "fluentd.metadata.annotations_match.quotes" . }}
de_dot false
watch {{ .Values.fluentd.logs.containers.k8sMetadataFilter.watch | quote }}
ca_file {{ .Values.fluentd.logs.containers.k8sMetadataFilter.caFile | quote }}
verify_ssl {{ .Values.fluentd.logs.containers.k8sMetadataFilter.verifySsl | quote }}
client_cert {{ .Values.fluentd.logs.containers.k8sMetadataFilter.clientCert | quote }}
client_key {{ .Values.fluentd.logs.containers.k8sMetadataFilter.clientKey | quote }}
bearer_token_file {{ .Values.fluentd.logs.containers.k8sMetadataFilter.bearerTokenFile | quote }}
cache_size {{ .Values.fluentd.metadata.cacheSize | quote }}
cache_ttl {{ .Values.fluentd.metadata.cacheTtl | quote }}
tag_to_kubernetes_name_regexp '.+?\.containers\.(?<pod_name>[^_]+)_(?<namespace>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_name {{ .Values.fluentd.logs.containers.sourceName | quote }}
source_host {{ .Values.fluentd.logs.containers.sourceHost | quote }}
log_format {{ .Values.fluentd.logs.output.logFormat | quote }}
source_category {{ .Values.fluentd.logs.containers.sourceCategory | quote }}
source_category_prefix {{ .Values.fluentd.logs.containers.sourceCategoryPrefix | quote }}
source_category_replace_dash {{ .Values.fluentd.logs.containers.sourceCategoryReplaceDash | quote }}
exclude_pod_regex {{ .Values.fluentd.logs.containers.excludePodRegex | quote }}
exclude_container_regex {{ .Values.fluentd.logs.containers.excludeContainerRegex | quote }}
exclude_host_regex {{ .Values.fluentd.logs.containers.excludeHostRegex | quote }}
per_container_annotations_enabled {{ .Values.fluentd.logs.containers.perContainerAnnotationsEnabled }}
per_container_annotation_prefixes {{ join "," .Values.fluentd.logs.containers.perContainerAnnotationPrefixes }}
13 changes: 13 additions & 0 deletions charts/sumologic/2.3.0/conf/logs/fluentd/logs.output.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
data_type logs
log_key log
endpoint "#{ENV['SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE']}"
verify_ssl {{ .Values.fluentd.verifySsl | quote }}
log_format {{ .Values.fluentd.logs.output.logFormat | quote }}
add_timestamp {{ .Values.fluentd.logs.output.addTimestamp | quote }}
timestamp_key {{ .Values.fluentd.logs.output.timestampKey | quote }}
proxy_uri {{ .Values.fluentd.proxyUri | quote }}
compress {{ .Values.fluentd.compression.enabled | quote }}
compress_encoding {{ .Values.fluentd.compression.encoding | quote }}
{{- if .Values.fluentd.logs.output.extraConf }}
{{- .Values.fluentd.logs.output.extraConf | nindent 2 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{{ if .Values.fluentd.logs.containers.overrideRawConfig }}
{{ .Values.fluentd.logs.containers.overrideRawConfig | nindent 2}}
{{- else -}}
{{- if .Values.fluentd.monitoring.input }}
{{ include "fluentd.prometheus-metrics.input" (dict "Tag" "containers.**") | nindent 2}}
{{- end }}
{{ if .Values.fluentd.logs.containers.multiline.enabled }}
<filter containers.**>
@type record_transformer
enable_ruby
renew_record true
<record>
log ${record["log"].split(/[\n\t]+/).map! {|item| JSON.parse(item)["log"]}.any? ? record["log"].split(/[\n\t]+/).map! {|item| JSON.parse(item)["log"]}.join("") : record["log"] rescue record["log"]}
stream ${[record["log"].split(/[\n\t]+/)[0]].map! {|item| JSON.parse(item)["stream"]}.any? ? [record["log"].split(/[\n\t]+/)[0]].map! {|item| JSON.parse(item)["stream"]}.join("") : record["stream"] rescue record["stream"]}
time ${[record["log"].split(/[\n\t]+/)[0]].map! {|item| JSON.parse(item)["time"]}.any? ? [record["log"].split(/[\n\t]+/)[0]].map! {|item| JSON.parse(item)["time"]}.join("") : record["time"] rescue record["time"]}
</record>
</filter>
{{- end }}
# match all container logs and label them @NORMAL
<match containers.**>
@type relabel
@label @NORMAL
</match>
<label @NORMAL>
{{ if .Values.fluentd.logLevelFilter }}
# only match fluentd logs based on fluentd container log file name.
# by default, this is <filter **collection-sumologic-fluentd**>
{{ printf "<filter **%s**>" (include "sumologic.metadata.name.fluentd" .) }}
# only ingest:
# - stacktraces (containing /usr/local)
# - fluentd logs of levels: {error, fatal}: `\[error\]|\[fatal\]`
# - warning messages if buffer is full `drop_oldest_chunk|retry succeeded`
@type grep
<regexp>
key log
pattern /\/usr\/local|\[error\]|\[fatal\]|drop_oldest_chunk|retry succeeded/
</regexp>
</filter>
{{- end }}

{{ if .Values.otelcol.logLevelFilter }}
{{ printf "<filter **%s**>" (include "sumologic.metadata.name.otelcol" .) }}
@type grep
<regexp>
key log
# Select only known error/warning/fatal/panic levels or logs coming from one of the source known to provide useful data
pattern /\"level\":\"(error|warning|fatal|panic|dpanic)\"|\"caller\":\"(builder|service|kube|static)/
</regexp>
</filter>
{{- end }}

# third-party Kubernetes metadata filter plugin
<filter containers.**>
@type kubernetes_metadata
@log_level {{ .Values.fluentd.metadata.pluginLogLevel }}
@include logs.kubernetes.metadata.filter.conf
</filter>
# Sumo Logic Kubernetes metadata enrichment filter plugin
<filter containers.**>
@type enhance_k8s_metadata
@log_level {{ .Values.fluentd.metadata.pluginLogLevel }}
@include logs.enhance.k8s.metadata.filter.conf
</filter>
{{- .Values.fluentd.logs.containers.extraFilterPluginConf | nindent 4 }}
# Kubernetes Sumo Logic filter plugin
<filter containers.**>
@type kubernetes_sumologic
@include logs.kubernetes.sumologic.filter.conf
exclude_namespace_regex {{ include "fluentd.excludeNamespaces" . }}
</filter>
{{- .Values.fluentd.logs.containers.extraOutputPluginConf | nindent 4 }}
{{ if .Values.fluentd.logs.containers.overrideOutputConf }}
{{ .Values.fluentd.logs.containers.overrideOutputConf | nindent 4 }}
{{- else }}
<match containers.**>
@type copy
<store>
@type sumologic
@id sumologic.endpoint.logs
sumo_client {{ include "sumologic.sumo_client" . | quote }}
@log_level {{ .Values.fluentd.logs.output.pluginLogLevel }}
{{- .Values.fluentd.logs.containers.outputConf | nindent 8 }}
<buffer>
{{- if or .Values.fluentd.persistence.enabled (eq .Values.fluentd.buffer.type "file") }}
@type file
path {{ .Values.fluentd.buffer.filePaths.logs.containers }}
{{- else }}
@type memory
{{- end }}
@include buffer.output.conf
</buffer>
</store>
{{- if .Values.fluentd.monitoring.output }}
{{ include "fluentd.prometheus-metrics.output" . | nindent 6 }}
{{- end }}
</match>
{{- end }}
</label>
{{- end }}
Loading

0 comments on commit 6abecf7

Please sign in to comment.