Welcome to the Linux Foundation Forum!

GCE worker node not working after a day

Hi, I have setup both master and worker nodes in GCE as per the initial setup details and with class resources (k8sMaster.sh and K8sSecond.sh). After this I used to kubeadm join command from master node output to join worker node to the cluster.

It works fine for a day and if I reconnect to worker node (using putty) after that and try to execute any kubectl command like get pods, I keep getting below error.
"The connection to the server localhost:8080 was refused - did you specify the right host or port?"

Has any one else faced this issue and know how to resolve this? I tried 2 times setting up entire thing again from scratch but still this problem resurfaces after a day or two.

Best Answer

  • chrispokorni
    chrispokorni Posts: 2,315
    Answer ✓

    Hi @tlf4pundari,

    The lab exercise only configures kubectl to work from the master/ckad-1 node, and not from the worker/ckad-2 node.
    Did you find in the lab any step where a successful kubectl command was issued from the worker/ckad-2 node?

    Regards,
    -Chris

Answers

  • Hi chrispokorni,

    Thank you for the clarification. I was doing it in incorrect terminal of worker node instead of master node.

    Regards,
    Pundari

  • nkerr
    nkerr Posts: 10
    edited May 2021

    @chrispokorni
    unless I'm mistaken, Lab 7.1 problem 9 requires this?
    Step 8 required curl to the ClusterIP (10.109.134.221) which is different from the following. Not sure how this is executed unless with kubectl on worker node to discover this elusive alternative IP as shown below.

    9. Test access from an external node to the host IP and the high container port. Your IP and port will be different. It shouldwork, even with the network policy in place, as the traffic is arriving via a 192.168.0.0 port.
    user@laptop: ̃/Desktop$ curl http://35.184.219.5:32000
  • chrispokorni
    chrispokorni Posts: 2,315

    Hi @nkerr,

    If you look closely at Step 7, that is where you uncover the value of the ClusterIP address of the secondapp Service resource, the one specific to your cluster, which will be different than the one presented in the lab guide. So in Step 8 you are expected to curl the ClusterIP extracted in Step 7, and then in Step 9 you wold curl the public IP of one of your hosts/nodes paired with port 32000, and again, your public IP will be different than the one presented in the lab guide.

    Regards,
    -Chris

  • nkerr
    nkerr Posts: 10

    Thanks Chris

Categories

Upcoming Training