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

No volume created after helm chart install results in pending pod #24628

Closed
sbamamoto opened this issue Mar 22, 2024 · 7 comments
Closed

No volume created after helm chart install results in pending pod #24628

sbamamoto opened this issue Mar 22, 2024 · 7 comments
Assignees
Labels
postgresql solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@sbamamoto
Copy link

sbamamoto commented Mar 22, 2024

Name and Version

Bitname/postgresql 15.1.2

What architecture are you using?

amd64

What steps will reproduce the bug?

I just used this command as listed in GitHub:
helm install my-release oci://registry-1.docker.io/bitnamicharts/postgresql

What is the expected behavior?

I expected that the pod would come up in status Running.

What do you see instead?

The pod stocks in status PENDING.

Additional information

The cluster has 3 nodes. Version of Kubernetes is 1.28.2, Debian Bookworm, Helm version 3.14.2.
kubectl describe pod my-release:

Name:             my-release-postgresql-0
Namespace:        default
Priority:         0
Service Account:  my-release-postgresql
Node:             <none>
Labels:           app.kubernetes.io/component=primary
                  app.kubernetes.io/instance=my-release
                  app.kubernetes.io/managed-by=Helm
                  app.kubernetes.io/name=postgresql
                  app.kubernetes.io/version=16.2.0
                  apps.kubernetes.io/pod-index=0
                  controller-revision-hash=my-release-postgresql-675d966d5d
                  helm.sh/chart=postgresql-15.1.2
                  statefulset.kubernetes.io/pod-name=my-release-postgresql-0
Annotations:      <none>
Status:           Pending
IP:               
IPs:              <none>
Controlled By:    StatefulSet/my-release-postgresql
Containers:
  postgresql:
    Image:           docker.io/bitnami/postgresql:16.2.0-debian-12-r8
    Port:            5432/TCP
    Host Port:       0/TCP
    SeccompProfile:  RuntimeDefault
    Limits:
      cpu:                150m
      ephemeral-storage:  1Gi
      memory:             192Mi
    Requests:
      cpu:                100m
      ephemeral-storage:  50Mi
      memory:             128Mi
    Liveness:             exec [/bin/sh -c exec pg_isready -U "postgres" -h 127.0.0.1 -p 5432] delay=30s timeout=5s period=10s #success=1 #failure=6
    Readiness:            exec [/bin/sh -c -e exec pg_isready -U "postgres" -h 127.0.0.1 -p 5432
[ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]
] delay=5s timeout=5s period=10s #success=1 #failure=6
    Environment:
      BITNAMI_DEBUG:                        false
      POSTGRESQL_PORT_NUMBER:               5432
      POSTGRESQL_VOLUME_DIR:                /bitnami/postgresql
      PGDATA:                               /bitnami/postgresql/data
      POSTGRES_PASSWORD:                    <set to the key 'postgres-password' in secret 'my-release-postgresql'>  Optional: false
      POSTGRESQL_ENABLE_LDAP:               no
      POSTGRESQL_ENABLE_TLS:                no
      POSTGRESQL_LOG_HOSTNAME:              false
      POSTGRESQL_LOG_CONNECTIONS:           false
      POSTGRESQL_LOG_DISCONNECTIONS:        false
      POSTGRESQL_PGAUDIT_LOG_CATALOG:       off
      POSTGRESQL_CLIENT_MIN_MESSAGES:       error
      POSTGRESQL_SHARED_PRELOAD_LIBRARIES:  pgaudit
    Mounts:
      /bitnami/postgresql from data (rw)
      /dev/shm from dshm (rw)
      /opt/bitnami/postgresql/conf from empty-dir (rw,path="app-conf-dir")
      /opt/bitnami/postgresql/logs from empty-dir (rw,path="app-logs-dir")
      /opt/bitnami/postgresql/tmp from empty-dir (rw,path="app-tmp-dir")
      /tmp from empty-dir (rw,path="tmp-dir")
Conditions:
  Type           Status
  PodScheduled   False 
