|
| 1 | +{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }} |
| 2 | +{{- $clusterDomain := (index $cozyConfig.data "cluster-domain") | default "cozy.local" }} |
| 3 | + |
| 4 | +{{- if .Values.clickhouseKeeper.enabled }} |
| 5 | +apiVersion: "clickhouse-keeper.altinity.com/v1" |
| 6 | +kind: "ClickHouseKeeperInstallation" |
| 7 | +metadata: |
| 8 | + name: "{{ .Release.Name }}-keeper" |
| 9 | + annotations: |
| 10 | + prometheus.io/port: "7000" |
| 11 | + prometheus.io/scrape: "true" |
| 12 | +spec: |
| 13 | + namespaceDomainPattern: "%s.svc.{{ $clusterDomain }}" |
| 14 | + configuration: |
| 15 | + clusters: |
| 16 | + - name: "cluster1" |
| 17 | + layout: |
| 18 | + replicasCount: {{ .Values.clickhouseKeeper.replicas }} |
| 19 | + settings: |
| 20 | + logger/level: "trace" |
| 21 | + logger/console: "true" |
| 22 | + listen_host: "0.0.0.0" |
| 23 | + keeper_server/four_letter_word_white_list: "*" |
| 24 | + keeper_server/coordination_settings/raft_logs_level: "information" |
| 25 | + prometheus/endpoint: "/metrics" |
| 26 | + prometheus/port: "7000" |
| 27 | + prometheus/metrics: "true" |
| 28 | + prometheus/events: "true" |
| 29 | + prometheus/asynchronous_metrics: "true" |
| 30 | + prometheus/status_info: "false" |
| 31 | + |
| 32 | + defaults: |
| 33 | + templates: |
| 34 | + # Templates are specified as default for all clusters |
| 35 | + podTemplate: default |
| 36 | + dataVolumeClaimTemplate: default |
| 37 | + |
| 38 | + templates: |
| 39 | + podTemplates: |
| 40 | + - name: default |
| 41 | + metadata: |
| 42 | + labels: |
| 43 | + app: "{{ .Release.Name }}-keeper" |
| 44 | + annotations: |
| 45 | + prometheus.io/port: "7000" |
| 46 | + prometheus.io/scrape: "true" |
| 47 | + spec: |
| 48 | + affinity: |
| 49 | + podAntiAffinity: |
| 50 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 51 | + - labelSelector: |
| 52 | + matchExpressions: |
| 53 | + - key: "app" |
| 54 | + operator: In |
| 55 | + values: |
| 56 | + - "{{ .Release.Name }}-keeper" |
| 57 | + topologyKey: "kubernetes.io/hostname" |
| 58 | + containers: |
| 59 | + - name: clickhouse-keeper |
| 60 | + imagePullPolicy: IfNotPresent |
| 61 | + image: clickhouse/clickhouse-keeper:24.9.2.42 |
| 62 | + resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.clickhouseKeeper.resourcesPreset .Values.resources $) | nindent 20 }} |
| 63 | + securityContext: |
| 64 | + fsGroup: 101 |
| 65 | + |
| 66 | + volumeClaimTemplates: |
| 67 | + - name: default |
| 68 | + spec: |
| 69 | + accessModes: |
| 70 | + - ReadWriteOnce |
| 71 | + resources: |
| 72 | + requests: |
| 73 | + storage: "{{ .Values.clickhouseKeeper.size }}" |
| 74 | +--- |
| 75 | +apiVersion: operator.victoriametrics.com/v1beta1 |
| 76 | +kind: VMPodScrape |
| 77 | +metadata: |
| 78 | + name: {{ .Release.Name }}-keeper |
| 79 | + namespace: {{ .Release.Namespace }} |
| 80 | +spec: |
| 81 | + selector: |
| 82 | + matchLabels: |
| 83 | + app: {{ .Release.Name }}-keeper |
| 84 | + namespaceSelector: |
| 85 | + matchNames: |
| 86 | + - {{ .Release.Namespace }} |
| 87 | + podMetricsEndpoints: |
| 88 | + - port: metrics |
| 89 | + path: /metrics |
| 90 | + interval: 30s |
| 91 | + scheme: http |
| 92 | + relabelConfigs: |
| 93 | + - action: replace |
| 94 | + sourceLabels: [__meta_kubernetes_pod_node_name] |
| 95 | + targetLabel: instance |
| 96 | +{{- end }} |
0 commit comments