stafftastic / jitsu-chart

13 stars 7 forks source link

p.js is not available #7

Closed hendrikheil closed 7 months ago

hendrikheil commented 7 months ago

Currently, jitsu displays the tracking script to be hosted at "Ingress Domain"/p.js, however that route is not actually available and returns a 404.

I'm not 100% sure which container handles the script generation, but I assume we just need to route that endpoint correctly.

We don't use that script anyway, but it might be useful for others working with this chart.

dlbone commented 6 months ago

hi @hendrikheil, I have your chart up and running using: helm install jitsu oci://registry-1.docker.io/stafftasticcharts/jitsu

I can access the console and log in. I am having this not accessible p.js issue. If i try to access my jitsu.example.com/p.js but it redirects to a sign in page

dlbone commented 6 months ago

nevermind im dumb, i had to expose the ingest service separately from the console service, do you reverse proxy both ports to the same subdomain? or should i be exposing a different service in the cluster

hendrikheil commented 6 months ago

The chart offers two modes of operation. By default it configures a single ingress that sets up one domain for everything and forwards the traffic based on the request path. If you configure the host to be jitsu.example.com (I would not recommend using jitsu in the hostname, as adblockers are likely to block those requests), both ingestion and console traffic is hosted under that domain.

You can disable the default ingress configuration through ingress.enable=false and selectively enable the individual services' ingress manually. I would recommend you consult the respective manifests if you decide to that route. I think for most deployments the default ingress configuration should be plenty.

If you feel like the docs could be improved, feel free to contribute clarifications through a PR :) If you have an even more custom need, please open a fresh issue with a description of what you need and why

dlbone commented 6 months ago

Thank you, that makes sense and thank you so much for setting up this chart, huge boon to me. It's my first time using Kubernetes of any sort (familiar with Docker), so will keep tinkering and get a better understanding of it and helm and all.

If I figure it out I'll do a PR that might help others for your docs (unless it's just "learn Kubernetes and read through the project") and if I don't I may ask again in a more clear way in the future if that's alright.

dlbone commented 6 months ago

@hendrikheil sorry to bother again, I'm using a very basic set up, here is my helm install:

helm install jitsu oci://registry-1.docker.io/stafftasticcharts/jitsu -f-<<EOF
ingress:
  enabled: true
  className: "nginx"
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt"
  host: "jitsu.mywebsite.io"
  tls: true
console:
  config:
    seedUserEmail: "me@example.com"
    seedUserPassword: "changeMe"
  ingress:
    enabled: true
    className: 'nginx'
    hosts:
      - host: jitsu.mywebsite.io
        paths:
          - path: /
            pathType: Prefix
EOF

I'm then using kubectl port forwarding to expose the console

kubectl port-forward svc/jitsu-console 3000:3000
Forwarding from 127.0.0.1:3000 -> 3000
Forwarding from [::1]:3000 -> 3000

Then I'm reverse proxying port 3000 with Caddy server. When I try to access the p.js file I get this

image

If you could give me any guidance at all, or point me in the right direction I would appreciate it!

hendrikheil commented 6 months ago

You seem to be enabling the ingress for console as well. This is already handled by the default ingress. You can (probably) just discard the console.ingress values completely.

Your port-forward is also only for the console application, which doesn't host the script. I would recommend you don't port-forward and reverse proxy anything and just leverage the ingress from kubernetes.

A simple port-forward won't cut it, since you need to forward different request paths to one of two services. That's actually what the ingress is doing.

If you want a dedicated domain for ingest and one for the console, you'd have to disable the default ingress ingress.enabled=false and instead configure each services' ingresses manually

dlbone commented 6 months ago

@hendrikheil That's where I landed after writing above. Enabling for the console as well was just me tinkering around to see if I could get it to work.

I'm working on setting up an ingress service for the Kubernetes cluster with something like: helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace default --set controller.ingressClassResource.name=nginx,controller.ingressClassResource.enabled=true,controller.ingressClassResource.default=true

edit: I think my issue is that I'm using a hetzner server and it's not set up correctly to provide the network access to kubernetes. Working on debugging and will see if I come up with a solution.