Skip to content

staging/redis-svix: Remove useless configmap and add externalConfig parameter

Guillaume Samson requested to merge redis-svix into master

Related to swh/infra/sysadm-environment#5105 (closed)

Apply configuration with kubectl and helm is not the same.
The former modifications have no effect on staging cluster:

~ ᐅ kbs describe redis redis-svix -n svix-server | grep redisConfig
~ ᐅ kbs exec redis-svix-0 -n svix-server -- bash -c "cat /etc/redis/redis.conf ; ls -trl /etc/redis "
Defaulted container "redis-svix" out of: redis-svix, redis-exporter
bind 0.0.0.0 ::
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize no
supervised no
pidfile /var/run/redis.pid
protected-mode no
save 900 1
save 300 10
save 60 10000
appendonly yes
appendfilename "appendonly.aof"
dir /data
total 1
-rwxr-xr-x    1 redis    redis          226 Oct 31 09:58 redis.conf

Here are the parameters useful with helm:
https://github.com/OT-CONTAINER-KIT/helm-charts/blob/main/charts/redis/values.yaml

I check with helm template:

ᐅ helm template -f myvalues.yaml redis-svix ot-helm/redis                                                                                                                         
---                                            
# Source: redis/templates/extra-config.yaml   
apiVersion: v1
kind: ConfigMap         
metadata:                                
  name: redis-svix-ext-config      
  labels:                             
    app.kubernetes.io/name: redis-svix
    helm.sh/chart: redis-0.15.7       
    app.kubernetes.io/managed-by: Helm    
    app.kubernetes.io/instance: redis-svix
    app.kubernetes.io/version: 0.15.0      
    app.kubernetes.io/component: middleware
data:                                                        
  redis-additional.conf: |                      
                        
    save 60 500                           
    appendonly yes                                 
    appendfsync everysec                     
---                                                          
# Source: redis/templates/redis-standalone.yaml
apiVersion: redis.redis.opstreelabs.in/v1beta1
kind: Redis                              
metadata:                          
  name: redis-svix                           
  labels:                           
    app.kubernetes.io/name: redis-svix
    helm.sh/chart: redis-0.15.7           
    app.kubernetes.io/managed-by: Helm  
    app.kubernetes.io/instance: redis-svix 
    app.kubernetes.io/version: 0.15.0 
    app.kubernetes.io/component: middleware
spec:                                 
  redisConfig:                            
    additionalRedisConfig: redis-svix-ext-config
  redisExporter:                           
    enabled: true
    image: "quay.io/opstree/redis-exporter:v1.44.0"          
    imagePullPolicy: "IfNotPresent"
    resources:        
      {}                          
  kubernetesConfig:   
    image: "quay.io/opstree/redis:v7.0.5"    
    imagePullPolicy: "IfNotPresent" 
    resources:                                                        
      {}                                                              
  storage:                                                            
    volumeClaimTemplate:                                              
      spec:                                                           
        accessModes:                                                  
        - ReadWriteOnce                                                                    
        resources:                                                                         
          requests:                                                                        
            storage: 1Gi                                                                   
        storageClassName: local-persistent                                                 
  priorityClassName: "swh-storages"                                                        
  nodeSelector:                                                                            
    kubernetes.io/hostname: rancher-node-staging-rke2-worker2                              
  podSecurityContext:                                                                      
    fsGroup: 1000                                                                          
    runAsUser: 1000                                                                        
---                                                                                        
# Source: redis/templates/servicemonitor.yaml                                              
apiVersion: monitoring.coreos.com/v1                                                       
kind: ServiceMonitor                                                                       
metadata:                                                                                  
  name: redis-svix-prometheus-monitoring                                                   
  labels:                                                                                  
    app.kubernetes.io/name: redis-svix                                                                    
    helm.sh/chart: redis-0.15.7                                                                           
    app.kubernetes.io/managed-by: Helm                                                                    
    app.kubernetes.io/instance: redis-svix                                                                
    app.kubernetes.io/version: 0.15.0                                                                     
    app.kubernetes.io/component: middleware                                                               
spec:                                                                                                     
  selector:                                                                                               
    matchLabels:                                                                                          
      app: redis-svix                                                                                     
      redis_setup_type: standalone                                                                        
      role: standalone                                                                                    
  endpoints:                                                                                              
  - port: redis-exporter                                                                                  
    interval: 30s                                                                                         
    scrapeTimeout: 10s                                                                                    
  namespaceSelector:                                                                                      
    matchNames:                                                                                           
    - svix-server

Merge request reports