microservices-demo icon indicating copy to clipboard operation
microservices-demo copied to clipboard

Frontent not reachable behind Ingress

Open amrap030 opened this issue 1 year ago • 3 comments

Describe the bug

I tried to deploy the Online Boutique in my Kubernetes Cluster, but somehow the frontend is not reachable from my Browser behind a Traefik Ingress. It shows a 404 Error.

To Reproduce

  1. Successfully create Traefik Ingress on Kubernetes Cluster
  2. Install Online Boutique via Helm
helm upgrade onlineboutique oci://us-docker.pkg.dev/online-boutique-ci/charts/onlineboutique --install --create-namespace -n demo
  1. Patch frontend-external service to get ClusterIP
kubectl patch svc frontend-external -n demo -p '{"spec": {"type": "ClusterIP"}}'
  1. Create Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    traefik.ingress.kubernetes.io/router.tls: "true"
    cert-manager.io/cluster-issuer: acme
  name: jupyter-ingress
spec:
  rules:
  - host: <HOST>
    http:
      paths:
      - path: /demo
        pathType: Prefix
        backend:
          service:
            name: frontend-external # frontend also doesn't work
            port:
              number: 80
  tls:
  - hosts:
    - <HOST>
    secretName: traefik-tls-secret
  1. Add Ingress to Namespace
kubectl -n demo apply -f demo-ingress.yaml

For any other application this approach works. Do I miss some configuration?

Environment

  • OS: Openstack
  • Kubernetes distribution, version: Charmed Kubernetes v1.27.3 on Openstack

amrap030 avatar Jun 28 '23 23:06 amrap030

Hello @amrap030 , we will try to address your question. I am not familiar with the Trafeik ingress configurations and can only guess how it works. While we work to review your question, can you please confirm the following two points of interest:

  • Is it required to specify the namespace where the backend's service is provisioned if the service is not provisioned in the default namespace? I see that you deploy online boutique manifests into demo namespace which will provision the frontend-external service in that namespace as well.
  • Is it required to specify different path than one the request is received at ingress? Since the path in the shown configuration is /demo and Online Boutique uses / it is possible that additional configuration to redirect requests made to /demo to be forwarded to / is required.

minherz avatar Jul 01 '23 00:07 minherz

@NimJay please let me know if you need additional information about this behavior from a reporter.

minherz avatar Sep 22 '23 15:09 minherz

@amrap030, unfortunately, we (Online Boutique developers) don't actively support users journeys for Traefik Ingress.

  • Your Ingress object looks good to me. It looks very similar to the Ingress object we use for onlineboutique.dev. But I cannot speak on the Traefik Ingress parts of your Ingress object (but you mentioned that same Ingress worked for other apps, so I assume the Traefik-related parts are good too).
  • Thanks for testing both frontend and frontend-external BTW.

1. Could you also please try without path: /demo? 2. Are you able to obtain more logs (any logs on the Ingress object? what about the Services? any Traefik-related logs you can pull)?

NimJay avatar Sep 22 '23 18:09 NimJay

Closing as inactive. Feel free to reopen if you have more details to provide.

bourgeoisor avatar Apr 17 '24 21:04 bourgeoisor