Skip to content

Commit

Permalink
Fix logs only configuration
Browse files Browse the repository at this point in the history
Don't use hostfs volume for container runtime detection, since it's needed for logs only and hostfs volume not created for logs pipeline.
  • Loading branch information
dmitryax committed Jun 9, 2021
1 parent 0b24c1f commit a4e65eb
Show file tree
Hide file tree
Showing 45 changed files with 70 additions and 61 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

## [0.26.4] - 2021-06-09

### Fixed

- Fix container runtime detection when metrics pipeline disabled (#161)

## [0.26.3] - 2021-06-08

- Add an option to add extra labels to pods (#158)
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/splunk-otel-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: splunk-otel-collector
version: 0.26.3
version: 0.26.4
description: Splunk OpenTelemetry Connector for Kubernetes
icon: https://github.com/signalfx/splunk-otel-collector-chart/tree/main/splunk.png
type: application
Expand Down
6 changes: 6 additions & 0 deletions helm-charts/splunk-otel-collector/ci/logs-only-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
clusterName: fake-cluster
splunkRealm: fake-realm
splunkAccessToken: fake-token

tracesEnabled: false
metricsEnabled: false
7 changes: 3 additions & 4 deletions helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
command: [ "sh", "-c"]
args:
- if [ -z "${LOG_FORMAT_TYPE}" ]; then
if [ "$(ls /hostfs/var/lib/docker/containers/*/*json.log 2>/dev/null | wc -l)" != "0" ]; then
if [ "$(ls {{ .Values.fluentd.config.containers.pathDest }}/*/*json.log 2>/dev/null | wc -l)" != "0" ]; then
export LOG_FORMAT_TYPE=json;
else
export LOG_FORMAT_TYPE=cri;
Expand All @@ -69,10 +69,9 @@ spec:
- name: LOG_FORMAT_TYPE
value: "{{ .Values.fluentd.config.containers.logFormatType }}"
volumeMounts:
- mountPath: /hostfs
name: hostfs
- name: varlogdest
mountPath: {{ .Values.fluentd.config.containers.pathDest }}
readOnly: true
mountPropagation: HostToContainer
- name: fluentd-config
mountPath: /fluentd/etc
- name: fluentd-config-common
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
rules:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/clusterRoleBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/configmap-fluentd-cri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd-cri
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/configmap-fluentd-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd-json
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/configmap-fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-k8s-cluster-receiver
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
11 changes: 5 additions & 6 deletions rendered/manifests/agent-only/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
engine: fluentd
Expand All @@ -23,7 +23,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: eb56739e0199ced217a14fcc02eada931f4d2adeabd2ef480c6ecbb4094446fa
checksum/config: 6ddcbb95554e7d324790a2c8084e833334368d2003d174f428a7cb492e4940b3
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Expand All @@ -38,7 +38,7 @@ spec:
command: [ "sh", "-c"]
args:
- if [ -z "${LOG_FORMAT_TYPE}" ]; then
if [ "$(ls /hostfs/var/lib/docker/containers/*/*json.log 2>/dev/null | wc -l)" != "0" ]; then
if [ "$(ls /var/lib/docker/containers/*/*json.log 2>/dev/null | wc -l)" != "0" ]; then
export LOG_FORMAT_TYPE=json;
else
export LOG_FORMAT_TYPE=cri;
Expand All @@ -49,10 +49,9 @@ spec:
- name: LOG_FORMAT_TYPE
value: ""
volumeMounts:
- mountPath: /hostfs
name: hostfs
- name: varlogdest
mountPath: /var/lib/docker/containers
readOnly: true
mountPropagation: HostToContainer
- name: fluentd-config
mountPath: /fluentd/etc
- name: fluentd-config-common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: splunk-otel-collector
component: otel-k8s-cluster-receiver
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
spec:
Expand All @@ -24,7 +24,7 @@ spec:
component: otel-k8s-cluster-receiver
release: default
annotations:
checksum/config: b5c932e6089b74c55906c15def7f2dfada67923661e8ec9bd4d072d4c15f6179
checksum/config: 720b87f36e82118d3038288a7cb906967b7f199f4f6bebe429fb6ec7311ed12f
spec:
serviceAccountName: default-splunk-otel-collector
containers:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
type: Opaque
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/serviceAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
rules:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/clusterRoleBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
4 changes: 2 additions & 2 deletions rendered/manifests/gateway-only/deployment-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: splunk-otel-collector
component: otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
spec:
Expand All @@ -24,7 +24,7 @@ spec:
component: otel-collector
release: default
annotations:
checksum/config: 1b6c4cefe0cfc709a06f7f57c4aa4bbc19af85fa9685645e3f6ec6be94f9aa2e
checksum/config: 684037bd096a49fffb5644b90d2160ad48d0773e6268dc856b1d2b6b4110c851
spec:
serviceAccountName: default-splunk-otel-collector
containers:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
type: Opaque
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: splunk-otel-collector
component: otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
spec:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/serviceAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
rules:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/clusterRoleBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/configmap-fluentd-cri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd-cri
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/configmap-fluentd-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd-json
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/configmap-fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
11 changes: 5 additions & 6 deletions rendered/manifests/logs-only/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
engine: fluentd
Expand All @@ -23,7 +23,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: d520f6aa9656afbcc9845cfdb59515beaf9b8d1f05611ce774f30e5c77d9bfaa
checksum/config: 21bc6edfc4ea6c41d9b45d4fd84293b8a5fe5f81c8eaa72fe2828380e374ef6d
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Expand All @@ -38,7 +38,7 @@ spec:
command: [ "sh", "-c"]
args:
- if [ -z "${LOG_FORMAT_TYPE}" ]; then
if [ "$(ls /hostfs/var/lib/docker/containers/*/*json.log 2>/dev/null | wc -l)" != "0" ]; then
if [ "$(ls /var/lib/docker/containers/*/*json.log 2>/dev/null | wc -l)" != "0" ]; then
export LOG_FORMAT_TYPE=json;
else
export LOG_FORMAT_TYPE=cri;
Expand All @@ -49,10 +49,9 @@ spec:
- name: LOG_FORMAT_TYPE
value: ""
volumeMounts:
- mountPath: /hostfs
name: hostfs
- name: varlogdest
mountPath: /var/lib/docker/containers
readOnly: true
mountPropagation: HostToContainer
- name: fluentd-config
mountPath: /fluentd/etc
- name: fluentd-config-common
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
type: Opaque
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/serviceAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
2 changes: 1 addition & 1 deletion rendered/manifests/metrics-only/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
rules:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/metrics-only/clusterRoleBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/metrics-only/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.3
chart: splunk-otel-collector-0.26.4
release: default
heritage: Helm
data:
Expand Down
Loading

0 comments on commit a4e65eb

Please sign in to comment.