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

dwthyt8l  于 2023-03-30  发布在  Docker
关注(0)|答案(1)|浏览(162)

我正在将MariaDB部署到我的MacBook(M2芯片)Docker Desktop集群。我的MacBook是M2芯片,是ARM64架构CPU,所以我使用了匹配的Helm chart
1.添加helm repo

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

失败的原因可能是什么?

ljo96ir5

ljo96ir51#

我看了一下MongoDB的值 指定的仓库。
有些配置,你设置从命令行,我不认为工作;例如,“auth.rootPassword”应该是“settings.rootPassword”。
始终关注.yaml值,如果可能的话,使用该文件的克隆,以便将所有配置作为代码保存。
https://github.com/groundhog2k/helm-charts/blob/master/charts/mariadb/values.yaml

相关问题