Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] KubeBlocks: 0.9.2 无法正常创建redis 集群,命令中以指定storage-class-name ,但是pvc 还是提示未指定 #8810

Closed
grassroadsZ opened this issue Jan 15, 2025 · 3 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@grassroadsZ
Copy link

[root@ecs-9473 shell]# kbcli version
Kubernetes: v1.30.4-r4-30.0.14.11
KubeBlocks: 0.9.2
kbcli: 0.9.2

[root@ecs-9473 shell]# kubectl get sc|grep nfs-rw
nfs-rw               flexvolume-huawei.com/fuxinfs   Delete          Immediate              true                   44h
[root@ecs-9473 shell]# cat redis.sh 
kbcli cluster create redis  myredis --mode=replication --cpu=1 --memory=1 --replicas=2  --sentinel.storage=5  --storage-class-name='nfs-rw'   -n agent

[root@ecs-9473 shell]# kubectl describe pvc data-myredis-redis-sentinel-0 -n agent
Name:          data-myredis-redis-sentinel-0
Namespace:     agent
StorageClass:  
Status:        Pending
Volume:        
Labels:        app.kubernetes.io/component=redis-sentinel-7
               app.kubernetes.io/instance=myredis
               app.kubernetes.io/managed-by=kubeblocks
               app.kubernetes.io/name=redis-sentinel-7
               app.kubernetes.io/version=redis-sentinel-7
               apps.kubeblocks.io/cluster-uid=ee401232-9e7e-4d41-be3f-e135a702649c
               apps.kubeblocks.io/component-name=redis-sentinel
               apps.kubeblocks.io/vct-name=data
               clusterdefinition.kubeblocks.io/name=redis
               clusterversion.kubeblocks.io/name=
               componentdefinition.kubeblocks.io/name=redis-sentinel-7
               helm.sh/chart=redis-cluster-0.9.0
               workloads.kubeblocks.io/instance=myredis-redis-sentinel
               workloads.kubeblocks.io/managed-by=InstanceSet
Annotations:   <none>
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Used By:       myredis-redis-sentinel-0
Events:
  Type    Reason         Age                 From                         Message
  ----    ------         ----                ----                         -------
  Normal  FailedBinding  13s (x62 over 15m)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set

[root@ecs-9473 shell]# kubectl get pv |grep redis
nfs-redis-pv-0   5Gi        RWO            Retain           Available                                nfs-rw         <unset>                          33m
nfs-redis-pv-1   5Gi        RWO            Retain           Available                                nfs-rw         <unset>                          33m
nfs-redis-pv-2   5Gi        RWO            Retain           Available                                nfs-rw         <unset>                          33m
@grassroadsZ grassroadsZ added the kind/bug Something isn't working label Jan 15, 2025
@wangyelei
Copy link
Contributor

@yipeng1030 PTAL.

@wangyelei
Copy link
Contributor

wangyelei commented Jan 15, 2025

pls edit the cluster yaml to set the SC name for component redis-sentinel

kubectl edit cluster myredis

or set thenfs-rw sc as default.

@shanshanying
Copy link
Contributor

By checking the code , we found sentinal does not recognize the given storage class name. We will fix.

  volumeClaimTemplates:
    - name: data
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: {{ print .Values.sentinel.storage "Gi" }}

For now, you may
Option 1. create redis with '--edit' option
e.g.

kbcli cluster create redis  myredis --mode=replication --cpu=1 --memory=1 --replicas=2  --sentinel.storage=5  -n agent --edit

and set storage class name for each component.

Optoin 2. as suggested by @wangyelei , you may set nfs-rw as default sc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants