bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.87k stars 9.16k forks source link

mariadb which services depend on causes CrashLoopBackOff on minikube #8712

Closed syjung6967 closed 2 years ago

syjung6967 commented 2 years ago

Which chart: Charts that depend on mariadb such as bitnami/mediawiki (13.0.1)

Describe the bug

I am trying to install both mediawiki and mariadb using bitnami/mediawiki chart on EC2 Ubuntu 20.04.3 LTS (ami-0454bb2fefc7de534) atop c5a.2xlarge instance. At first, I installed bitnami/mediawiki only adding namespace.

export KUBE_NAMESPACE="test-wiki"
helm install test-wiki bitnami/mediawiki \
  --create-namespace \
  --namespace ${KUBE_NAMESPACE}

Then I got following error.

NAME: test-wiki
LAST DEPLOYED: Wed Jan 19 04:34:42 2022
NAMESPACE: test-wiki
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: mediawiki
CHART VERSION: 13.0.1
APP VERSION: 1.37.1

** Please be patient while the chart is being deployed **###############################################################################
### ERROR: You did not provide an external host in your 'helm install' call ###
###############################################################################

This deployment will be incomplete until you configure Mediawiki with a resolvable
host. To configure Mediawiki with the URL of your service:

1. Get the Mediawiki URL by running:

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace test-wiki -w test-wiki-mediawiki'

  export APP_HOST=$(kubectl get svc --namespace test-wiki test-wiki-mediawiki --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
  export APP_PASSWORD=$(kubectl get secret --namespace test-wiki test-wiki-mediawiki -o jsonpath="{.data.mediawiki-password}" | base64 --decode)
  export MARIADB_ROOT_PASSWORD=$(kubectl get secret --namespace test-wiki test-wiki-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 --decode)
  export MARIADB_PASSWORD=$(kubectl get secret --namespace test-wiki test-wiki-mariadb -o jsonpath="{.data.mariadb-password}" | base64 --decode)

2. Complete your Mediawiki deployment by running:

  helm upgrade --namespace test-wiki test-wiki bitnami/mediawiki \
    --set mediawikiHost=$APP_HOST,mediawikiPassword=$APP_PASSWORD,mariadb.auth.rootPassword=$MARIADB_ROOT_PASSWORD,mariadb.auth.password=$MARIADB_PASSWORD

2. Get your MediaWiki login credentials by running:

    echo Username: user
    echo Password: $(kubectl get secret --namespace test-wiki test-wiki-mediawiki -o jsonpath="{.data.mediawiki-password}" | base64 --decode)
$ minikube kubectl -- get service -n ${KUBE_NAMESPACE}
NAME                  TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)       AGE
test-wiki-mariadb     ClusterIP      10.97.49.194   <none>        3306/TCP      2m16s
test-wiki-mediawiki   LoadBalancer   10.99.4.50     <pending>     80:7846/TCP   2m16s

$ minikube kubectl -- get pods -n ${KUBE_NAMESPACE}
NAME                  READY   STATUS             RESTARTS      AGE
test-wiki-mariadb-0   0/1     CrashLoopBackOff   4 (31s ago)   2m17s

$ minikube kubectl -- describe pod  test-wiki-mariadb -n ${KUBE_NAMESPACE}
Name:         test-wiki-mariadb-0
Namespace:    test-wiki
Priority:     0
Node:         ip-172-31-40-112/172.31.40.112
Start Time:   Wed, 19 Jan 2022 04:34:42 +0000
Labels:       app.kubernetes.io/component=primary
              app.kubernetes.io/instance=test-wiki
              app.kubernetes.io/managed-by=Helm
              app.kubernetes.io/name=mariadb
              controller-revision-hash=test-wiki-mariadb-8d4979dbc
              helm.sh/chart=mariadb-10.2.0
              statefulset.kubernetes.io/pod-name=test-wiki-mariadb-0
Annotations:  checksum/configuration: c5ed9f71e75ad7b9d1bf81c2001b7aa33bb9719424a1672bdf2ce12dbd725ffd
Status:       Running
IP:           172.17.0.3
IPs:
  IP:           172.17.0.3
