Search code examples
wordpresskuberneteschartscloudbitnami

Problem with deployment bitnami/wordpress on kubernates


Welcome,

Im trying to install Wordpress on kubernetes. I installed chart and I typed: "helm install projectname-wordpress bitnami/wordpress --set allowOverrideNone=true"

but even it giving output its not working and I cant login into.

When I typed "kubectl describe pods"

I get output like this:

Name:           projectname-wordpress-785d4c4c84-xzt6m
Namespace:      default
Priority:       0
Node:           skalowalne-node-73a107/59.813.226.646
Start Time:     Fri, 28 May 2021 02:00:35 +0200
Labels:         app.kubernetes.io/instance=projectname-wordpress
                app.kubernetes.io/managed-by=Helm
                app.kubernetes.io/name=wordpress
                helm.sh/chart=wordpress-11.0.10
                pod-template-hash=785d4c4c84
Annotations:    <none>
Status:         Pending
IP:
IPs:            <none>
Controlled By:  ReplicaSet/projectname-wordpress-785d4c4c84
Containers:
  wordpress:
    Container ID:
    Image:          docker.io/bitnami/wordpress:5.7.2-debian-10-r9
    Image ID:
    Ports:          8080/TCP, 8443/TCP
    Host Ports:     0/TCP, 0/TCP
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Requests:
      cpu:      300m
      memory:   512Mi
    Liveness:   http-get http://:http/wp-admin/install.php delay=120s timeout=5s period=10s #success=1 #failure=6
    Readiness:  http-get http://:http/wp-login.php delay=30s timeout=5s period=10s #success=1 #failure=6
    Environment:
      ALLOW_EMPTY_PASSWORD:                   yes
      MARIADB_HOST:                           projectname-wordpress-mariadb
      MARIADB_PORT_NUMBER:                    3306
      WORDPRESS_DATABASE_NAME:                bitnami_wordpress
      WORDPRESS_DATABASE_USER:                bn_wordpress
      WORDPRESS_DATABASE_PASSWORD:            <set to the key 'mariadb-password' in secret 'projectname-wordpress-mariadb'>  Optional: false
      WORDPRESS_USERNAME:                     user
      WORDPRESS_PASSWORD:                     <set to the key 'wordpress-password' in secret 'projectname-wordpress'>  Optional: false
      WORDPRESS_EMAIL:                        [email protected]
      WORDPRESS_FIRST_NAME:                   FirstName
      WORDPRESS_LAST_NAME:                    LastName
      WORDPRESS_HTACCESS_OVERRIDE_NONE:       no
      WORDPRESS_ENABLE_HTACCESS_PERSISTENCE:  no
      WORDPRESS_BLOG_NAME:                    User's Blog!
      WORDPRESS_SKIP_BOOTSTRAP:               no
      WORDPRESS_TABLE_PREFIX:                 wp_
      WORDPRESS_SCHEME:                       http
      WORDPRESS_EXTRA_WP_CONFIG_CONTENT:
      WORDPRESS_AUTO_UPDATE_LEVEL:            none
      WORDPRESS_PLUGINS:                      none
    Mounts:
      /bitnami/wordpress from wordpress-data (rw,path="wordpress")
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-mxtw7 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  wordpress-data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  projectname-wordpress
    ReadOnly:   false
  default-token-mxtw7:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-mxtw7
    Optional:    false
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  FailedMount         15m (x181 over 9h)    kubelet                  Unable to attach or mount volumes: unmounted volumes=[wordpress-data], unattached volumes=[wordpress-data default-token-mxtw7]: timed out waiting for the condition
  Warning  FailedMount         3m49s (x58 over 8h)   kubelet                  Unable to attach or mount volumes: unmounted volumes=[wordpress-data], unattached volumes=[default-token-mxtw7 wordpress-data]: timed out waiting for the condition
  Warning  FailedAttachVolume  2m40s (x139 over 9h)  attachdetach-controller  AttachVolume.Attach failed for volume "ovh-managed-kubernetes-do2ymc-pvc-80079ec2-e6f9-4210-852e-04fa286f714c" : attachdetachment timeout for volume 3b160677-40e8-4170-9cc3-cdd58e230942


Name:           projectname-wordpress-mariadb-0
Namespace:      default
Priority:       0
Node:           skalowalne-node-f1da93/59.83.226.180
Start Time:     Fri, 28 May 2021 02:00:27 +0200
Labels:         app.kubernetes.io/component=primary
                app.kubernetes.io/instance=projectname-wordpress
                app.kubernetes.io/managed-by=Helm
                app.kubernetes.io/name=mariadb
                controller-revision-hash=projectname-wordpress-mariadb-85d4cb8f7
                helm.sh/chart=mariadb-9.3.11
                statefulset.kubernetes.io/pod-name=projectname-wordpress-mariadb-0
