clickhouse-operator icon indicating copy to clipboard operation
clickhouse-operator copied to clipboard

clickhouse-operator restarts after failing to get clickhouse-keeper.altinity.com/v1

Open bradbart opened this issue 2 years ago • 7 comments

When running the clickhouse-operator, the operator is restarting and causing issues in my k8s environment. The error in the logs before the restart is

│  ERROR    controller-runtime.source.EventHandler    failed to get informer from cache    {"error": "failed to get API group resources: unable to retrieve the complete list of server APIs: clickhouse-keeper.altinity.com/v1: the server could not find the requested resource"}      

Here is the configuration I am using when I run into this issue:

apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"

metadata:
  name: "my-cluster"

spec:
  defaults:
    templates: 
      dataVolumeClaimTemplate: default
      podTemplate: clickhouse:19.6
  configuration:
    users:
      default/password_sha256_hex: {{ .Values.defaultCredentials.passwordSha256 }}
    clusters:
      - name: my-cluster
        secret:
          auto: "true"

  templates:
    volumeClaimTemplates:
      - name: default
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 500Mi
    podTemplates:
      - name: clickhouse:19.6
        spec:
          containers:
            - name: clickhouse-pod
              image: clickhouse/clickhouse-server:22.3

Why would it be attempting to get information about the keeper when the cluster does not support replication / sharding?

bradbart avatar Jan 30 '24 22:01 bradbart

Could say how did you install clickhouse-operator? Looks like you use unofficial customized helm chart and trying to upgrade clickhouse-operator image to 0.23.0? am i right?

Slach avatar Jan 31 '24 05:01 Slach

Is there an official supported helm chart? I didn't see any mention of helm in the docs so I pushed the K8s resource definitions into charts.

I followed this step in the getting started guide to install the operator, which points to altinity/clickhouse-operator:latest https://github.com/Altinity/clickhouse-operator/blob/master/docs/quick_start.md#in-case-you-can-not-run-scripts-from-the-internet-in-your-protected-environment

bradbart avatar Jan 31 '24 12:01 bradbart

Looking at Docker Hub, it looks like the altinity/clickhouse-operator:latest tag points to 0.22, I had changed the latest locally to point to 0.23 to pin the version. I think this issue can be closed as the operator is running correctly now that I switched back to the 0.22 version.

bradbart avatar Jan 31 '24 13:01 bradbart

Yes, 0.23.0 is not yet released

I didn't see any mention of helm in the docs

look into https://github.com/Altinity/clickhouse-operator/blob/master/docs/operator_installation_details.md#install-via-helm

Slach avatar Jan 31 '24 13:01 Slach

If you will use operator helm chart you need separatelly install updated CRDs

Slach avatar Jan 31 '24 13:01 Slach

I have same issue with operator helm chart 0.23.2. I have zookeeper instead of clickhouse-keeper. my changes to default values are:

operator.resources operator.metrics.resources secret.password configs.files.config.yaml.watch.namespaces: ["clickhouse-cip"] configs.files.config.yaml.user.default.password

ERROR controller-runtime.source.EventHandler failed to get informer from cache {"error": "failed to get API group resources: unable to retrieve the complete list of server APIs: clickhouse-keeper.altinity.com/v1: the server could not find the requested resource"} sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1

ahmadubuntu avatar Feb 28 '24 06:02 ahmadubuntu

@ahmadubuntu read helm chart README https://github.com/Altinity/clickhouse-operator/tree/master/deploy/helm/ upgrade CRD separatelly this is Helm architecture problem

Slach avatar Feb 28 '24 06:02 Slach