Altinity / clickhouse-operator

Altinity Kubernetes Operator for ClickHouse creates, configures and manages ClickHouse® clusters running on Kubernetes
https://altinity.com
Apache License 2.0
1.94k stars 464 forks source link

[Question] Is using PreviousTailAffinity in a single node cluster valid syntax? #1378

Open xinze-zheng opened 8 months ago

xinze-zheng commented 8 months ago

Hey there. I tried to apply to following CR with podDistribution type set to PreviousTailAffinity and the reconciliation failed. I'm wondering if this is a semantic issue or a bug in operator. In case you want to see more details, I also attach the log of operator below. Thanks.

apiVersion: clickhouse.altinity.com/v1
kind: ClickHouseInstallation
metadata:
  name: test-cluster
spec:
  configuration:
    clusters:
    - layout:
        replicasCount: 2
        shardsCount: 2
      name: replicated
    zookeeper:
      nodes:
      - host: zookeeper.zoo3.ns
  defaults:
    templates:
      dataVolumeClaimTemplate: default
      podTemplate: clickhouse:19.6
  templates:
    podTemplates:
    - name: clickhouse:19.6
      podDistribution:
      - type: PreviousTailAffinity
      spec:
        containers:
        - image: clickhouse/clickhouse-server:22.3
          name: clickhouse-pod
    volumeClaimTemplates:
    - name: default
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 500Mi

affinity.log

Slach commented 8 months ago

Could you share

kubectl get pod -n acto-clickhouse | grep chi-test-cluster-replicated-0-0-0 
kubectl logs -n acto-clickhouse chi-test-cluster-replicated-0-0-0 --since=48h