使用KubeSphere的KubeKey 安裝K8s 集群過程中,碰到了一些問題,現在都一一解決了,以此記錄一下。
kubekey 安裝k8s 集群報錯 execute task timeout, Timeout=1m
error: Pipeline[CreateClusterPipeline] execute failed: Module[GreetingsModule] exec failed:
failed: [k8s-node1] execute task timeout, Timeout=1m
failed: [k8s-master] execute task timeout, Timeout=1m
- 檢查config-sample.yaml中各節點的SSH 賬號密碼是否錯誤
- 檢查你的網絡能否連的上k8s.io 的倉庫,如果連不上鏡像就會下載不了,也會超時
KubeSphere 應用商店部署應用錯誤
- nable to create directory to provision new pv: mkdir /persistentvolumes/itsaysay-mysql-pvc-36c035c0-ad9c-47c7-85c8-4789150ef3c6: read-only file system
Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"itsaysay", Name:"mysql", UID:"36c035c0-ad9c-47c7-85c8-4789150ef3c6", APIVersion:"v1", ResourceVersion:"209452", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "nfs-client": unable to create directory to provision new pv: mkdir /persistentvolumes/itsaysay-mysql-pvc-36c035c0-ad9c-47c7-85c8-4789150ef3c6: read-only file system
檢查NFS 是否配置了權限,/etc/exports,我這里忘記配置了(rw,sync,no_root_squash,no_subtree_check)
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/nfs/data 192.168.123.0/24(rw,sync,no_root_squash,no_subtree_check)
這里KubeSphere網站上給的(rw,sync,no_subtree_check),沒有no_root_squash,這就有一個坑
- 應用商店部署mysql,chown: changing ownership of ‘/var/lib/mysql/’: Operation not permitted
NFS的權限少no_root_squash,但說是這個有安全隱患,不建議在生產開啟。