Has someone managed to deploy Datahub with Traefik...
# all-things-deployment
t
Has someone managed to deploy Datahub with Traefik reverse proxy? I am getting following errors when I am trying to login into the page:
Copy code
Failed to log in! SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
i
Hello Lauri, Could you share your traefik definition? Looks like a configuration typo.
t
For my Traefik configurations I have following:
Copy code
# Configure ports
ports:
  # The name of this one can't be changed as it is used for the readiness and
  # liveness probes, but you can adjust its config to your liking
  traefik:
    port: 9000
    expose: false
    # The exposed port for this service
    exposedPort: 9000
    # The port protocol (TCP/UDP)
    protocol: TCP
  api:
    port: 8080
    expose: true
    exposedPort: 8080
    protocol: TCP
service:
  enabled: true
  type: ClusterIP
For my ingress rule I have following:
Copy code
---
apiVersion: <http://traefik.containo.us/v1alpha1|traefik.containo.us/v1alpha1>
kind: IngressRoute
metadata:
  name: datahub-frontend
  namespace: default
spec:
  entryPoints:
    - api
    - websecure
  routes:
    - kind: Rule
      match: Host(`<http://host.myhost.net|host.myhost.net>`) && PathPrefix(`/`)
      priority: 1
      services:
        - name: datahub-datahub-frontend
          port: 9002
    - kind: Rule
      match: Host(`<http://host-api.myhost.net|host-api.myhost.net>`) && PathPrefix(`/`)
      priority: 2
      services:
        - name: datahub-datahub-gms
          port: 8080
And for LB/Ingress:
Copy code
---
apiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: Ingress
metadata:
  namespace: default
  name: ingress
  annotations:
    <http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>: alb
    <http://alb.ingress.kubernetes.io/certificate-arn|alb.ingress.kubernetes.io/certificate-arn>: arn:aws:acm:eu-central-1:account:certificate/123123123
    <http://alb.ingress.kubernetes.io/scheme|alb.ingress.kubernetes.io/scheme>: "internal"
    <http://alb.ingress.kubernetes.io/target-type|alb.ingress.kubernetes.io/target-type>: "ip"
    <http://alb.ingress.kubernetes.io/target-group-attributes|alb.ingress.kubernetes.io/target-group-attributes>: stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=60
    <http://alb.ingress.kubernetes.io/listen-ports|alb.ingress.kubernetes.io/listen-ports>: '[{"HTTP":80,"HTTPS": 443}]'
    <http://alb.ingress.kubernetes.io/subnets|alb.ingress.kubernetes.io/subnets>: subnet-1, subnet-2, subnet-3
    <http://alb.ingress.kubernetes.io/healthcheck-path|alb.ingress.kubernetes.io/healthcheck-path>: "/"
    <http://alb.ingress.kubernetes.io/success-codes|alb.ingress.kubernetes.io/success-codes>: "200,404"
spec:
  rules:
  - host:
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: traefik
            port:
              number: 443
      - path: /
        pathType: Prefix
        backend:
          service:
            name: traefik
            port:
              number: 8080
i
I’m not familiar with Traefik, looking at your K8s resources it looks ok. I’m going to try and get someone who might know more to you help you Lauri.
e
So are you using the reverse proxy from within the cluster as well? the above error is when frontend is unable to contact gms pod