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

[Web] Unable to get all cluster pods when using kube-scheduler-simulator to demonstrate the K8s scheduler in a real cluster #312

Closed
Lan-ce-lot opened this issue Jul 24, 2023 · 0 comments · Fixed by #313

Comments

@Lan-ce-lot
Copy link
Contributor

Description:

I am trying to integrate kube-scheduler-simulator with a real Kubernetes cluster.

Steps to Reproduce:

  1. Build the kube-scheduler-simulator frontend image using make docker_build_front.
  2. Configure apiserver with --cors-allowed-origins=http://*.
  3. Run kubectl proxy --port=3131 to serve the Kubernetes API on http://127.0.0.1:3131.
  4. Start the kube-scheduler-simulator frontend container using docker-compose up -d simulator-frontend.
    Issue a curl request to http://localhost:3131/api/v1/namespaces//pods.

Actual Behavior:
Pasted image 20230724154040
However, this is not a cross -domain problem.

Additional Information:

kube-apiserver version: v1.22.17
The API that should return all pods is accessed using api/v1/namespaces//pods. But:

$ curl http://localhost:3131/api/v1/namespaces//pods
<a href="/api/v1/namespaces/pods">Moved Permanently</a>.

I found api/v1/pods can do this well.

Solution:

Based on my understanding, the correct API to retrieve all pods is api/v1/pods instead of api/v1/namespaces//pods in some versions of Kube-Apiserver. It seems that the issue may be related to the incorrect API path being used.

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

Successfully merging a pull request may close this issue.

1 participant