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

With Ingress to reach the svc , the expose site report error /api/v1/login not found #8970

Closed
chenm0520 opened this issue Apr 26, 2024 · 4 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@chenm0520
Copy link

What happened?

I build a site for dashboard with a ingress yaml
`apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-k8s-chenm-xyz
namespace: kubernetes-dashboard
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
spec:
tls:
- hosts:
- k8s.local.xyz
secretName: k8s-chenm-xyz-ssl-tls
ingressClassName: nginx
rules:

  • host: k8s.local.xyz
    http:
    paths:
    - path: /
    pathType: Prefix
    backend:
    service:
    name: kubernetes-dashboard-web
    port:
    name: web
    - path: /api
    pathType: Prefix
    backend:
    service:
    name: kubernetes-dashboard-api
    port:
    name: api
    ` ,after applying it , I can vist the site with static page ,most APIs are inaccessible(the only accessible api I found is /api/v1/csrftoken/login)

What did you expect to happen?

full APIs are accessible and enter the site

How can we reproduce it (as minimally and precisely as possible)?

dashboard version lastest
install by
`# Add kubernetes-dashboard repository
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/

Deploy a Helm Release named "kubernetes-dashboard" using the kubernetes-dashboard chart

helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard`
apply the ingress yaml mentioned above;
the reporduce

Anything else we need to know?

No response

What browsers are you seeing the problem on?

Chrome

Kubernetes Dashboard version

lastest

Kubernetes version

1.30

Dev environment

No response

@chenm0520 chenm0520 added the kind/bug Categorizes issue or PR as related to a bug. label Apr 26, 2024
@floreks floreks added kind/support Categorizes issue or PR as a support question. and removed kind/bug Categorizes issue or PR as related to a bug. labels May 9, 2024
@floreks
Copy link
Member

floreks commented May 9, 2024

Use our embedded ingress and override its configuration via helm values. Your ingress is invalid and does not match our kong gateway configuration. It is a configuration issue on your side.

@chenm0520
Copy link
Author

Use our embedded ingress and override its configuration via helm values. Your ingress is invalid and does not match our kong gateway configuration. It is a configuration issue on your side.
ok, I get it,the route rules are encapsulated into the kong gateway ,I can access the dashboard with the ingress to kong-proxy,but this way the system's gateway rules could be redundant and I think the rule of the path to api/web is not complicated,but I can't find some document about it。where is the introduction about the part?

@floreks
Copy link
Member

floreks commented May 12, 2024

It is not documented because this is our internal configuration detail and is a subject to change in the future. If you would disable kong and use only ingress then any changes we make in kong gateway config will impact you and force you to update your config too.

You can see kong config here: https://github.com/kubernetes/dashboard/blob/master/hack%2Fgateway%2Fprod.kong.yml

@chenm0520
Copy link
Author

It is not documented because this is our internal configuration detail and is a subject to change in the future. If you would disable kong and use only ingress then any changes we make in kong gateway config will impact you and force you to update your config too.

You can see kong config here: https://github.com/kubernetes/dashboard/blob/master/hack%2Fgateway%2Fprod.kong.yml

thanks,I can now access the dashboard without kong ingress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

2 participants