Controlled By:  StatefulSet/test-wiki-mariadb
Containers:
  mariadb:
    Container ID:   docker://4488bad4d1cdaef0b51448f1be48ad59f08bd3278f7e87fa7e745a44d6e570e6
    Image:          docker.io/bitnami/mariadb:10.5.13-debian-10-r32
    Image ID:       docker-pullable://bitnami/mariadb@sha256:4969eda3a6cbb8007b4e52992979d9e1f1685cbed7c21afd2b44a64797c9e400
    Port:           3306/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Wed, 19 Jan 2022 04:40:41 +0000
      Finished:     Wed, 19 Jan 2022 04:40:44 +0000
    Ready:          False
    Restart Count:  6
    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 'test-wiki-mariadb'>  Optional: false
      MARIADB_USER:           bn_mediawiki
      MARIADB_PASSWORD:       <set to the key 'mariadb-password' in secret 'test-wiki-mariadb'>  Optional: false
      MARIADB_DATABASE:       bitnami_mediawiki
    Mounts:
      /bitnami/mariadb from data (rw)
      /opt/bitnami/mariadb/conf/my.cnf from config (rw,path="my.cnf")
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-test-wiki-mariadb-0
    ReadOnly:   false
  config:
    Type:        ConfigMap (a volume populated by a ConfigMap)
    Name:        test-wiki-mariadb
    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
  ----     ------     ----                 ----               -------
  Normal   Scheduled  11m                  default-scheduler  Successfully assigned test-wiki/test-wiki-mariadb-0 to ip-172-31-40-112
  Normal   Pulled     9m20s (x5 over 11m)  kubelet            Container image "docker.io/bitnami/mariadb:10.5.13-debian-10-r32" already 
present on machine
  Normal   Created    9m20s (x5 over 11m)  kubelet            Created container mariadb
  Normal   Started    9m20s (x5 over 11m)  kubelet            Started container mariadb
  Warning  BackOff    58s (x49 over 10m)   kubelet            Back-off restarting failed container

With or without the namespace, the above error rarely does not occur but unfortunately I do not know how to reproduce it. Also, even though mariadb becomes ready luckily, mediawiki service remains pending state. I executed the given commands in the error message and tried other older version charts but the problem still remains. (kubectl is aliased in .bashrc as alias kubectl='minikube kubectl --' command)

Furthermore, I checked other charts installing mariadb as dependency. Wordpress and Joomla offer their services with no error but owncloud remains pending state due to the above mariadb error.

To Reproduce

Docker, minikube, and helm are installed by following each own manual.

# Docker
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sh ./get-docker.sh
$ sudo usermod -aG docker $USER

# Minikube
$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
$ sudo install minikube-linux-amd64 /usr/local/bin/minikube
$ minikube start --driver=none # Or, --driver=docker
$ minikube kubectl -- get po -A
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   coredns-78fcd69978-fvgbh                   1/1     Running   0          14s
kube-system   etcd-ip-172-31-40-112                      1/1     Running   3          28s
kube-system   kube-apiserver-ip-172-31-40-112            1/1     Running   3          28s
kube-system   kube-controller-manager-ip-172-31-40-112   1/1     Running   3          28s
kube-system   kube-proxy-ttvbh                           1/1     Running   0          14s
kube-system   kube-scheduler-ip-172-31-40-112            1/1     Running   3          28s
kube-system   storage-provisioner                        1/1     Running   0          28s

# service/hello-minikube works well.

# Helm
$ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
$ helm repo add bitnami https://charts.bitnami.com/bitnami

# Install service (error occurs)
$ helm install test-wiki bitnami/mediawiki

Expected behavior

Run mariadb with no error so that main service like mediawiki works well.

Version info

$ minikube version
minikube version: v1.24.0
commit: 76b94fb3c4e8ac5062daf70d60cf03ddcc0a741b

$ docker version
Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:43:42 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

$ minikube kubectl -- version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3", GitCommit:"c92036820499fedefec0f847e2054d824aea6cd1", GitTreeS
tate:"clean", BuildDate:"2021-10-27T18:41:28Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3", GitCommit:"c92036820499fedefec0f847e2054d824aea6cd1", GitTreeS
tate:"clean", BuildDate:"2021-10-27T18:35:25Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"}
javsalgar commented 2 years ago

Hi

Please, note the Bitnami team is not actively monitoring GitHub Issues for this chart. This issue will stay open for 20 days to allow the community to contribute, after 15 days without activity the issue will be marked as stale being closed after 5 days. If you would like to contribute to this chart by fixing a bug or adding a new feature feel free to create a PR, the Bitnami team will be happy to review it and provide feedback.

github-actions[bot] commented 2 years ago

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[bot] commented 2 years ago

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.