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

Getting 404 when running with KubernetesServiceDiscoveryProvider #251

Closed
Arik-Shapiro opened this issue Jan 19, 2023 · 0 comments
Closed
Assignees

Comments

@Arik-Shapiro
Copy link

Arik-Shapiro commented Jan 19, 2023

Describe the bug
A clear and concise description of what the bug is.
When running a local ocelot.json it's working perfectly.
With these settings:

{
	"Routes": [
		{
			"DownstreamPathTemplate": "/api/audit/{everything}",
			"DownstreamHostAndPorts": [
				{
					"Host": "localhost",
					"Port": 5135
				}
			],
			"UpstreamPathTemplate": "/api/audit/{everything}",
			"SwaggerKey": "audit"
		},
		{
			"DownstreamPathTemplate": "/api/audit",
			"DownstreamScheme": "http",
			"DownstreamHostAndPorts": [
				{
					"Host": "localhost",
					"Port": 5135
				}
			],
			"UpstreamPathTemplate": "/api/audit",
			"SwaggerKey": "audit"
		}
	],
	"SwaggerEndPoints": [
		{
			"Key": "audit",
			"Config": [
				{
					"Version": "v1",
					"Name": "Audit API",
					"Url": "http://localhost:5135/swagger/v1/swagger.json"
				}
			]
		}
	]
}

But when using these settings on kubernetes:

{
	"Routes": [
		{
			"DownstreamPathTemplate": "/api/audit/{everything}",
			"UpstreamPathTemplate": "/api/audit/{everything}",
			"ServiceName": "audit-service",
		},
		{
			"DownstreamPathTemplate": "/api/audit",
			"UpstreamPathTemplate": "/api/audit",
			"ServiceName": "audit-service",
			"SwaggerKey": "audit"
		}
	],
	"GlobalConfiguration": {
		"DownstreamScheme": "http"
	},
	"SwaggerEndPoints": [
		{
			"Key": "audit",
			"Config": [
				{
					"Name": "Audit API (API Gateway)",
					"Version": "v1",
					"Service": {
						"Name": "audit-service",
						"Path": "/swagger/v1/swagger.json"
					}
				}
			]
		}
	]
}

I'm getting 404 for /swagger/index.html
image

but when I actually route to /swagger/docs/v1/audit
I get the swagger.json file perfectly.

The routing works on kuberentes, also seems like getting the swagger.json file from downstream service.
For some reason the /swagger endpoint is still showing 404.

Expected behavior
Same as with the first settings file, swagger should work.

I would really appreciate some help, thanks!

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

No branches or pull requests

2 participants