Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fluent-operator): add image reference by digest #361

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/fluent-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- fluent-bit
- fluentd
- operator
version: 2.2.0
version: 2.2.1
appVersion: 2.2.0
icon: https://raw.githubusercontent.com/fluent/fluent-operator/master/docs/images/fluent-operator-icon.svg
home: https://www.fluentd.org/
Expand Down
9 changes: 9 additions & 0 deletions charts/fluent-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,12 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Fluentbit operator image with tag/digest
*/}}
{{- define "fluentbit-operator.image" -}}
{{- $tag := ternary "" (printf ":%s" (toString .tag)) (or (empty .tag) (eq "-" (toString .tag))) -}}
{{- $digest := ternary "" (printf "@%s" .digest) (empty .digest) -}}
{{- printf "%s%s%s" .repository $tag $digest -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
path: /var/run/docker.sock
initContainers:
- name: setenv
image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
image: {{ include "fluentbit-operator.image" .Values.operator.initcontainer }}
command:
- /bin/sh
- '-c'
Expand All @@ -52,7 +52,7 @@ spec:
emptyDir: {}
initContainers:
- name: setenv
image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
image: {{ include "fluentbit-operator.image" .Values.operator.initcontainer }}
command:
- /bin/sh
- '-c'
Expand All @@ -67,7 +67,7 @@ spec:
emptyDir: {}
initContainers:
- name: setenv
image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
image: {{ include "fluentbit-operator.image" .Values.operator.initcontainer }}
command:
- /bin/sh
- '-c'
Expand All @@ -79,7 +79,7 @@ spec:
{{- end }}
containers:
- name: fluent-operator
image: {{ .Values.operator.container.repository }}:{{ .Values.operator.container.tag }}
image: {{ include "fluentbit-operator.image" .Values.operator.container }}
resources:
{{- toYaml .Values.operator.resources | nindent 10 }}
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: fluent-bit
spec:
image: {{ .Values.fluentbit.image.repository }}:{{ .Values.fluentbit.image.tag }}
image: {{ include "fluentbit-operator.image" .Values.fluentbit.image }}
{{- if .Values.fluentbit.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.fluentbit.imagePullSecrets | indent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: fluent-bit
spec:
image: {{ .Values.fluentbit.image.repository }}:{{ .Values.fluentbit.image.tag }}
image: {{ include "fluentbit-operator.image" .Values.fluentbit.image }}
positionDB:
hostPath:
path: /var/lib/fluent-bit/
Expand Down
2 changes: 1 addition & 1 deletion charts/fluent-operator/templates/fluentd-fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
bind: 0.0.0.0
port: {{ .Values.fluentd.port }}
replicas: {{ .Values.fluentd.replicas }}
image: {{ .Values.fluentd.image.repository }}:{{ .Values.fluentd.image.tag }}
image: {{ include "fluentbit-operator.image" .Values.fluentd.image }}
resources:
{{- toYaml .Values.fluentd.resources | nindent 4 }}
fluentdCfgSelector:
Expand Down
4 changes: 4 additions & 0 deletions charts/fluent-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ operator:
initcontainer:
repository: "docker"
tag: "20.10"
digest: ""
container:
repository: "kubesphere/fluent-operator"
tag: "v2.2.0"
digest: ""
# FluentBit operator resources. Usually user needn't to adjust these.
resources:
limits:
Expand Down Expand Up @@ -54,6 +56,7 @@ fluentbit:
image:
repository: "kubesphere/fluent-bit"
tag: "v2.0.11"
digest: ""
# fluentbit resources. If you do want to specify resources, adjust them as necessary
# You can adjust it based on the log volume.
resources:
Expand Down Expand Up @@ -197,6 +200,7 @@ fluentd:
image:
repository: "kubesphere/fluentd"
tag: "v1.15.3"
digest: ""
replicas: 1
forward:
port: 24224
Expand Down