Skip to content

Commit

Permalink
chore: fix keeper cmpd name in cluster (#1160)
Browse files Browse the repository at this point in the history
Co-authored-by: loomts <[email protected]>
(cherry picked from commit 3858722)
  • Loading branch information
loomts committed Nov 7, 2024
1 parent c63fcb4 commit b10af9f
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 21 deletions.
5 changes: 3 additions & 2 deletions addons-cluster/clickhouse/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ Define clickhouse componentSpec with ComponentDefinition.
{{/*
Define clickhouse keeper componentSpec with ComponentDefinition.
*/}}
{{- define "ch-keeper-component" -}}
{{- define "clickhouse-keeper-component" -}}
- name: ch-keeper
componentDef: ch-keeper-24
componentDef: clickhouse-keeper-24
replicas: {{ .Values.keeper.replicaCount }}
disableExporter: {{ $.Values.disableExporter | default "false" }}
{{- with .Values.keeper.tolerations }}
tolerations: {{ .| toYaml | nindent 4 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion addons-cluster/clickhouse/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{- end }}
componentSpecs:
{{- if eq .Values.mode "cluster" }}
{{- include "ch-keeper-component" . | nindent 4 }}
{{- include "clickhouse-keeper-component" . | nindent 4 }}
{{- end }}
{{- if eq (.Values.shardCount | int) 1 }}
{{- include "clickhouse-component" . | nindent 4 }}
Expand Down
12 changes: 6 additions & 6 deletions addons/clickhouse/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ Define clickhouse24 component definition regex pattern
{{- end -}}

{{/*
Define ch-keeper24 component definition name
Define clickhouse-keeper24 component definition name
*/}}
{{- define "ch-keeper24.cmpdName" -}}
{{- define "clickhouse-keeper24.cmpdName" -}}
{{- if eq (len .Values.cmpdVersionPrefix.keeper24 ) 0 -}}
clickhouse-keeper-24-{{ .Chart.Version }}
{{- else -}}
Expand All @@ -87,9 +87,9 @@ clickhouse-keeper-24-{{ .Chart.Version }}
{{- end -}}

{{/*
Define ch-keeper24 component definition regex pattern
Define clickhouse-keeper24 component definition regex pattern
*/}}
{{- define "ch-keeper24.cmpdRegexpPattern" -}}
{{- define "clickhouse-keeper24.cmpdRegexpPattern" -}}
^clickhouse-keeper-24.*
{{- end -}}

Expand Down Expand Up @@ -122,9 +122,9 @@ clickhouse-24-user-configuration-tpl
{{- end -}}

{{/*
Define ch-keeper24 configuration tpl name
Define clickhouse-keeper24 configuration tpl name
*/}}
{{- define "ch-keeper24.configurationTplName" -}}
{{- define "clickhouse-keeper24.configurationTplName" -}}
clickhouse-keeper-24-configuration-tpl
{{- end -}}

Expand Down
2 changes: 1 addition & 1 deletion addons/clickhouse/templates/clusterdefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
- name: clickhouse
compDef: {{ include "clickhouse24.cmpdRegexpPattern" .}}
- name: ch-keeper
compDef: {{ include "ch-keeper24.cmpdRegexpPattern" .}}
compDef: {{ include "clickhouse-keeper24.cmpdRegexpPattern" .}}
orders:
provision:
- ch-keeper
Expand Down
6 changes: 3 additions & 3 deletions addons/clickhouse/templates/cmpd-ch-keeper.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps.kubeblocks.io/v1
kind: ComponentDefinition
metadata:
name: {{ include "ch-keeper24.cmpdName" . }}
name: {{ include "clickhouse-keeper24.cmpdName" . }}
labels:
{{- include "clickhouse.labels" . | nindent 4 }}
annotations:
Expand Down Expand Up @@ -108,8 +108,8 @@ spec:
scrapePath: /metrics
scrapePort: "8001"
configs:
- name: ch-keeper-tpl
templateRef: {{ include "ch-keeper24.configurationTplName" . }}
- name: clickhouse-keeper-tpl
templateRef: {{ include "clickhouse-keeper24.configurationTplName" . }}
volumeName: config
namespace: {{ .Release.Namespace }}
systemAccounts:
Expand Down
2 changes: 1 addition & 1 deletion addons/clickhouse/templates/cmpd-clickhouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ spec:
- name: CH_KEEPER_POD_FQDN_LIST
valueFrom:
componentVarRef:
compDef: {{ include "ch-keeper24.cmpdRegexpPattern" . }}
compDef: {{ include "clickhouse-keeper24.cmpdRegexpPattern" . }}
optional: true
podFQDNs: Required
volumes:
Expand Down
2 changes: 1 addition & 1 deletion addons/clickhouse/templates/cmpv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
- releases:
- 24.8.3
compDefs:
- {{ include "ch-keeper24.cmpdRegexpPattern" . }}
- {{ include "clickhouse-keeper24.cmpdRegexpPattern" . }}
releases:
- name: 24.8.3
serviceVersion: 24.8.3
Expand Down
2 changes: 1 addition & 1 deletion addons/clickhouse/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "ch-keeper24.configurationTplName" . }}
name: {{ include "clickhouse-keeper24.configurationTplName" . }}
labels:
{{- include "clickhouse.labels" . | nindent 4 }}
data:
Expand Down
2 changes: 1 addition & 1 deletion addons/clickhouse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ commonAnnotations: {}
# If specified, the component definition will use it as prefix.
cmpdVersionPrefix:
clickhouse24: "clickhouse-24"
keeper24: "ch-keeper-24"
keeper24: "clickhouse-keeper-24"

image:
registry: docker.io
Expand Down
2 changes: 1 addition & 1 deletion examples/clickhouse/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
requests:
storage: 20Gi
- name: ch-keeper
componentDef: ch-keeper-24
componentDef: clickhouse-keeper-24
serviceAccountName: kb-clickhouse-cluster
replicas: 1
systemAccounts:
Expand Down
2 changes: 1 addition & 1 deletion examples/clickhouse/restart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ spec:
restart:
# Specifies the name of the Component.
# - clickhouse
# - ch-keeper
# - clickhouse-keeper
- componentName: clickhouse
2 changes: 1 addition & 1 deletion examples/clickhouse/verticalscale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
# Lists VerticalScaling objects, each specifying a component and its desired compute resources for vertical scaling.
verticalScaling:
# - clickhouse
# - ch-keeper
# - clickhouse-keeper
- componentName: clickhouse
# VerticalScaling refers to the process of adjusting the compute resources (e.g., CPU, memory) allocated to a Component. It defines the parameters required for the operation.
requests:
Expand Down
2 changes: 1 addition & 1 deletion examples/clickhouse/volumeexpand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
volumeExpansion:
# Specifies the name of the Component.
# - clickhouse
# - ch-keeper
# - clickhouse-keeper
- componentName: clickhouse
# volumeClaimTemplates specifies the storage size and volumeClaimTemplate name.
volumeClaimTemplates:
Expand Down

0 comments on commit b10af9f

Please sign in to comment.