Score:0

Kubernetes error "Unable to attach or mount volumes"

tl flag

I deployed bitnami/wordpress helm using nginx ingress as loadbalancer like here. Everything working fine but problem is with some pods when they are created manually or automaticly by autoscaling. Some of them (not all) have all time "ContainerCreating" status and logs look like this:

  Normal   Scheduled    33m                  default-scheduler  Successfully assigned default/wordpress-69c8f65d96-wnkfv to main-node-d29388
  Warning  FailedMount  4m28s (x6 over 29m)  kubelet            Unable to attach or mount volumes: unmounted volumes=[wordpress-data], unattached volumes=[default-token-s4gdj wordpress-data]: timed out waiting for the condition
  Warning  FailedMount  0s (x9 over 31m)     kubelet            Unable to attach or mount volumes: unmounted volumes=[wordpress-data], unattached volumes=[wordpress-data default-token-s4gdj]: timed out waiting for the condition

I deployed bitnami/wordpress and then upgraded using this settings:

helm install wordpress bitnami/wordpress --set service.type=ClusterIP --set ingress.enabled=true --set ingress.certManager=true --set ingress.annotations."kubernetes\.io/ingress\.class"=nginx --set ingress.annotations."cert-manager\.io/cluster-issuer"=letsencrypt-prod --set ingress.hostname=DOMAIN.com --set ingress.extraTls[0].hosts[0]=DOMAIN.com --set ingress.extraTls[0].secretName=wordpress.local-tls --set wordpressPassword=PASSWORD --set autoscaling.enabled=true --set autoscaling.minReplicas=1 autoscaling.maxReplicas=30

kubectl get pods looks like this

ingress-nginx-ingress-controller-84bff86888-f4tpb                 1/1     Running             0          2d3h
ingress-nginx-ingress-controller-default-backend-c5b786dbbqw5xz   1/1     Running             0          2d3h
load-generator                                                    1/1     Running             0          71s
wordpress-69c8f65d96-48jd9                                        0/1     ContainerCreating   0          18m
wordpress-69c8f65d96-66ftt                                        0/1     ContainerCreating   0          56m
wordpress-69c8f65d96-dq7xq                                        1/1     Running             0          100m
wordpress-69c8f65d96-fbnt6                                        1/1     Running             0          101m
wordpress-69c8f65d96-wnkfv                                        0/1     ContainerCreating   0          56m
wordpress-mariadb-0                                               1/1     Running             0          8h

What to do to not have this problem with new pods and to make them starting?

Juan avatar
sj flag
You need ReadWriteMany volumes in order to scale the solution as it's mentioned in the Prerequisites section, see https://github.com/bitnami/charts/tree/master/bitnami/wordpress#prerequisites This blog post can help you with this: https://engineering.bitnami.com/articles/scaling-wordpress-in-kubernetes.html
Don Don Don avatar
tl flag
@Juan thank you. Do you know what cloud providier have ReadWriteMany possibility?
Score:0
tl flag

User @Juan was right. I did it similary method, I created other POD using helm that was creating storage and I setted it in wordpress deployment as persistance. Here Its described: https://docs.bitnami.com/tutorials/deploy-applications-nfs-kubernetes/

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.