使用 Helm 将 MariaDB 部署到我本地 Docker Desktop 集群上的集群,pod CrashLoopBackOff

问题描述 投票:0回答:0

我正在将 MariaDB 部署到我的 MacBook(M2 芯片)Docker 桌面集群。我的 MacBook 是 M2 芯片,是 ARM64 架构的 CPU,所以我使用了配套的Helm chart.

  1. 添加 helm 仓库
helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/
  1. 安装 MariaDB:
helm upgrade --install my-local-cluster groundhog2k/mariadb \
      --version 0.8.0 \
      --namespace mariadb \
      --set auth.rootPassword="my-root-pwd" \
      --set master.persistence.size=10Gi \
      --set auth.username="my-usr-name" \
      --set auth.password="my-pwd"

之后,我检查部署的 pod,我注意到 MariaDB pod 处于

CrashLoopBackOff
状态。

k describe pod <mariad db pod name>
显示以下信息:

Name:             mariadb-local-0
Namespace:        mariadb
Priority:         0
Service Account:  default
Node:             docker-desktop/192.168.65.4
Start Time:       Wed, 08 Mar 2023 23:57:53 +0200
Labels:           app.kubernetes.io/instance=mariadb-local
                  app.kubernetes.io/name=mariadb
                  controller-revision-hash=mariadb-local-7ff6bf79d4
                  statefulset.kubernetes.io/pod-name=mariadb-local-0
Annotations:      checksum/customconfig: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
                  checksum/customscripts: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
                  checksum/scripts: 671b226b2c464f6559c47550c781cec6fe270ace6b56430db7e2867584b8658a
                  checksum/secureconfig: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
Status:           Running
IP:               10.1.0.70
IPs:
  IP:           10.1.0.70
Controlled By:  StatefulSet/mariadb-local
Init Containers:
  mariadb-init:
    Container ID:  docker://41b3ed6d7875f2245c0515cfe8b255b11e9361a1a0f769a8134abf63d443f57c
    Image:         docker.io/mariadb:10.11.2
    Image ID:      docker-pullable://mariadb@sha256:ec97b993b11423a5b60448c85e01e3f696aaf6dfbf6f83c12d03bb02563f134e
    Port:          <none>
    Host Port:     <none>
    Command:
      /initscripts/init.sh
    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Wed, 08 Mar 2023 23:58:16 +0200
      Finished:     Wed, 08 Mar 2023 23:58:16 +0200
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /configs from configs (rw)
      /initscripts from initscripts (rw)
      /scripts from scripts (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-7gx5p (ro)
Containers:
  mariadb:
    Container ID:   docker://16e35d1eb9165dc36b9015c19ba57d3a18b8f9244aa495324a12db5d32ebb5eb
    Image:          docker.io/mariadb:10.11.2
    Image ID:       docker-pullable://mariadb@sha256:ec97b993b11423a5b60448c85e01e3f696aaf6dfbf6f83c12d03bb02563f134e
    Port:           3306/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Thu, 09 Mar 2023 14:10:57 +0200
      Finished:     Thu, 09 Mar 2023 14:10:57 +0200
    Ready:          False
    Restart Count:  85
    Liveness:       exec [bash -c mysqladmin status -uroot -p$MARIADB_ROOT_PASSWORD] delay=120s timeout=5s period=10s #success=1 #failure=3
    Readiness:      exec [bash -c mysqladmin status -uroot -p$MARIADB_ROOT_PASSWORD] delay=30s timeout=5s period=10s #success=1 #failure=3
    Startup:        exec [bash -c mysqladmin status -uroot -p$MARIADB_ROOT_PASSWORD] delay=10s timeout=5s period=10s #success=1 #failure=30
    Environment:    <none>
    Mounts:
      /docker-entrypoint-initdb.d from scripts (rw)
      /etc/mysql/conf.d from configs (rw)
      /tmp from tmp-volume (rw)
      /var/lib/mysql from db-volume (rw)
      /var/run/mysqld from tmp-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-7gx5p (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  tmp-volume:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  <unset>
  configs:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  <unset>
  scripts:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  <unset>
  initscripts:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      mariadb-local-scripts
    Optional:  false
  db-volume:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  <unset>
  kube-api-access-7gx5p:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
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  BackOff  4m3s (x1707 over 14h)  kubelet  Back-off restarting failed container

失败的原因是什么?

kubernetes mariadb kubernetes-helm
© www.soinside.com 2019 - 2024. All rights reserved.