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

The customization of the storage size of the etcd lockserver doesn't work

Open PinZhang opened this issue 5 years ago • 2 comments
trafficstars

Added the following configuration to cell:

  cells:                                                                                                                                                       
  - name: samplecell                                                                                                                                        
    lockserver:                                                                                                                                                
      etcd:                                                                                                                                                    
        createClientService: true                                                                                                                              
        createPDB: true                                                                                                                                        
        createPeerService: true                                                                                                                                
        dataVolumeClaimTemplate:                                                                                                                               
          accessModes:                                                                                                                                         
          - ReadWriteOnce                                                                                                                                      
          dataSource: null                                                                                                                                     
          resources:                                                                                                                                           
            requests:                                                                                                                                          
              storage: 20Gi                                                                                                                                    
        image: quay.io/coreos/etcd:v3.3.13                                                                                                                     
        resources:                                                                                                                                             
          limits:                                                                                                                                              
            memory: 256Mi                                                                                                                                      
          requests:                                                                                                                                            
            cpu: 100m                                                                                                                                          
            memory: 256Mi

here is the generated EtcdLockServer crd printed by command kubectl get etcdlockservers --output yaml:

apiVersion: planetscale.com/v2                                                                                                                                 
kind: EtcdLockserver                                                                                                                                           
metadata:                                                                                                                                                                                                                                                                          
  ...                                                                                                                  
spec:                                                                                                                                                          
  createClientService: true                                                                                                                                    
  createPDB: true                                                                                                                                              
  createPeerService: true                                                                                                                                      
  dataVolumeClaimTemplate:                                                                                                                                     
    accessModes:                                                                                                                                               
    - ReadWriteOnce                                                                                                                                            
    dataSource: null                                                                                                                                           
    resources:                                                                                                                                                 
      requests:                                                                                                                                                
        storage: 20Gi                                                                                                                                          
  image: quay.io/coreos/etcd:v3.3.13                                                                                                                           
  resources:                                                                                                                                                   
    limits:                                                                                                                                                    
      memory: 256Mi                                                                                                                                            
    requests:                                                                                                                                                  
      cpu: 100m                                                                                                                                                
      memory: 256Mi

however the generated PVC spec still has a default storage size 1Gi:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  ...
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

PinZhang avatar Aug 12 '20 10:08 PinZhang

@PrismaPhonic

PinZhang avatar Aug 12 '20 10:08 PinZhang

I haven't been able to reproduce this. The storage request gets passed through correctly in my tests.

From your CRD sample, it looks like you're setting the storage size on a cell-local lockserver. Are you sure the PVC you're looking at is for etcd in that same cell? Are you setting the storage size on all cells and on the global lockserver as well?

enisoc avatar Sep 23 '20 21:09 enisoc