Skip to content

Bug: override.xml mounted under wrong ConfigMap in ClickHouse volumes #1901

@ganjiid

Description

@ganjiid

Issue submitter TODO list

  • I've searched for an already existing issues here

Describe the bug (actual behavior)

Description:

In the clickhouse replica statefulset template (statefulset-clickhouse-replica.yaml), the override.xml ConfigMap key is currently placed under the -users ConfigMap volume instead of the -config ConfigMap.

      volumes:
.....
      - name: {{ include "clickhouse.fullname" . }}-users
        configMap:
          name: {{ include "clickhouse.fullname" . }}-users
          items:
          - key: users.xml
            path: users.xml
      {{- end }}
      {{- if .Values.clickhouse.configmap.configOverride }}
          - key: override.xml
            path: override.xml
      {{- end }}

This causes Kubernetes to fail mounting the volume if override.xml is enabled, with the following error:

MountVolume.SetUp failed for volume "sentry-clickhouse-users" : 
configmap references non-existent config key: override.xml

Expected behavior

The override.xml key should be included under the -config ConfigMap volume, not -users.

Fixed

- name: {{ include "clickhouse.fullname" . }}-config
  configMap:
    name: {{ include "clickhouse.fullname" . }}-config
    items:
    - key: config.xml
      path: config.xml
    {{- if .Values.clickhouse.configmap.configOverride }}
    - key: override.xml
      path: override.xml
    {{- end }}
- name: {{ include "clickhouse.fullname" . }}-metrica
  configMap:
    name: {{ include "clickhouse.fullname" . }}-metrica
    items:
    - key: metrica.xml
      path: metrica.xml
- name: {{ include "clickhouse.fullname" . }}-users
  configMap:
    name: {{ include "clickhouse.fullname" . }}-users
    items:
    - key: users.xml
      path: users.xml

values.yaml

clickhouse:
  configmap:
    configOverride:
      ...

Helm chart version

27.4.0

Steps to reproduce

Add this to your values:

clickhouse:
  configmap:
    configOverride:
      ...

Screenshots

No response

Logs

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions