kubernetes-sigs / cluster-api-provider-ibmcloud

Cluster API Provider for IBM Cloud
https://cluster-api-ibmcloud.sigs.k8s.io
Apache License 2.0
62 stars 82 forks source link

Echo error messages but cluster is created #213

Closed wanghh2000 closed 5 years ago

wanghh2000 commented 5 years ago

/kind bug /sig ibmcloud

What steps did you take and what happened: Follow the steps to creating a cluster. Every thing is fine but there are error messages.

root@gummite1:/gopath/src/sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/clusterctl# ./clusterctl create cluster --bootstrap-type kind --provider ibmcloud -c examples/ibmcloud/out1/cluster.yaml -m examples/ibmcloud/out1/machines.yaml -p examples/ibmcloud/out1/provider-components.yaml
I0531 01:46:38.182209    8380 createbootstrapcluster.go:27] Creating bootstrap cluster
I0531 01:47:07.143740    8380 clusterdeployer.go:78] Applying Cluster API stack to bootstrap cluster
I0531 01:47:07.143776    8380 applyclusterapicomponents.go:26] Applying Cluster API Provider Components
I0531 01:47:08.031095    8380 clusterdeployer.go:83] Provisioning target cluster via bootstrap cluster
I0531 01:47:08.042713    8380 applycluster.go:36] Creating cluster object test1 in namespace "default"
I0531 01:47:08.052113    8380 clusterdeployer.go:92] Creating control plane  in namespace "default"
I0531 01:47:08.057515    8380 applymachines.go:36] Creating machines in namespace "default"
I0531 01:50:18.086150    8380 clusterdeployer.go:97] Updating bootstrap cluster object for cluster test1 in namespace "default" with control plane endpoint running on
I0531 01:50:18.093845    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
I0531 01:50:18.100183    8380 clusterdeployer.go:102] Creating target cluster
I0531 01:50:18.106002    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
E0531 01:50:19.708618    8380 util.go:178] error executing command "ssh -i /root/.ssh/id_ibmcloud -o StrictHostKeyChecking no -o UserKnownHostsFile /dev/null -o BatchMode=yes root@198.11.242.106 echo STARTFILE; sudo cat /etc/kubernetes/admin.conf": exit status 1
I0531 01:50:29.715803    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
E0531 01:50:31.231943    8380 util.go:178] error executing command "ssh -i /root/.ssh/id_ibmcloud -o StrictHostKeyChecking no -o UserKnownHostsFile /dev/null -o BatchMode=yes root@198.11.242.106 echo STARTFILE; sudo cat /etc/kubernetes/admin.conf": exit status 1
I0531 01:50:39.719315    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
E0531 01:50:41.154002    8380 util.go:178] error executing command "ssh -i /root/.ssh/id_ibmcloud -o StrictHostKeyChecking no -o UserKnownHostsFile /dev/null -o BatchMode=yes root@198.11.242.106 echo STARTFILE; sudo cat /etc/kubernetes/admin.conf": exit status 1
I0531 01:50:49.716186    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
E0531 01:50:51.543612    8380 util.go:178] error executing command "ssh -i /root/.ssh/id_ibmcloud -o StrictHostKeyChecking no -o UserKnownHostsFile /dev/null -o BatchMode=yes root@198.11.242.106 echo STARTFILE; sudo cat /etc/kubernetes/admin.conf": exit status 1
I0531 01:50:59.715321    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
E0531 01:51:00.933598    8380 util.go:178] error executing command "ssh -i /root/.ssh/id_ibmcloud -o StrictHostKeyChecking no -o UserKnownHostsFile /dev/null -o BatchMode=yes root@198.11.242.106 echo STARTFILE; sudo cat /etc/kubernetes/admin.conf": exit status 1
I0531 01:51:09.715356    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
E0531 01:51:10.956896    8380 util.go:178] error executing command "ssh -i /root/.ssh/id_ibmcloud -o StrictHostKeyChecking no -o UserKnownHostsFile /dev/null -o BatchMode=yes root@198.11.242.106 echo STARTFILE; sudo cat /etc/kubernetes/admin.conf": exit status 1
I0531 01:51:19.717563    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
I0531 01:51:20.932988    8380 clusterdeployer.go:120] Pivoting Cluster API stack to target cluster
I0531 01:51:20.933059    8380 pivot.go:67] Applying Cluster API Provider Components to Target Cluster
I0531 01:51:26.555868    8380 pivot.go:72] Pivoting Cluster API objects from bootstrap to target cluster.
I0531 01:51:35.120807    8380 clusterdeployer.go:125] Saving provider components to the target cluster
I0531 01:51:35.504239    8380 clusterdeployer.go:133] Updating target cluster object with control plane endpoint running on
I0531 01:51:35.576101    8380 deployer.go:51] Returning IP from machine annotation 198.11.242.106
I0531 01:51:35.646388    8380 clusterdeployer.go:149] Creating node machines in target cluster.
I0531 01:51:35.682618    8380 applymachines.go:36] Creating machines in namespace "default"
I0531 01:54:35.807158    8380 clusterdeployer.go:154] Done provisioning cluster. You can now access your cluster with kubectl --kubeconfig kubeconfig
I0531 01:54:35.807830    8380 createbootstrapcluster.go:36] Cleaning up bootstrap cluster.
root@gummite1:/gopath/src/sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/clusterctl# kubectl --kubeconfig=kubeconfig get clusters
NAME    AGE
test1   10m
root@gummite1:/gopath/src/sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/clusterctl# kubectl --kubeconfig=kubeconfig get pod --all-namespaces
NAMESPACE                  NAME                                                READY   STATUS    RESTARTS   AGE
ibmcloud-provider-system   clusterapi-controller-0                             1/1     Running   0          10m
kube-system                calico-node-6zsxp                                   1/1     Running   0          10m
kube-system                calico-node-jxq2c                                   0/1     Running   5          6m2s
kube-system                coredns-fb8b8dccf-mk6t6                             1/1     Running   0          10m
kube-system                coredns-fb8b8dccf-n5kzj                             1/1     Running   0          10m
kube-system                etcd-whh-ibmcloud-master-7htqt                      1/1     Running   0          9m27s
kube-system                kube-apiserver-whh-ibmcloud-master-7htqt            1/1     Running   0          9m12s
kube-system                kube-controller-manager-whh-ibmcloud-master-7htqt   1/1     Running   0          9m16s
kube-system                kube-proxy-2dbs2                                    1/1     Running   0          6m2s
kube-system                kube-proxy-g5bbn                                    1/1     Running   0          10m
kube-system                kube-scheduler-whh-ibmcloud-master-7htqt            1/1     Running   0          9m28s
system                     controller-manager-0                                1/1     Running   0          10m

