分布部署 harbor 不能安装成功

  • Choerodon平台版本: 0.24.0

  • 遇到问题的执行步骤: 按照官方提供的分布安装。

  • 文档地址:

  • 环境信息(如:节点信息):

  • 报错日志:

Init Containers:
change-permission-of-directory:
Container ID: containerd://3d4e389f569e68fd69a6e73aaaeb7f73b247a6ed40810524060f291c355eb4be
Image: busybox:latest
Image ID: docker.io/library/busybox@sha256:e1488cb900233d035575f0a7787448cb1fa93bed0ccc0d4efc1963d7d72a8f17
Port:
Host Port:
Command:
/bin/sh
Args:
-c
chown -R 999:999 /var/lib/postgresql/data
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Error
Exit Code: 1
Started: Thu, 04 Feb 2021 14:50:15 +0800
Finished: Thu, 04 Feb 2021 14:50:15 +0800
Ready: False
Restart Count: 3
Environment:
Mounts:
/var/lib/postgresql/data from database-data (rw)
/var/run/secrets/kubernetes.io/serviceaccount from default-token-h9ctb (ro)

Containers:
database:
Container ID:
Image: goharbor/harbor-db:v1.9.3
Image ID:
Port:
Host Port:
State: Waiting
Reason: PodInitializing
Ready: False
Restart Count: 0
Liveness: exec [/docker-healthcheck.sh] delay=300s timeout=1s period=10s #success=1 #failure=3
Readiness: exec [/docker-healthcheck.sh] delay=1s timeout=1s period=10s #success=1 #failure=3
Environment Variables from:
harbor-harbor-database Secret Optional: false
Environment:
Mounts:
/var/lib/postgresql/data from database-data (rw)
/var/run/secrets/kubernetes.io/serviceaccount from default-token-h9ctb (ro)

Events:
Type Reason Age From Message


Warning FailedScheduling default-scheduler pod has unbound immediate PersistentVolumeClaims (repeated 4 times)
Warning FailedScheduling default-scheduler pod has unbound immediate PersistentVolumeClaims (repeated 4 times)
Normal Scheduled default-scheduler Successfully assigned c7n-system/harbor-harbor-database-0 to 172.16.103.34
Normal Pulling 72s kubelet, 172.16.103.34 Pulling image “busybox:latest”
Normal Pulled 63s kubelet, 172.16.103.34 Successfully pulled image “busybox:latest”
Normal Created 22s (x4 over 63s) kubelet, 172.16.103.34 Created container change-permission-of-directory
Normal Started 22s (x4 over 63s) kubelet, 172.16.103.34 Started container change-permission-of-directory
Normal Pulled 22s (x3 over 62s) kubelet, 172.16.103.34 Container image “busybox:latest” already present on machine
Warning BackOff 11s (x6 over 61s) kubelet, 172.16.103.34 Back-off restarting failed container

  • 原因分析:

    提出您分析问题的过程,以便我们能更准确的找到问题所在

  • 疑问:

    提出您对于遇到和解决该问题时的疑问

请看一下 pod 的日志。

kubectl logs harbor-harbor-database-0 -n c7n-system
Error from server (BadRequest): container “database” in pod “harbor-harbor-database-0” is waiting to start: PodInitializing

kubectl logs -n infrastructure harbor-harbor-database-0 -c change-permission-of-directory
kubectl logs -n infrastructure harbor-harbor-database-0 -c remove-lost-found

Error from server (NotFound): namespaces “infrastructure” not found

kubectl logs -n c7n-system harbor-harbor-database-0 -c change-permission-of-directory
chown: /var/lib/postgresql/data: Operation not permitted
chown: /var/lib/postgresql/data: Operation not permitted

kubectl logs -n c7n-system harbor-harbor-database-0 -c remove-lost-found
Error from server (BadRequest): container “remove-lost-found” in pod “harbor-harbor-database-0” is waiting to start: PodInitializing

我怀疑存储卷pvc有权限问题,/data1/ *(rw,sync,insecure,no_subtree_check,no_root_squash) 加了这个,第一步的没有了,第二个错误还是存在 remove-lost-found” in pod “harbor-harbor-database-0” is waiting to start: PodInitializing.

溜达一圈回来,已经自动起来了,谢谢。十分感谢您的耐心。