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

eventcatalog on kubernetes #988

Open
remcocats opened this issue Dec 4, 2024 · 6 comments
Open

eventcatalog on kubernetes #988

remcocats opened this issue Dec 4, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@remcocats
Copy link

I tried this:

In run event catalog on kubernetes, in the container we use port 5080 because we can't deploy containers with port 80. Because of some hardening. I have configured in the configuration port: 80. And I configured in de service layer kubernetes port 80 to 5080.

This happened:

When I run the application de links in the webpage all are rewrite to 5080 and not 80. So all the links are broken.

I expected this:

When I set the port in de config to 80 that the url rewrite is set to 80 so that everything works. Or that when I use '/' that it uses soft links.

Is there a workaround?

I have tried many things but none of them helps like in the ingress nginx.ingress.kubernetes.io/rewrite-target.

Anything else?

No response

EventCatalog Version

2.14.3

Node.js Version

20.17

Platform(s)

Linux

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@remcocats remcocats added the bug Something isn't working label Dec 4, 2024
@boyney123
Copy link
Collaborator

We have a group of folks from OSO creating a HELM chart for this, would that help at all?

I'm no expert in Kubernetes deployments, so let me know if I can help in anyway?

Can you share how I can replicate locally?

@msfci
Copy link

msfci commented Dec 12, 2024

Are you using nginx to serve the site?
and if yes can u share the try_files line in your configuration?

@remcocats
Copy link
Author

I use

location / {
  root /usr/share/nginx/html;
include /etc/nginx/mime.types;
}

@msfci
Copy link

msfci commented Dec 16, 2024

I use the below, if you check the try_files part normally it's like this try_files $uri $uri/ /index.html =404; but as astro build is different it builds folders for each part of the app and inside it there is index.html the try files for astro it modified to try_files $uri $uri/index.html =404;,
another thing is that nginx behaves like this:

  • if it finds file it serve it
  • if directory, it do redirection and by default nginx put port in redirection that why I putport_in_redirect off; , when port is put it fails to reach the service in kubernetes.

`server {
listen 8080 default_server;
server_name _;

port_in_redirect off;

location / {
  root   /usr/share/nginx/html;
  index  index.html index.htm;
  try_files $uri $uri/index.html =404;
}

error_page   500 502 503 504  /50x.html;
error_page 404 /404.html;
location = /404.html {
  root /usr/share/nginx/html;
  internal;
}

location = /50x.html {
  root   /usr/share/nginx/html;
}

}`

Please try these config.

@remcocats
Copy link
Author

I will give it a try thanks

@hartmanjan1970
Copy link

We ( @remcocats ) got it working with the following nginx default.conf .
Hope it will help others.
Thanks for the support @msfci & @boyney123

server {
    # Hide nginx version information.
    server_tokens off;

    listen  5080 default_server;
    server_name _;
    port_in_redirect off;

    location / {
      root   /usr/share/nginx/html;
      include /etc/nginx/mime.types;
      index  index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    error_page 404 /404.html;

    location = /404.html {
      root /usr/share/nginx/html;
      internal;
    }

    location = /50x.html {
      root   /usr/share/nginx/html;
    }

    gzip            on;
    gzip_vary       on;
    gzip_http_version  1.0;
    gzip_comp_level 5;
    gzip_types
    application/atom+xml
    application/javascript
    application/json
    application/rss+xml
    application/vnd.ms-fontobject
    application/x-font-ttf
    application/x-web-app-manifest+json
    application/xhtml+xml
    application/xml
    font/opentype
    image/svg+xml
    image/x-icon
    text/css
    text/plain
    text/x-component;
    gzip_proxied no-cache no-store private expired auth;
    gzip_min_length 256;
    gunzip          on;
}

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

4 participants