Skip to content

Commit 167eb53

Browse files
helm-chart: Streamline image values and usage (#1550)
Signed-off-by: Marco Franssen <[email protected]>
1 parent 3ec796c commit 167eb53

File tree

10 files changed

+46
-19
lines changed

10 files changed

+46
-19
lines changed

.github/renovate-config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@ module.exports = {
2323
customType: "regex",
2424
matchStringsStrategy: "any",
2525
fileMatch: [
26+
"charts/fluent-operator/Chart.yaml",
27+
"charts/fluent-operator/charts/fluent-bit-crds/Chart.yaml",
28+
"charts/fluent-operator/charts/fluentd-crds/Chart.yaml",
2629
"charts/fluent-operator/values.yaml",
30+
"cmd/fluent-watcher/fluentbit/VERSION",
2731
"config/.*\\.yaml",
2832
"docs/.*\\.yaml",
2933
"manifests/.*\\.yaml",
30-
"cmd/fluent-watcher/fluentbit/VERSION",
3134
],
3235
matchStrings: [
3336
'# renovate:\\s+datasource=(?<datasource>\\S+?)\\s+depName=(?<depName>\\S+?)\\s+tag:\\s+"(?<currentValue>.+?)"\\s+?',
37+
"# renovate:\\s+datasource=(?<datasource>\\S+?)\\s+depName=(?<depName>\\S+?)\\s+tag:\\s+(?<currentValue>.+?)\\s+?",
3438
"# renovate:\\s+datasource=(?<datasource>\\S+?)\\s+depName=(?<depName>.+?)\\s+image:\\s*(?:.?)*:(?<currentValue>.*?)\\s+?",
3539
"# renovate:\\s+datasource=(?<datasource>\\S+?)\\s+depName=(?<depName>.+?)\\s+version=\\n(?<currentValue>.+?)\\n",
40+
'# renovate:\\s+datasource=(?<datasource>\\S+?)\\s+depName=(?<depName>.+?)\\s+appVersion:\\s+"(?<currentValue>.+?)"\\n',
3641
],
3742
extractVersionTemplate: "^v(?<version>.*)$",
3843
},

charts/fluent-operator/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ keywords:
77
- fluentd
88
- operator
99
version: 3.3.0
10-
appVersion: 3.3.0
10+
# renovate: datasource=docker depName=ghcr.io/fluent/fluent-operator/fluent-operator
11+
appVersion: "3.3.0"
1112
icon: https://raw.githubusercontent.com/fluent/fluent-operator/master/docs/images/fluent-operator-icon.svg
1213
home: https://www.fluentd.org/
1314
sources:

charts/fluent-operator/charts/fluent-bit-crds/Chart.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ version: 3.3.0
2020
# incremented each time you make changes to the application. Versions are not expected to
2121
# follow Semantic Versioning. They should reflect the version the application is using.
2222
# It is recommended to use it with quotes.
23+
# renovate: datasource=docker depName=ghcr.io/fluent/fluent-operator/fluent-operator
2324
appVersion: "3.3.0"

charts/fluent-operator/charts/fluentd-crds/Chart.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ version: 3.3.0
2020
# incremented each time you make changes to the application. Versions are not expected to
2121
# follow Semantic Versioning. They should reflect the version the application is using.
2222
# It is recommended to use it with quotes.
23+
# renovate: datasource=docker depName=ghcr.io/fluent/fluent-operator/fluent-operator
2324
appVersion: "3.3.0"

charts/fluent-operator/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,14 @@ Create the name of the service account to use
7272
{{- default "default" .Values.serviceAccount.name }}
7373
{{- end }}
7474
{{- end }}
75+
76+
{{/*
77+
Util function for generating the image URL based on the provided options.
78+
*/}}
79+
{{- define "fluent-operator.image" -}}
80+
{{- $defaultTag := index . 1 -}}
81+
{{- with index . 0 -}}
82+
{{- if .registry -}}{{ printf "%s/%s" .registry .repository }}{{- else -}}{{- .repository -}}{{- end -}}
83+
{{- if .digest -}}{{ printf "@%s" .digest }}{{- else -}}{{ printf ":%s" (default $defaultTag .tag) }}{{- end -}}
84+
{{- end }}
85+
{{- end }}

charts/fluent-operator/templates/fluent-operator-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
path: /var/run/docker.sock
3737
initContainers:
3838
- name: setenv
39-
image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
39+
image: {{ template "fluent-operator.image" (tuple .Values.operator.initcontainer.image "") }}
4040
command:
4141
- /bin/sh
4242
- '-c'
@@ -56,7 +56,7 @@ spec:
5656
emptyDir: {}
5757
initContainers:
5858
- name: setenv
59-
image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
59+
image: {{ template "fluent-operator.image" (tuple .Values.operator.initcontainer.image "") }}
6060
command:
6161
- /bin/sh
6262
- '-c'
@@ -73,7 +73,7 @@ spec:
7373
emptyDir: {}
7474
initContainers:
7575
- name: setenv
76-
image: {{ .Values.operator.initcontainer.repository }}:{{ .Values.operator.initcontainer.tag }}
76+
image: {{ template "fluent-operator.image" (tuple .Values.operator.initcontainer.image "") }}
7777
command:
7878
- /bin/sh
7979
- '-c'
@@ -87,7 +87,7 @@ spec:
8787
{{- end }}
8888
containers:
8989
- name: fluent-operator
90-
image: {{ .Values.operator.container.repository }}:{{ .Values.operator.container.tag }}
90+
image: {{ template "fluent-operator.image" (tuple .Values.operator.image $.Chart.AppVersion) }}
9191
{{- if .Values.operator.securityContext }}
9292
securityContext:
9393
{{- toYaml .Values.operator.securityContext | nindent 10 }}

charts/fluent-operator/templates/fluentbit-fluentBit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ spec:
1616
{{- else if .Values.fluentbit.hostNetwork }}
1717
dnsPolicy: ClusterFirstWithHostNet
1818
{{- end }}
19-
image: {{ .Values.fluentbit.image.repository }}:{{ .Values.fluentbit.image.tag }}
20-
{{- with .Values.fluentbit.imagePullSecrets }}
19+
image: {{ template "fluent-operator.image" (tuple .Values.fluentbit.image "") }}
20+
{{- if .Values.fluentbit.imagePullSecrets }}
2121
imagePullSecrets:
2222
{{- toYaml . | nindent 4 }}
2323
{{- end }}

charts/fluent-operator/templates/fluentbit-fluentbit-edge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
labels:
88
app.kubernetes.io/name: fluent-bit
99
spec:
10-
image: {{ .Values.fluentbit.image.repository }}:{{ .Values.fluentbit.image.tag }}
10+
image: {{ template "fluent-operator.image" (tuple .Values.fluentbit.image "") }}
1111
positionDB:
1212
hostPath:
1313
path: /var/lib/fluent-bit/

charts/fluent-operator/templates/fluentd-fluentd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
bind: 0.0.0.0
1515
port: {{ .port }}
1616
replicas: {{ .replicas }}
17-
image: {{ .image.repository }}:{{ .image.tag }}
17+
image: {{ template "fluent-operator.image" (tuple .Values.fluentd.image "") }}
1818
{{- with .imagePullSecrets }}
1919
imagePullSecrets:
2020
{{- toYaml . | nindent 4 }}

charts/fluent-operator/values.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ operator:
1212
# The init container is to get the actual storage path of the docker log files so that it can be mounted to collect the logs.
1313
# see https://github.com/fluent/fluent-operator/blob/master/manifests/setup/fluent-operator-deployment.yaml#L26
1414
initcontainer:
15-
repository: "docker"
16-
tag: "20.10"
15+
image:
16+
registry: docker.io
17+
repository: docker
18+
tag: "20.10"
1719

1820
resources:
1921
limits:
@@ -22,9 +24,10 @@ operator:
2224
requests:
2325
cpu: 50m
2426
memory: 64Mi
25-
container:
26-
repository: "kubesphere/fluent-operator"
27-
tag: "latest"
27+
image:
28+
registry: ghcr.io
29+
repository: fluent/fluent-operator/fluent-operator
30+
tag: ""
2831
# If set to false, this will disable the creation of ClusterRole, ClusterRoleBinding,
2932
# Deployment, and ServiceAccount resources to avoid conflicts when deploying multiple instances.
3033
enable: true
@@ -96,9 +99,11 @@ fluentbit:
9699
failureThreshold: 8
97100

98101
image:
99-
repository: "ghcr.io/fluent/fluent-operator/fluent-bit"
100-
tag: 4.0.0
102+
registry: ghcr.io
103+
repository: fluent/fluent-operator/fluent-bit
101104
# renovate: datasource=docker depName=ghcr.io/fluent/fluent-operator/fluent-bit
105+
tag: "4.0.0"
106+
102107
# fluentbit resources. If you do want to specify resources, adjust them as necessary
103108
# You can adjust it based on the log volume.
104109
resources:
@@ -424,8 +429,11 @@ fluentd:
424429
mode: "collector"
425430
port: 24224
426431
image:
427-
repository: "ghcr.io/fluent/fluent-operator/fluentd"
428-
tag: "v1.17.1"
432+
registry: ghcr.io
433+
repository: fluent/fluent-operator/fluentd
434+
# renovate: datasource=docker depName=ghcr.io/fluent/fluent-operator/fluentd
435+
tag: v1.17.1
436+
429437
# Numbers of the Fluentd instance
430438
# Applicable when the mode is "collector", and will be ignored when the mode is "agent"
431439
replicas: 1

0 commit comments

Comments
 (0)