Annotations:    checksum/configuration: 878384c0d68b5abc46d5d5d719a9e83aa911941710552c3dfcebd48203ce5d9f
Status:         Pending
IP:
IPs:            <none>
Controlled By:  StatefulSet/projectname-wordpress-mariadb
Containers:
  mariadb:
    Container ID:
    Image:          docker.io/bitnami/mariadb:10.5.10-debian-10-r0
    Image ID:
    Port:           3306/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Liveness:       exec [/bin/bash -ec password_aux="${MARIADB_ROOT_PASSWORD:-}"
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
    password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
fi
mysqladmin status -uroot -p"${password_aux}"
] delay=120s timeout=1s period=10s #success=1 #failure=3
    Readiness:  exec [/bin/bash -ec password_aux="${MARIADB_ROOT_PASSWORD:-}"
if [[ -f "${MARIADB_ROOT_PASSWORD_FILE:-}" ]]; then
    password_aux=$(cat "$MARIADB_ROOT_PASSWORD_FILE")
fi
mysqladmin status -uroot -p"${password_aux}"
] delay=30s timeout=1s period=10s #success=1 #failure=3
    Environment:
      BITNAMI_DEBUG:          false
      MARIADB_ROOT_PASSWORD:  <set to the key 'mariadb-root-password' in secret 'projectname-wordpress-mariadb'>  Optional: false
      MARIADB_USER:           bn_wordpress
      MARIADB_PASSWORD:       <set to the key 'mariadb-password' in secret 'projectname-wordpress-mariadb'>  Optional: false
      MARIADB_DATABASE:       bitnami_wordpress
    Mounts:
      /bitnami/mariadb from data (rw)
      /opt/bitnami/mariadb/conf/my.cnf from config (rw,path="my.cnf")
      /var/run/secrets/kubernetes.io/serviceaccount from projectname-wordpress-mariadb-token-92mm2 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  data-projectname-wordpress-mariadb-0
    ReadOnly:   false
  config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      projectname-wordpress-mariadb
    Optional:  false
  projectname-wordpress-mariadb-token-92mm2:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  projectname-wordpress-mariadb-token-92mm2
    Optional:    false
QoS Class:       BestEffort
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  FailedMount         19m (x41 over 8h)     kubelet                  Unable to attach or mount volumes: unmounted volumes=[data], unattached volumes=[config projectname-wordpress-mariadb-token-92mm2 data]: timed out waiting for the condition
  Warning  FailedMount         9m51s (x36 over 8h)   kubelet                  Unable to attach or mount volumes: unmounted volumes=[data], unattached volumes=[projectname-wordpress-mariadb-token-92mm2 data config]: timed out waiting for the condition
  Warning  FailedMount         5m21s (x161 over 9h)  kubelet                  Unable to attach or mount volumes: unmounted volumes=[data], unattached volumes=[data config projectname-wordpress-mariadb-token-92mm2]: timed out waiting for the condition
  Warning  FailedAttachVolume  2m48s (x139 over 9h)  attachdetach-controller  AttachVolume.Attach failed for volume "ovh-managed-kubernetes-do2ymc-pvc-fad9b535-f6d5-4e71-9e47-3a555936c546" : attachdetachment timeout for volume d96dbb2d-2200-48bd-940d-74dc0c3b5128

UPDATE: I dont have firewall enabled on cloud machine. Im using ovh services.

What should I do to make it working?

Failed events looks exacly like this just after try to deploy wordpress:

    Events:
  Type     Reason              Age                  From                     Message
  ----     ------              ----                 ----                     -------
  Warning  FailedScheduling    5m19s                default-scheduler        0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims.
  Warning  FailedScheduling    5m19s                default-scheduler        0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims.
  Normal   Scheduled           5m12s                default-scheduler        Successfully assigned default/projectname-wordpress-5466b7b45c-rzx9h to standard-node-fe7236
  Warning  FailedMount         3m10s                kubelet                  Unable to attach or mount volumes: unmounted volumes=[wordpress-data], unattached volumes=[default-token-mxtw7 wordpress-data]: timed out waiting for the condition
  Warning  FailedAttachVolume  72s (x2 over 3m13s)  attachdetach-controller  AttachVolume.Attach failed for volume "ovh-managed-kubernetes-do2ymc-pvc-3e3686eb-6cf5-4697-99b0-0689bbd7d0a9" : attachdetachment timeout for volume f8b78a8d-f0d8-4dcb-bcae-ec84fb7d82e4
  Warning  FailedMount         56s                  kubelet                  Unable to attach or mount volumes: unmounted volumes=[wordpress-data], unattached volumes=[wordpress-data default-token-mxtw7]: timed out waiting for the condition

Logs from first pod

mariadb 16:49:02.01 mariadb 16:49:02.01 Welcome to the Bitnami mariadb container mariadb 16:49:02.01 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mariadb mariadb 16:49:02.02 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mariadb/issues mariadb 16:49:02.02 Send us your feedback at [email protected] mariadb 16:49:02.02 mariadb 16:49:02.02 INFO ==> ** Starting MariaDB setup ** mariadb 16:49:02.07 INFO ==> Validating settings in MYSQL_/MARIADB_ env vars mariadb 16:49:02.07 INFO ==> Initializing mariadb database mariadb 16:49:02.09 INFO ==> Using persisted data mariadb 16:49:02.10 INFO ==> Running mysql_upgrade mariadb 16:49:02.10 INFO ==> Starting mariadb in background mariadb 16:49:03.14 INFO ==> Stopping mariadb

Logs from second pod

Welcome to the Bitnami wordpress container Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-wordpress Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-wordpress/issues Send us your feedback at [email protected]

WARN ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment. nami INFO Initializing apache nami INFO apache successfully initialized nami INFO Initializing php nami INFO php successfully initialized nami INFO Initializing mysql-client nami INFO mysql-client successfully initialized nami INFO Initializing wordpress wordpre INFO ==> Preparing Varnish environment wordpre INFO ==> Preparing Apache environment wordpre INFO ==> Preparing PHP environment mysql-c INFO Trying to connect to MySQL server Error executing 'postInstallation': Failed to connect to student-mariadb:3306 after 36 tries


Solution

  • I reset kubernates and same code started to work. I made everything same so I dont know how. Thank you guys for support.