KubeKey安装KubeSphere、部署应用实践问题总结
使用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,但说是这个有安全隐患,不建议在生产开启。