XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    kubectl cluster-info Fails on kubernetes recipe

    Scheduled Pinned Locked Moved Xen Orchestra
    9 Posts 3 Posters 1.1k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      Pearcekieser
      last edited by

      I installed a kubernetes cluster with the XOA recipe. 1 master and 4 nodes, put them on an active network adapter, and ran the recipe.

      When I ssh into the master and run kubectl cluster-info I get:

      The connection to the server 192.168.200.146:6443 was refused - did you specify the right host or port?
      

      Running kubectl version:

      Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.3", GitCommit:"06ad960bfd03b39c8310aaf92d1e7c12ce618213", GitTreeState:"clean", BuildDate:"2020-02-11T18:14:22Z", GoVersion:"go1.13.6", Compiler:"gc", Platform:"linux/amd64"}
      The connection to the server 192.168.200.146:6443 was refused - did you specify the right host or port?
      

      I am very new to kubernetes, so I might be missing something ovi, but it seems like the servers are not starting up on these machines. I was hoping to use this recipe to build a simple cluster that I can like my gitlab instance into. To get a picture of what I was planning to do, the gitlab guide is here: https://docs.gitlab.com/ee/user/project/clusters/add_remove_clusters.html.

      I'd appreciate any advice you have on how to get this working. Or alternatives to the XOA recipe for simple kubernetes setup

      Thanks!

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Are you sure your VMs can communicate each other?

        P 1 Reply Last reply Reply Quote 0
        • olivierlambertO Offline
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by

          Ping @BenjiReis who'll check if it's still working in our lab.

          1 Reply Last reply Reply Quote 0
          • P Offline
            Pearcekieser @olivierlambert
            last edited by Pearcekieser

            192.168.200.146 is the ipaddr of that master node that I had ssh'ed into.

            All nodes are able to ping the master. And the mastercan ping itself at the 192.168.200.146

            Thanks for your help!

            1 Reply Last reply Reply Quote 0
            • BenjiReisB Offline
              BenjiReis Vates 🪐 XCP-ng Team
              last edited by

              Hi!

              Just tried it and it went fine. Have you seen any errors in XO when creating the cluster?
              Did you use the user debian to ssh?

              Does the issue happen on every VM of your cluster?

              Does your network allow traffic on port 6443?

              1 Reply Last reply Reply Quote 0
              • P Offline
                Pearcekieser
                last edited by

                Hi thanks for the reply,

                No new entries on my logs (xoa -> settings -> logs).

                I was using the debian user to ssh in.

                Looking over all the machines, I get these errors or simular on master, node 1, and node 2. The node errors are connect to localhost:8080 rather than 192.168.200.146:6443 interestingly, it looks like neither node 3 or 4 got an ip addr on my network. So I am guessing this is an issue that happened as I was deploying the recipe. I am going to try redeploying the recipe. And potentially switch to using a xcp-ng virtual network with dhcp to try to get this to work. I wanted to keep these on my 192.168.200.1/24 net to make it easier to ssh in.

                I made 2 debian cloud init machines from hub templates and tested network connection on port 6443 using netcat. That worked.

                I ran nmap -p- 192.168.200.146 (all ports) against the host machine and got:

                Starting Nmap 7.70 ( https://nmap.org ) at 2020-02-22 18:09 EST
                Nmap scan report for 192.168.200.146
                Host is up (0.045s latency).
                Not shown: 65531 closed ports
                PORT      STATE SERVICE
                22/tcp    open  ssh
                10250/tcp open  unknown
                10251/tcp open  unknown
                10252/tcp open  apollo-relay
                
                Nmap done: 1 IP address (1 host up) scanned in 26.49 seconds
                

                Indicating that the 6443 port was not open for tcp.

                1 Reply Last reply Reply Quote 0
                • P Offline
                  Pearcekieser
                  last edited by

                  Rebuilding the recipe worked. But I am continuing to face networking issues with CNI. I will debug those on my own!

                  Thank you so much for the help and for the great product!

                  I'm sure you all are very busy, but maybe consider adding a guide along with this recipe. Something that would walk a new user through setup up to having Helm Tiller installed (a popular tool for installing and managing Kubernetes applications). As someone who is new to Kubernetes, (and I think new folks will be the most helped by this recipe), the recipe left me with more questions than answers.

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    Pearcekieser
                    last edited by

                    One issue I did run into was the nodes created by the recipe would try to access the master using the hostname "master". I had to manually specify this on my local DNS.

                    How do you do networking for your test install? Should I set these onto a private XCP-ng managed network and use a bastion VM to SSH in, rather than having them flat on the same network as my workstation?

                    Thanks!

                    1 Reply Last reply Reply Quote 0
                    • BenjiReisB Offline
                      BenjiReis Vates 🪐 XCP-ng Team
                      last edited by

                      Hello,

                      The DNS names of the master (and nodes also with a pattern) should be configurable for the user indeed. We'll add it in a next version of the recipe.

                      Thanks for the feedback!

                      1 Reply Last reply Reply Quote 1
                      • First post
                        Last post