Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not start Kubernetes core components #144

Open
kamal2222ahmed opened this issue May 2, 2019 · 9 comments
Open

Could not start Kubernetes core components #144

kamal2222ahmed opened this issue May 2, 2019 · 9 comments

Comments

@kamal2222ahmed
Copy link

upon running the shell script: ./hack/setup-vms

I get error:

TASK [k8s-setup : Wait for Kubernetes core component start] ********************
Thursday 02 May 2019  14:12:40 -0400 (0:00:00.353)       0:03:15.687 **********
failed: [192.168.1.10] (item=6443) => {"changed": false, "elapsed": 300, "item": 6443, "msg": "Timeout when waiting for 127.0.0.1:6443"}```

PLAY RECAP *********************************************************************
192.168.1.10 : ok=140 changed=77 unreachable=0 failed=1
192.168.1.12 : ok=28 changed=19 unreachable=0 failed=0
192.168.1.13 : ok=28 changed=19 unreachable=0 failed=0

Thursday 02 May 2019 14:19:43 -0400 (0:07:03.147) 0:10:18.835 **********

k8s-setup : Wait for Kubernetes core component start ------------------ 423.15s
download/package : Downloading kubelet file ---------------------------- 81.90s
download/package : Downloading kubectl file ---------------------------- 28.81s
download/package : Downloading docker file ----------------------------- 15.01s
download/package : Downloading cni file --------------------------------- 4.37s
download/package : Downloading cfssl file ------------------------------- 4.25s
download/package : Extract docker file ---------------------------------- 3.69s
download/package : Downloading etcd file -------------------------------- 3.27s
cert : Generate Kubernetes SSL certificate json files ------------------- 2.05s
cert : Create Kubernetes SSL certificate key files ---------------------- 1.82s
common/copy-files : Write the content of files -------------------------- 1.67s
k8s-setup : Copy Kubernetes manifest and config files into cluster ------ 1.49s
cert : Delete unnecessary Kubernetes files ------------------------------ 1.48s
download/package : Downloading cfssljson file --------------------------- 1.43s
common/copy-files : Check the files already exists ---------------------- 1.41s
common/copy-files : Read the config files ------------------------------- 1.28s
download/package : Extract cni file ------------------------------------- 1.24s
download/package : Symlinks docker to /usr/local/bin -------------------- 1.16s
download/package : Extract etcd file ------------------------------------ 0.99s
etcd : Enable and restart etcd ------------------------------------------ 0.93s
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
==> k8s-n3: The previous process exited with exit code 1.
==> k8s-n2: The previous process exited with exit code 1.
==> k8s-n1: The previous process exited with exit code 1.
==> k8s-m1: The previous process exited with exit code 1.

@kamal2222ahmed
Copy link
Author

and after I login to k8s-m1:

vagrant@k8s-m1:~$ kubectl -n kube-system create sa dashboard
The connection to the server localhost:8080 was refused - did you specify the right host or port?
vagrant@k8s-m1:~$ kubectl create clusterrolebinding dashboard --clusterrole cluster-admin --serviceaccount=kube-system:dashboard
The connection to the server localhost:8080 was refused - did you specify the right host or port?

@kamal2222ahmed
Copy link
Author

If I am outside the corporate VPN:

TASK [k8s-addon : Copy metric-server addon template files] *********************
Thursday 02 May 2019  15:06:41 -0400 (0:00:00.067)       0:00:06.167 **********
changed: [192.168.1.10 -> 192.168.1.10] => (item=metric-server/metric-server-sa.yml)
changed: [192.168.1.10 -> 192.168.1.10] => (item=metric-server/metrics-server-rbac.yml)
changed: [192.168.1.10 -> 192.168.1.10] => (item=metric-server/metrics-apiservice.yml)
changed: [192.168.1.10 -> 192.168.1.10] => (item=metric-server/metrics-server-svc.yml)
changed: [192.168.1.10 -> 192.168.1.10] => (item=metric-server/metrics-server-dp.yml)

TASK [k8s-addon : Apply metric-server addon files] *****************************
Thursday 02 May 2019  15:06:43 -0400 (0:00:02.095)       0:00:08.263 **********
changed: [192.168.1.10 -> 192.168.1.10] => (item=metric-server)

PLAY RECAP *********************************************************************
192.168.1.10               : ok=8    changed=6    unreachable=0    failed=0

Thursday 02 May 2019  15:06:45 -0400 (0:00:02.169)       0:00:10.432 **********
===============================================================================
k8s-addon : Copy kubernetes-dashboard addon template files -------------- 2.40s
k8s-addon : Apply metric-server addon files ----------------------------- 2.17s
k8s-addon : Copy metric-server addon template files --------------------- 2.10s
k8s-addon : Apply kubernetes-dashboard addon files ---------------------- 0.68s
k8s-addon : Ensure kubernetes-dashboard addons directory exists --------- 0.30s
k8s-addon : Ensure metric-server addons directory exists ---------------- 0.30s
k8s-addon : Copy prometheus-monitoring addon template files ------------- 0.23s
k8s-addon : Check metric-server addon dependencies status --------------- 0.14s
k8s-addon : Copy prometheus-monitoring addon files ---------------------- 0.11s
k8s-addon : Ensure prometheus-monitoring addons directory exists -------- 0.10s
k8s-addon : Copy prometheus-monitoring addon template dependencies ------ 0.10s
k8s-addon : Copy kube-logging addon template files ---------------------- 0.10s
k8s-addon : Apply prometheus-monitoring addon dependencies -------------- 0.08s
k8s-addon : Ensure kube-logging addons directory exists ----------------- 0.08s
k8s-addon : Apply prometheus-monitoring addon files --------------------- 0.08s
k8s-addon : Copy ingress-nginx addon template files --------------------- 0.08s
k8s-addon : Check prometheus-monitoring addon dependencies status ------- 0.08s
k8s-addon : Copy kubernetes-dashboard addon files ----------------------- 0.07s
k8s-addon : Copy metric-server addon files ------------------------------ 0.07s
k8s-addon : Check kubernetes-dashboard addon dependencies status -------- 0.07s
(base) ✔ ~/KUBERNETES/KUBEANSIBLE/kube-ansible [master|✚ 6…2]
15:06 $

@kamal2222ahmed
Copy link
Author

"Wait for Kubernetes core component start" is in roles/k8s-setup/tasks/main.yml

- name: Wait for Kubernetes core component start
  when: node_role == 'master'
  wait_for:
    host: "127.0.0.1"
    port: "{{ item }}"
    delay: 1
    connect_timeout: 60
    timeout: 300

where would I make the change to get rid of the "Timeout when waiting for 127.0.0.1:6443"

@kamal2222ahmed
Copy link
Author

and now:

vagrant@k8s-m1:~$ kubectl cluster-info

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server localhost:8080 was refused - did you specify the right host or port?

@kamal2222ahmed
Copy link
Author

$ kubectl --server=10.0.2.15:8080 get pod -o wide
The connection to the server 10.0.2.15:8080 was refused - did you specify the right host or port?

@kairen
Copy link
Owner

kairen commented May 3, 2019

@kamal2222ahmed Thank you for your report, I'll check it from upstream.

@kairen
Copy link
Owner

kairen commented May 3, 2019

@kamal2222ahmed If you are facing that connection was refused, you can check the kubeconfig is exist in $HOME/.kube/config. I think you need to change the system user as root.

@kamal2222ahmed
Copy link
Author

outside the corporate network, I am getting:

root@k8s-m1:~# kubectl -n kube-system get po,svc
NAME                                       READY   STATUS              RESTARTS   AGE
pod/calico-node-j72hr                      2/2     Running             0          19m
pod/calico-node-jmd4q                      0/2     Pending             0          18m
pod/calico-node-s7n4s                      2/2     Running             0          19m
pod/coredns-896d9f87d-qp8fr                0/1     ContainerCreating   0          20m
pod/coredns-autoscaler-58784cd54d-f6sx4    0/1     ContainerCreating   0          20m
pod/kube-apiserver-k8s-m1                  1/1     Running             0          19m
pod/kube-controller-manager-k8s-m1         1/1     Running             0          20m
pod/kube-haproxy-k8s-m1                    1/1     Running             0          20m
pod/kube-keepalived-k8s-m1                 1/1     Running             0          19m
pod/kube-proxy-dcjvk                       1/1     Running             0          18m
pod/kube-proxy-pww6d                       1/1     Running             0          18m
pod/kube-proxy-zzbr5                       1/1     Running             0          18m
pod/kube-scheduler-k8s-m1                  1/1     Running             0          20m
pod/kubernetes-dashboard-57df4db6b-9fgnd   0/1     ContainerCreating   0          18m
pod/metrics-server-68d85f76bb-wx6xr        1/1     Running             0          18m

NAME                           TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
service/calico-typha           ClusterIP   10.105.202.213   <none>        5473/TCP                 19m
service/kube-dns               ClusterIP   10.96.0.10       <none>        53/UDP,53/TCP,9153/TCP   20m
service/kubernetes-dashboard   ClusterIP   10.108.118.11    <none>        443/TCP                  18m
service/metrics-server         ClusterIP   10.107.142.19    <none>        443/TCP                  18m

@MrRightSol
Copy link

"Wait for Kubernetes core component start" is in roles/k8s-setup/tasks/main.yml

- name: Wait for Kubernetes core component start
  when: node_role == 'master'
  wait_for:
    host: "127.0.0.1"
    port: "{{ item }}"
    delay: 1
    connect_timeout: 60
    timeout: 300

where would I make the change to get rid of the "Timeout when waiting for 127.0.0.1:6443"

Did you managed to get pass from this error? What is the fix? Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants