Skip to content

Commit

Permalink
feat(helm): Respect helm release namespace setting
Browse files Browse the repository at this point in the history
Whenever a helm chart is rendered you can pass it a namespace.
Usually a chart then adds the namespace to the namespaced resources
it is rendering.

This change establishes that behaviour in the fluent-operator chart.

Signed-off-by: Zoltán Reegn <[email protected]>
  • Loading branch information
reegnz committed Jun 20, 2024
1 parent 1d594d7 commit 737e804
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: fluent-operator
namespace: {{ .Release.Namespace | quote }}
labels:
app.kubernetes.io/component: operator
app.kubernetes.io/name: fluent-operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-containerd-config
namespace: {{ .Release.Namespace | quote }}
data:
containerd.lua: |
function containerd( tag, timestamp, record)
Expand Down
1 change: 1 addition & 0 deletions charts/fluent-operator/templates/fluentbit-fluentBit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: fluentbit.fluent.io/v1alpha2
kind: FluentBit
metadata:
name: fluent-bit
namespace: {{ .Release.Namespace | quote }}
labels:
app.kubernetes.io/name: fluent-bit
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: fluentbit.fluent.io/v1alpha2
kind: FluentBit
metadata:
name: fluentbit-edge
namespace: fluent
namespace: {{ .Release.Namespace | quote }}
labels:
app.kubernetes.io/name: fluent-bit
spec:
Expand Down Expand Up @@ -40,4 +40,4 @@ spec:
mountPropagation: HostToContainer
name: host-proc
readOnly: true
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/fluent-operator/templates/fluentbit-lua-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-lua
namespace: {{ .Release.Namespace | quote }}
data:
systemd.lua: |
function add_time(tag, timestamp, record)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ $k |quote }}
namespace: {{ .Release.Namespace | quote }}
type: Opaque
data:
value: {{ $v | b64enc | quote }}
Expand Down
1 change: 1 addition & 0 deletions charts/fluent-operator/templates/fluentd-fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: fluentd.fluent.io/v1alpha1
kind: Fluentd
metadata:
name: {{ .Values.fluentd.name }}
namespace: {{ .Release.Namespace | quote }}
labels:
app.kubernetes.io/name: fluentd
spec:
Expand Down

0 comments on commit 737e804

Please sign in to comment.