Skip to content

Commit

Permalink
Merge pull request #81 from SigNoz/prashant/ch-logging-opt
Browse files Browse the repository at this point in the history
clickhouse logging option template and other changes
  • Loading branch information
prashant-shahi authored Sep 15, 2022
2 parents e369c95 + 5a54cbf commit 64e9483
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion charts/clickhouse/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: clickhouse
description: A Helm chart for ClickHouse
type: application
version: 23.5.2
version: 23.5.3
appVersion: "22.4.5"
icon: https://raw.githubusercontent.com/ClickHouse/ClickHouse/master/website/images/logo-400x240.png
sources:
Expand Down
7 changes: 6 additions & 1 deletion charts/clickhouse/templates/clickhouse-instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
templates:
{{- if and (.Values.persistence.enabled) (not .Values.persistence.existingClaim) }}
dataVolumeClaimTemplate: data-volumeclaim-template
# logVolumeClaimTemplate: data-volumeclaim-template
# logVolumeClaimTemplate: log-volumeclaim-template
{{- end }}
serviceTemplate: service-template
configuration:
Expand Down Expand Up @@ -137,6 +137,9 @@ spec:
- name: data-volumeclaim-template
persistentVolumeClaim:
claimName: data-volumeclaim-template
# - name: log-volumeclaim-template
# persistentVolumeClaim:
# claimName: log-volumeclaim-template
{{- end }}
{{- end }}

Expand Down Expand Up @@ -171,6 +174,8 @@ spec:
{{- end }}
mountPath: /var/lib/clickhouse
{{- end }}
# - name: log-volumeclaim-template
# mountPath: /var/log/clickhouse-server

{{- if .Values.resources }}
resources: {{ toYaml .Values.resources | nindent 16 }}
Expand Down
34 changes: 18 additions & 16 deletions charts/clickhouse/templates/clickhouse-operator/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ data:
# chUsername
# chPassword
# password_sha256_hex
################################################
##
## Watch Section
Expand All @@ -31,7 +31,7 @@ data:
# Concurrently running operators should watch on different namespaces
#namespaces: ["dev", "test"]
namespaces: []
clickhouse:
configuration:
################################################
Expand Down Expand Up @@ -96,7 +96,7 @@ data:
name: ""
# Port where to connect to ClickHouse instances to
port: 8123
################################################
##
## Templates Section
Expand All @@ -107,7 +107,7 @@ data:
# Path to the folder where ClickHouseInstallation .yaml manifests are located.
# Manifests are applied in sorted alpha-numeric order.
path: templates.d
################################################
##
## Reconcile Section
Expand All @@ -117,7 +117,7 @@ data:
runtime:
# Max number of concurrent reconciles in progress
threadsNumber: 10
statefulSet:
create:
# What to do in case created StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds
Expand All @@ -126,7 +126,7 @@ data:
# 2. delete - delete newly created problematic StatefulSet
# 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet
onFailure: ignore
update:
# How many seconds to wait for created/updated StatefulSet to be Ready
timeout: 300
Expand All @@ -139,7 +139,7 @@ data:
# Pod would be recreated by StatefulSet based on rollback-ed configuration
# 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet
onFailure: rollback
host:
# Whether reconciler should wait for host:
# to be excluded from cluster OR
Expand All @@ -148,7 +148,7 @@ data:
wait:
exclude: true
include: false
################################################
##
## Annotations management
Expand All @@ -163,7 +163,7 @@ data:
include: []
# Exclude annotations from the following list:
exclude: []
################################################
##
## Labels management
Expand Down Expand Up @@ -191,15 +191,15 @@ data:
# LabelClusterScopeCycleIndex
# LabelClusterScopeCycleOffset
appendScope: "no"
################################################
##
## StatefulSet management
##
################################################
statefulSet:
revisionHistoryLimit: 0
################################################
##
## Pod management
Expand All @@ -211,7 +211,7 @@ data:
# SIGTERM and SIGKILL during Pod termination process.
# Increase this number is case of slow shutdown.
terminationGracePeriod: 30
################################################
##
## Log parameters
Expand Down Expand Up @@ -269,14 +269,16 @@ data:
01-clickhouse-02-logger.xml: |
<yandex>
<logger>
{{- with .Values.clickhouseOperator.logger }}
<!-- Possible levels: https://github.com/pocoproject/poco/blob/develop/Foundation/include/Poco/Logger.h#L105 -->
<level>debug</level>
<level>{{ .level }}</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>10</count>
<size>{{ .size }}</size>
<count>{{ .count }}</count>
<!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
<console>1</console>
<console>{{ .console }}</console>
{{- end }}
</logger>
</yandex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ spec:
{{- include "clickhouseOperator.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- if .Values.clickhouseOperator.podAnnotations }}
{{- toYaml .Values.clickhouseOperator.podAnnotations | nindent 8 }}
{{- end }}
checksum/config: {{ include (print $.Template.BasePath "/clickhouse-operator/configmap.yaml") . | sha256sum }}
labels:
{{- include "clickhouseOperator.selectorLabels" . | nindent 8 }}
{{- with .Values.clickhouseOperator.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "clickhouseOperator.fullname" . }}
volumes:
Expand Down
12 changes: 12 additions & 0 deletions charts/clickhouse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,18 @@ clickhouseOperator:
# -- Clickhouse Operator node selector
nodeSelector: {}

# -- Clickhouse logging config
logger:
# -- Logging level. Acceptable values: trace, debug, information, warning, error.
level: information
# -- Size of the file. Applies to log and errorlog. Once the file reaches size,
# ClickHouse archives and renames it, and creates a new log file in its place.
size: 1000M
# -- The number of archived log files that ClickHouse stores.
count: 10
# -- Whether to send log and errorlog to the console instead of file. To enable, set to 1 or true.
console: true

# -- Metrics Exporter config.
metricsExporter:
# -- name of the component
Expand Down

0 comments on commit 64e9483

Please sign in to comment.