What did you expect to happen: No error message.

Anything else you would like to add:

Environment:

jichenjc commented 5 years ago

where's error message? you mean the Exxx logs ? please make sure you didn't change the logic before you make any changes...

FYI https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/pull/208

wanghh2000 commented 5 years ago

@jichenjc Thanks for your comments and response. No any code change or others, it is the latest code.

xunpan commented 5 years ago

@wanghh2000

  1. it has 2 issues
    • the message Returning IP from machine annotation should not be default log level
    • the error message should not be ouput here. It is not error but detection process. It is error log in cluster-api. Please @wanghh2000 help to log it in cluster-api community to see their response.
  2. 208 is different from this one. It is for controller but this is for command line.

wanghh2000 commented 5 years ago

@xunpan OK, let me check the message again and log a issue to trace.

jichenjc commented 5 years ago

for #208 case, I mean it's not an error, it's actually something like periodic check...so the errors above apply for same reason, I think make them from Error to Info will be a good approach in cluster-api or at least provide some flag to https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/master/pkg/cloud/ibmcloud/deployer.go#L79 utils.ExecCommand to optionally not using Error log

wanghh2000 commented 5 years ago

Trace the message issue. https://github.com/kubernetes-sigs/cluster-api/issues/979

jichenjc commented 5 years ago

https://github.com/kubernetes-sigs/cluster-api/issues/974

wanghh2000 commented 5 years ago

Close this and we can discuss in #216