lolszowy commented on issue #121:
URL: https://github.com/apache/couchdb-helm/issues/121#issuecomment-1635592993

   problem is definitely with mounting pv.
   There is no problem with running CouchDB without PV. But even when I am 
trying to create a local pv it is crashing same way.
   
   
   ```
   apiVersion: apps/v1
   kind: StatefulSet
   metadata:
     name: couchdb-statefulset
   spec:
     selector:
       matchLabels:
         app: couchdb
     serviceName: couchdb-service
     replicas: 1
     template:
       metadata:
         labels:
           app: couchdb
       spec:
         containers:
           - name: couchdb
             image: couchdb:3.3.1
             ports:
               - containerPort: 5984
             volumeMounts:
               - name: couchdb-data
                 mountPath: /opt/couchdb/
         volumes:
           - name: couchdb-data
             persistentVolumeClaim:
               claimName: couchdb-pvc-local
   ---
   
   apiVersion: v1
   kind: PersistentVolumeClaim
   metadata:
     name: couchdb-pvc-local
   spec:
     storageClassName: local-storage
     accessModes:
       - ReadWriteOnce
     resources:
       requests:
         storage: 1Gi
   
   ---
   apiVersion: v1
   kind: PersistentVolume
   metadata:
     name: my-local-pv
   spec:
     capacity:
       storage: 10Gi
     volumeMode: Filesystem
     accessModes:
       - ReadWriteOnce
     storageClassName: local-storage
     local:
       path: /mnt 
     nodeAffinity:
       required:
         nodeSelectorTerms:
           - matchExpressions:
               - key: kubernetes.io/hostname
                 operator: In
                 values:
                   - ip-10-3-1-81.eu-west-1.compute.internal
                   - ip-10-3-2-247.eu-west-1.compute.internal 
   ---
   apiVersion: storage.k8s.io/v1
   kind: StorageClass
   metadata:
     name: local-storage
   provisioner: kubernetes.io/no-provisioner
   volumeBindingMode: WaitForFirstConsumer
   ```
   k describe pod couchdb-statefulset-0
   ```
   Events:
     Type     Reason            Age              From               Message
     ----     ------            ----             ----               -------
     Warning  FailedScheduling  8s               default-scheduler  0/3 nodes 
are available: persistentvolumeclaim "couchdb-pvc-local" not found. preemption: 
0/3 nodes are available: 3 No preemption victims found for incoming pod..
     Normal   Scheduled         5s               default-scheduler  
Successfully assigned tpos-sync/couchdb-statefulset-0 to 
ip-10-3-2-247.eu-west-1.compute.internal
     Normal   Pulled            3s (x2 over 4s)  kubelet            Container 
image "couchdb:3.3.1" already present on machine
     Normal   Created           3s (x2 over 4s)  kubelet            Created 
container couchdb
     Normal   Started           3s (x2 over 4s)  kubelet            Started 
container couchdb
     Warning  BackOff           2s               kubelet            Back-off 
restarting failed container couchdb in pod 
couchdb-statefulset-0_tpos-sync(92a8c35d-c8e1-4dee-b745-a8f4be50c106)
   ```
   
   
   
   


-- 
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