kinoute commented on issue #2137:
URL: https://github.com/apache/kvrocks/issues/2137#issuecomment-1978888793

   Thanks for the quick answer @git-hulk ! I was able to fix it with your 
workaround. I needed to create an initContainer for this as mounting a secret 
as volume is now read-only since Kubernetes 1.9. 
   
   For those who are interested, here is a working manifest:
   
   ```yaml
   ---
   apiVersion: apps/v1
   kind: StatefulSet
   metadata:
     name: kvrocks
     namespace: sahar-svc
   spec:
     selector:
       matchLabels:
         run: kvrocks
     serviceName: "kvrocks"
     replicas: 1
     template:
       metadata:
         labels:
           app: kvrocks
           run: kvrocks
       spec:
         initContainers:
           - name: copy-kvrocks-conf
             image: busybox
             command: ["sh", "-c", "cp /tmp/kvrocks.conf /var/lib/kvrocks/"]
             volumeMounts:
               - name: kvrocks-config
                 mountPath: /tmp/kvrocks.conf
                 subPath: kvrocks.conf
               - name: kvrocks-folder
                 mountPath: /var/lib/kvrocks
         containers:
           - name: kvrocks
             image: apache/kvrocks:2.7.0
             volumeMounts:
               - name: kvrocks-folder
                 mountPath: /var/lib/kvrocks
               - name: kvrocks
                 mountPath: /data
             ports:
               - containerPort: 6379
             resources:
               requests:
                 cpu: 1
                 memory: 2Gi
               limits:
                 memory: 2Gi
         volumes:
           - name: kvrocks-folder
             emptyDir: {}
           - name: kvrocks
             persistentVolumeClaim:
               claimName: kvrocks
           - name: kvrocks-config
             secret:
               secretName: kvrocks-config
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to