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

[Bug]: sysctl: setting key "net.ipv4.conf.all.accept_source_route": Invalid argument and sysctl: setting key "net.ipv4.conf.all.promote_secondaries": Invalid argument during the hosts setup #343

Open
adrianolw opened this issue Jul 8, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@adrianolw
Copy link

Your Workstation

Windows (10 or 11)

System Memory

16GB or more

What happened?

Running the Vagrant up I got this messages:

    node02: net.ipv4.conf.default.accept_source_route = 0
    node02: sysctl: setting key "net.ipv4.conf.all.accept_source_route": Invalid argument
    node02: net.ipv4.conf.default.promote_secondaries = 1
    node02: sysctl: setting key "net.ipv4.conf.all.promote_secondaries": Invalid argument

I'm using the jammy64 version.
After finnish the lab, I run a nginx test deploy, pod, and installed a Nginx IngressController and tried to use with some pathprefix but nothing is working, and I discovered that my POD is not accessible from other hosts like controlplane or other node then the node that is running the pod.
I tested the WeaveNet and Flannel as well, but nothing changed.

vagrant@controlplane01:~$ k get pods -n teste-nginx -o wide
NAME                     READY   STATUS    RESTARTS   AGE   IP           NODE     NOMINATED NODE   READINESS GATES
deploy-576c6b7b6-smzgb   1/1     Running   0          21h   10.244.0.2   node01   <none>           <none>
vagrant@controlplane01:~$ 

Check the curl on controlplane:

vagrant@controlplane01:~$ curl -i http://10.244.0.2
curl: (28) Failed to connect to 10.244.0.2 port 80 after 130826 ms: Connection timed out

Test directly on node01

 vagrant@node01:~$ curl -i http://10.244.0.2
HTTP/1.1 200 OK
Server: nginx/1.27.0
Date: Sun, 07 Jul 2024 23:28:35 GMT
Content-Type: text/html
Content-Length: 615
Last-Modified: Tue, 28 May 2024 13:22:30 GMT
Connection: keep-alive
ETag: "6655da96-267"
Accept-Ranges: bytes

And of course with that my ingress rule is not working, I just got a 404 HTTP error.

I think that could be related to the two parameters that I mention on the subject, can someone help me ?

Relevant output

No response

@adrianolw adrianolw added the bug Something isn't working label Jul 8, 2024
@scottishwidow
Copy link

scottishwidow commented Sep 30, 2024

Changing to Bionic Beaver helped, though no idea how to fix it on Jammy.

@fireflycons
Copy link
Collaborator

Hi @adrianolw
curl -i http://10.244.0.2 is incorrect.

You are trying to access the pod network directly from the virtual machine. There is no route for that.

You should have either

  1. Create a nodeport service for the deployment and attempt to curl the nodeport on 127.0.0.1:<node port>
  2. Run another pod that has curl inside, do kubectl exec to that pod and run the above curl inside the test pod
  3. Use kubectl port-forward to the deployment's pod, and in another ssh shell, curl the forwarded port on 127.0.0.1:<forwarded port>

These techniques are all discussed in CKA course material.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants