Skip to content

Commit 469986c

Browse files
authored
Merge pull request #1358 from kube-logging/fluentbit-upstream
fix: do not refer to upstream config item to avoid hiding fluentbit configuration, also use absolute path in the config
2 parents 728079e + bc6eb0d commit 469986c

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

pkg/resources/fluentbit/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ var fluentBitConfigTemplate = `
100100
Name forward
101101
Match *
102102
{{- if .Upstream.Enabled }}
103-
Upstream upstream.conf
103+
Upstream {{ .Upstream.Config.Path }}
104104
{{- else }}
105105
Host {{ .TargetHost }}
106106
Port {{ .TargetPort }}

pkg/resources/fluentbit/configsecret.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type upstreamNode struct {
4646

4747
type upstream struct {
4848
Name string
49+
Path string
4950
Nodes []upstreamNode
5051
}
5152

@@ -323,6 +324,7 @@ func (r *Reconciler) configSecret() (runtime.Object, reconciler.DesiredState, er
323324

324325
if r.fluentbitSpec.EnableUpstream {
325326
input.FluentForwardOutput.Upstream.Enabled = true
327+
input.FluentForwardOutput.Upstream.Config.Path = fmt.Sprintf("%s/%s", OperatorConfigPath, UpstreamConfigName)
326328
input.FluentForwardOutput.Upstream.Config.Name = "fluentd-upstream"
327329
for i := int32(0); i < utils.PointerToInt32(aggregatorReplicas); i++ {
328330
input.FluentForwardOutput.Upstream.Config.Nodes = append(input.FluentForwardOutput.Upstream.Config.Nodes, r.generateUpstreamNode(i))

pkg/resources/fluentbit/daemonset.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,6 @@ func (r *Reconciler) generateVolume() (v []corev1.Volume) {
221221
},
222222
},
223223
}
224-
if r.fluentbitSpec.EnableUpstream {
225-
volume.VolumeSource.Secret.Items = append(volume.VolumeSource.Secret.Items, corev1.KeyToPath{
226-
Key: UpstreamConfigName,
227-
Path: UpstreamConfigName,
228-
})
229-
}
230224
v = append(v, volume)
231225
} else {
232226
v = append(v, corev1.Volume{

0 commit comments

Comments
 (0)