Skip to content
Merged
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
5 changes: 4 additions & 1 deletion dist/chart-cluster/templates/clickhouse-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ metadata:
spec:
{{- /* Chart-provided defaults: image tag from .Values.imageTag (fallback: chart appVersion). User values override. */}}
{{- $tag := default .Chart.AppVersion .Values.imageTag }}
{{- $defaults := dict "containerTemplate" (dict "image" (dict "tag" $tag)) }}
{{- $repository := .Values.clickhouse.image.repository }}
{{- $registry := default .Values.clickhouse.image.registry ((.Values.global | default dict).imageRegistry) }}
{{- if $registry }}{{- $repository = printf "%s/%s" (trimSuffix "/" $registry) $repository }}{{- end }}
{{- $defaults := dict "containerTemplate" (dict "image" (dict "tag" $tag "repository" $repository)) }}
{{- $spec := mergeOverwrite $defaults (deepCopy (.Values.clickhouse.spec | default dict)) }}
{{- /* Auto-wire keeperClusterRef when keeper is enabled in-chart and user did not pin one. */}}
{{- if and .Values.keeper.enabled (not (hasKey $spec "keeperClusterRef")) }}
Expand Down
5 changes: 4 additions & 1 deletion dist/chart-cluster/templates/keeper-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ metadata:
spec:
{{- /* Chart-provided defaults: image tag from .Values.imageTag (fallback: chart appVersion). User values override. */}}
{{- $tag := default .Chart.AppVersion .Values.imageTag }}
{{- $defaults := dict "containerTemplate" (dict "image" (dict "tag" $tag)) }}
{{- $repository := .Values.keeper.image.repository }}
{{- $registry := default .Values.keeper.image.registry ((.Values.global | default dict).imageRegistry) }}
{{- if $registry }}{{- $repository = printf "%s/%s" (trimSuffix "/" $registry) $repository }}{{- end }}
{{- $defaults := dict "containerTemplate" (dict "image" (dict "tag" $tag "repository" $repository)) }}
{{- $spec := mergeOverwrite $defaults (deepCopy (.Values.keeper.spec | default dict)) }}
{{- toYaml $spec | nindent 2 }}
{{- end }}
23 changes: 23 additions & 0 deletions dist/chart-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,25 @@
# clickhouse.spec.containerTemplate.image.tag / keeper.spec.containerTemplate.image.tag.
imageTag: ""

# Global values shared across this chart and its parent chart.
global:
# Optional registry prefix prepended to every image repository rendered by
# this chart. Routes all pulls through a single mirror/proxy registry.
# Empty disables the prefix. Overrides clickhouse.image.registry / keeper.image.registry.
imageRegistry: ""

clickhouse:
# Whether to create the ClickHouseCluster CR.
enabled: true

# Container image for ClickHouse server. The effective value is injected into
# spec.containerTemplate.image.repository (an explicit spec value still wins).
# registry is an optional prefix overridden by global.imageRegistry; empty
# uses repository as-is.
image:
registry: ""
repository: docker.io/clickhouse/clickhouse-server

# Metadata applied to the ClickHouseCluster CR itself.
meta:
# CR name. Defaults to the Helm release name when empty.
Expand Down Expand Up @@ -89,6 +104,14 @@ keeper:
# Whether to create the KeeperCluster CR.
enabled: true

# Container image for ClickHouse Keeper. The effective value is injected into
# spec.containerTemplate.image.repository (an explicit spec value still wins).
# registry is an optional prefix overridden by global.imageRegistry; empty
# uses repository as-is.
image:
registry: ""
repository: docker.io/clickhouse/clickhouse-keeper

# Metadata applied to the KeeperCluster CR itself.
meta:
# CR name. Defaults to the Helm release name when empty.
Expand Down
5 changes: 4 additions & 1 deletion dist/chart/templates/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ spec:
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
image: "{{ .Values.manager.image.repository }}{{- if .Values.manager.image.digest }}@{{ .Values.manager.image.digest }}{{- else if not (contains "@" .Values.manager.image.repository) }}:{{ .Values.manager.image.tag | default .Chart.AppVersion }}{{- end }}"
{{- $repository := .Values.manager.image.repository }}
{{- $registry := default .Values.manager.image.registry (.Values.global | default dict).imageRegistry }}
{{- if $registry }}{{- $repository = printf "%s/%s" (trimSuffix "/" $registry) $repository }}{{- end }}
image: "{{ $repository }}{{- if .Values.manager.image.digest }}@{{ .Values.manager.image.digest }}{{- else if not (contains "@" $repository) }}:{{ .Values.manager.image.tag | default .Chart.AppVersion }}{{- end }}"
{{- with .Values.manager.image.pullPolicy }}
imagePullPolicy: {{ . }}
{{- end }}
Expand Down
15 changes: 15 additions & 0 deletions dist/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
##
# fullnameOverride: ""

## Global values shared across this chart and its subcharts.
##
global:
## Optional registry prefix prepended to every image repository rendered by
## this chart. Routes all pulls through a single mirror/proxy registry.
## Empty disables the prefix. Overrides per-image registry settings.
## Example: "my-proxy.example.com" renders
## my-proxy.example.com/ghcr.io/clickhouse/clickhouse-operator
##
imageRegistry: ""

## Configure the controller manager settings
##
controller:
Expand All @@ -30,6 +41,10 @@ manager:
replicas: 1

image:
## Optional registry prefix for this image. Overridden by global.imageRegistry
## when set. Empty uses repository as-is.
##
registry: ""
repository: ghcr.io/clickhouse/clickhouse-operator
## Digest of the image to use. Tag is used if unset.
##
Expand Down
23 changes: 23 additions & 0 deletions tools/gen-cluster-chart/templates/values.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,25 @@
# clickhouse.spec.containerTemplate.image.tag / keeper.spec.containerTemplate.image.tag.
imageTag: ""

# Global values shared across this chart and its parent chart.
global:
# Optional registry prefix prepended to every image repository rendered by
# this chart. Routes all pulls through a single mirror/proxy registry.
# Empty disables the prefix. Overrides clickhouse.image.registry / keeper.image.registry.
imageRegistry: ""

clickhouse:
# Whether to create the ClickHouseCluster CR.
enabled: true

# Container image for ClickHouse server. The effective value is injected into
# spec.containerTemplate.image.repository (an explicit spec value still wins).
# registry is an optional prefix overridden by global.imageRegistry; empty
# uses repository as-is.
image:
registry: ""
repository: docker.io/clickhouse/clickhouse-server

# Metadata applied to the ClickHouseCluster CR itself.
meta:
# CR name. Defaults to the Helm release name when empty.
Expand All @@ -54,6 +69,14 @@ keeper:
# Whether to create the KeeperCluster CR.
enabled: true

# Container image for ClickHouse Keeper. The effective value is injected into
# spec.containerTemplate.image.repository (an explicit spec value still wins).
# registry is an optional prefix overridden by global.imageRegistry; empty
# uses repository as-is.
image:
registry: ""
repository: docker.io/clickhouse/clickhouse-keeper

# Metadata applied to the KeeperCluster CR itself.
meta:
# CR name. Defaults to the Helm release name when empty.
Expand Down
Loading