Volumes:
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  data-my-release-postgresql-0
    ReadOnly:   false
  empty-dir:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  dshm:
    Type:        EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:      Memory
    SizeLimit:   <unset>
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  24m                  default-scheduler  0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling..
  Warning  FailedScheduling  9m15s (x3 over 19m)  default-scheduler  0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling..

kubectl get PVC:

NAME                           STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
data-my-release-postgresql-0   Pending    

kubectl describe pvc data-my-release-postgresql-0:
Name:          data-my-release-postgresql-0
Namespace:     default
StorageClass:  
Status:        Pending
Volume:        
Labels:        app.kubernetes.io/component=primary
               app.kubernetes.io/instance=my-release
               app.kubernetes.io/name=postgresql
Annotations:   <none>
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Used By:       my-release-postgresql-0
Events:
  Type    Reason         Age                  From                         Message
  ----    ------         ----                 ----                         -------
  Normal  FailedBinding  83s (x102 over 26m)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set

kubectl get pv:

No resources found

As I understand the GitHub page the used command should be sufficient to spin up the postgres db.

@sbamamoto sbamamoto added the tech-issues The user has a technical issue about an application label Mar 22, 2024
@github-actions github-actions bot added the triage Triage is needed label Mar 22, 2024
@carrodher
Copy link
Member

It seems an issue with the PVs in the nodes/cluster and not something related to the Helm chart itself.

Having said that, if you think that's not the case and are interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

If you have any questions about the application itself, customizing its content, or questions about technology and infrastructure usage, we highly recommend that you refer to the forums and user guides provided by the project responsible for the application or technology.

With that said, we'll keep this ticket open until the stale bot automatically closes it, in case someone from the community contributes valuable insights.

@sbamamoto
Copy link
Author

OK, maybe this is a documentation issue?

When reading the README.md I expected that installing the helm chart should be sufficient to run the database. It looks like the pod is expecting a PV.

Should the README.md contain a hint about the needed volume or a link to another documentation ?

@sbamamoto
Copy link
Author

sbamamoto commented Mar 29, 2024

Just for others trying to run this chart for the first time. You need to create the PVs before something is able to start. Change the following yaml to fit your needs and the Pods will start.

apiVersion: v1
kind: PersistentVolume
metadata:
  labels:
    synaptic-part: pgdata
  name: data-pgdata-postgresql-ha-postgresql-0
  annotations:
    pv.beta.kubernetes.io/gid: "1008"
spec:
  storageClassName: ""
  capacity:
    storage: 8Gi
  accessModes:
    - ReadWriteOnce
  nfs:
    path: /exports/data0
    server: nfs.acme.com
    readOnly: false
---
apiVersion: v1
kind: PersistentVolume
metadata:
  labels:
    synaptic-part: pgdata
  name: data-pgdata-postgresql-ha-postgresql-1
  annotations:
    pv.beta.kubernetes.io/gid: "1008"
spec:
  storageClassName: ""
  capacity:
    storage: 8Gi
  accessModes:
    - ReadWriteOnce
  nfs:
    path: /exports/data1
    server: nfs.acme.com
    readOnly: false
---
apiVersion: v1
kind: PersistentVolume
metadata:
  labels:
    synaptic-part: pgdata
  name: data-pgdata-postgresql-ha-postgresql-2
  annotations:
    pv.beta.kubernetes.io/gid: "1008"
spec:
  storageClassName: ""
  capacity:
    storage: 8Gi
  accessModes:
    - ReadWriteOnce
  nfs:
    path: /exports/data2
    server: nfs.acme.com
    readOnly: false
---

@carrodher
Copy link
Member

mmm I am not able to see why this is needed in your case, but the Helm chart should work fine out of the box.

@sbamamoto
Copy link
Author

sbamamoto commented Apr 2, 2024

When I create the volumes before installing the chart the pods start up after a while. If no volume was created, the pods stay in Pending state.

Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Apr 18, 2024
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postgresql solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

3 participants