From d1bbe9a5012b5395d4d9e988503c149f22716f0f Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Thu, 4 Nov 2021 16:04:17 +0800
Subject: [PATCH 05/12] wait task longer and modify eggops docs

Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
 docs/eggops.md                                 | 18 +++++++++++++++++-
 .../binary/etcdcluster/etcdjoin.go             |  2 +-
 yaml/cluster.yaml                              |  1 +
 yaml/machines.yaml                             |  2 ++
 4 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/docs/eggops.md b/docs/eggops.md
index 075b5a5..7dea94c 100644
--- a/docs/eggops.md
+++ b/docs/eggops.md
@@ -82,7 +82,7 @@ $ tree /data
 
 1 directory, 2 files
 
-# 安装 nfs 与 rpc 相关软件包：
+# 在nfs server机器上安装 nfs 与 rpc 相关软件包：
 $ yum install nfs-utils rpcbind -y
 
 # NFS默认的配置文件是 /etc/exports，修改配置文件
@@ -98,6 +98,9 @@ success
 $ firewall-cmd  --reload 
 success
 
+# 在所有的worker节点上安装nfs-utils，详情见常见问题1
+$ yum install nfs-utils -y
+
 # 查看NFS分享的资源
 $ showmount -e <nfs ip>
 Export list for <nfs ip>:
@@ -214,6 +217,7 @@ apiVersion: eggo.isula.org/v1
 kind: Machine
 metadata:
   name: machine1-example
+  namespace: eggo-system
   labels:
     masterRole: allow
     workerRole: allow
@@ -376,3 +380,15 @@ kubectl delete -f cluster.yaml --wait=false
 $ export KUBECONFIG=/etc/kubernetes/admin.conf
 $ kubectl delete -f eggops.yaml
 ```
+
+### 常见问题
+
+1. pod一直ContainerCreating
+
+创建cluster时，发现cluster-example-create-job的pod一直处于ContainerCreating状态，describe该pod状态，发现报错
+```
+Mounting arguments: -t nfs -o ro 192.168.223.236:/data /var/lib/kubelet/pods/8becdc2f-a31a-4cab-8a3b-2f3e705cac92/volumes/kubernetes.io~nfs/nfs-pv-example
+Output: mount: /var/lib/kubelet/pods/8becdc2f-a31a-4cab-8a3b-2f3e705cac92/volumes/kubernetes.io~nfs/nfs-pv-example: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
+```
+
+原因是因为pod所在的host机器上没有nfs-utils软件包，将该软件包在pod所在的宿主机上安装即可解决此问题
diff --git a/pkg/clusterdeployment/binary/etcdcluster/etcdjoin.go b/pkg/clusterdeployment/binary/etcdcluster/etcdjoin.go
index 07b9d7b..97be436 100644
--- a/pkg/clusterdeployment/binary/etcdcluster/etcdjoin.go
+++ b/pkg/clusterdeployment/binary/etcdcluster/etcdjoin.go
@@ -48,7 +48,7 @@ func AddMember(conf *api.ClusterConfig, hostconfig *api.HostConfig) error {
 		return fmt.Errorf("run task on nodes failed: %v", err)
 	}
 
-	if err := nodemanager.WaitNodesFinish([]string{hostconfig.Address}, time.Minute); err != nil {
+	if err := nodemanager.WaitNodesFinish([]string{hostconfig.Address}, 5*time.Minute); err != nil {
 		return fmt.Errorf("wait for post deploy etcds task finish failed: %v", err)
 	}
 
diff --git a/yaml/cluster.yaml b/yaml/cluster.yaml
index 6af86f3..cf883c1 100644
--- a/yaml/cluster.yaml
+++ b/yaml/cluster.yaml
@@ -18,3 +18,4 @@ spec:
     name: infrastructure-example
   # 启用kubelet serving证书
   enableKubeletServing: true
+  eggoImageVersion: "hub.oepkgs.net/haozi007/eggo:1.0.0-alpha"
diff --git a/yaml/machines.yaml b/yaml/machines.yaml
index d9fe575..bc19743 100644
--- a/yaml/machines.yaml
+++ b/yaml/machines.yaml
@@ -4,6 +4,7 @@ apiVersion: eggo.isula.org/v1
 kind: Machine
 metadata:
   name: machine1-example
+  namespace: eggo-system
   labels:
     masterRole: allow
     workerRole: allow
@@ -19,6 +20,7 @@ apiVersion: eggo.isula.org/v1
 kind: Machine
 metadata:
   name: machine2-example
+  namespace: eggo-system
   labels:
     masterRole: allow
     workerRole: allow
-- 
2.25.1

