Skip to content

Commit 43f76a5

Browse files
affoxx789633
andauthored
[helm] Enable pulling from private Docker registry (#2692)
* [helm] Enable pulling from private Docker registry Added instructions for using a private Docker registry and included image values reference. --------- Co-authored-by: xx789 <348448708@qq.com>
1 parent 4f74f32 commit 43f76a5

File tree

4 files changed

+54
-3
lines changed

4 files changed

+54
-3
lines changed

helm/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,20 @@ Important Fluss options surfaced by the chart:
9898
- zookeeper.address must point to a reachable ensemble.
9999
- data.dir defaults to /tmp/fluss/data; use a PVC if persistence.enabled=true.
100100

101+
### Private Docker Registry
102+
103+
If you are pulling the Fluss image from a private Docker registry, you can configure the chart using `image.registry` and `image.pullSecrets`.
104+
105+
#### Image values reference
106+
107+
| Parameter | Description | Default |
108+
| -------------------- |------------------------------------------|---------------------|
109+
| `image.registry` | Docker image registry | `""` |
110+
| `image.repository` | Docker image repository | `apache/fluss` |
111+
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
112+
| `image.pullSecrets` | Docker registry secret names as an array | `[]` |
113+
114+
101115
## Resource management
102116

103117
Set resources with requests/limits as appropriate for production. There are no defaults to make it also run on environments with little resources such as Minikube.

helm/templates/_helpers.tpl

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,39 @@ Selector labels
6363
{{- define "fluss.selectorLabels" -}}
6464
app.kubernetes.io/name: {{ include "fluss.name" . }}
6565
app.kubernetes.io/instance: {{ .Release.Name }}
66-
{{- end }}
66+
{{- end }}
67+
68+
{{/*
69+
Image name
70+
*/}}
71+
{{- define "fluss.image" -}}
72+
73+
{{- $registry := .Values.image.registry | default "" -}}
74+
{{- $repo := required "image.repository is required" .Values.image.repository -}}
75+
{{- $tag := .Values.image.tag | default "" | toString -}}
76+
77+
{{- $image := $repo -}}
78+
79+
{{- if $registry -}}
80+
{{- $image = printf "%s/%s" $registry $image -}}
81+
{{- end -}}
82+
83+
{{- if $tag -}}
84+
{{- $image = printf "%s:%s" $image $tag -}}
85+
{{- end -}}
86+
87+
{{- $image -}}
88+
{{- end -}}
89+
90+
{{/*
91+
Render pull secrets
92+
*/}}
93+
{{- define "fluss.imagePullSecrets" -}}
94+
{{- $secrets := .Values.image.pullSecrets -}}
95+
{{- if $secrets -}}
96+
imagePullSecrets:
97+
{{- range $secrets }}
98+
- name: {{ . }}
99+
{{- end }}
100+
{{- end }}
101+
{{- end }}

helm/templates/sts-coordinator.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ spec:
3838
{{- if .Values.serviceAccount.create }}
3939
serviceAccountName: {{ .Values.serviceAccount.name | default (include "fluss.fullname" .) }}
4040
{{- end }}
41+
{{- include "fluss.imagePullSecrets" . | nindent 6 }}
4142
containers:
4243
- name: {{ .Chart.Name }}-coordinator
43-
image: "{{.Values.image.repository}}:{{ .Values.image.tag }}"
44+
image: {{ include "fluss.image" . }}
4445
imagePullPolicy: {{ .Values.image.pullPolicy }}
4546
env:
4647
- name: POD_NAME

helm/templates/sts-tablet.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ spec:
3838
{{- if .Values.serviceAccount.create }}
3939
serviceAccountName: {{ .Values.serviceAccount.name | default (include "fluss.fullname" .) }}
4040
{{- end }}
41+
{{- include "fluss.imagePullSecrets" . | nindent 6 }}
4142
containers:
4243
- name: {{ .Chart.Name }}-tablet
43-
image: "{{.Values.image.repository}}:{{ .Values.image.tag }}"
44+
image: {{ include "fluss.image" . }}
4445
imagePullPolicy: {{ .Values.image.pullPolicy }}
4546
env:
4647
- name: POD_NAME

0 commit comments

Comments
 (0)