druid-io / druid-operator

Druid Kubernetes Operator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot create PVC

zhangluva opened this issue · comments

Has #167 been re-introduced?
I am on operator version 0.0.9, and trying to create PVC on historical and middle manager. The snippet for historical looks like below

nodes:
    historicals:
      druid.port: 8088
      nodeConfigMountPath: /opt/druid/conf/druid/cluster/data/historical
      nodeType: historical
      replicas: 5
      volumeClaimTemplates:
      - apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: historical
        spec:
          accessModes:
          - ReadWriteOnce
          resources:
            requests:
              storage: 50Gi
          storageClassName: gp2

However, when I looked at the druid definition that the operator created on the cluster, the volumeClaimTemplates.metadata.name was removed. The generated snippet for the PVC

      volumeClaimTemplates:
      - apiVersion: v1
        kind: PersistentVolumeClaim
        metadata: {}
        spec:
          accessModes:
          - ReadWriteOnce
          resources:
            requests:
              storage: 50Gi
          storageClassName: gp2
        status: {}

And describe sts historical shows

│ Events:                                                                                                                                                         │
│   Type     Reason        Age                   From                    Message                                                                                  │
│   ----     ------        ----                  ----                    -------                                                                                  │
│   Warning  FailedCreate  4m23s (x20 over 42m)  statefulset-controller  create Claim -druid-druid-staging-historicals-0 for Pod druid-druid-staging-historicals- │
│ 0 in StatefulSet druid-druid-staging-historicals failed error: PersistentVolumeClaim "-druid-druid-staging-historicals-0" is invalid: metadata.name: Invalid va │
│ lue: "-druid-druid-staging-historicals-0": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and en │
│ d with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Yes, can you try to run with this PR #321 change.
And update your crd definitions.

Patched CRD fixed it. Thanks!