Self-links broken under traefik 2.1.3

I’ve created this IngressRoute:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: traefik-graylog
spec:
  entryPoints:
  - web
  routes:
  - kind: Rule
    match: Host(`graylog.localhost`)
    services:
    - name: graylog-web
      port: 9000

As you can see I’m trying to get access to service graylog-web/9000 under graylog.localhost.

My graylog-web/9000 service description is:

$ kubectl get service graylog-web -o yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2020-03-15T16:44:18Z"
  labels:
    app.kubernetes.io/component: web
    app.kubernetes.io/instance: graylog
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: graylog
    app.kubernetes.io/version: "3.1"
    helm.sh/chart: graylog-1.6.1
  name: graylog-web
  namespace: graylog
  resourceVersion: "117147"
  selfLink: /api/v1/namespaces/graylog/services/graylog-web
  uid: de164073-2823-451a-b39a-e52e78b09042
spec:
  clusterIP: 10.43.53.82
  ports:
  - name: graylog
    port: 9000
    protocol: TCP
    targetPort: 9000
  selector:
    app.kubernetes.io/instance: graylog
    app.kubernetes.io/name: graylog
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

I’m able to reach that:

$ curl graylog.localhost
<!DOCTYPE html>
<html>
  <head>
    ...
  </head>
  <body>
    <script src="http://graylog-1.graylog.graylog.svc.cluster.local:9000/config.js"></script>
    ...
  </body>
</html>

Nevertheless, it’s returning me self-links to graylog-1.graylog.graylog.svc.cluster.local:9000....

Next time I try to reach it:

$ curl graylog.localhost
<!DOCTYPE html>
<html>
  <head>
    ...
  </head>
  <body>
    <script src="http://graylog-0.graylog.graylog.svc.cluster.local:9000/config.js"></script>
    ...
  </body>
</html>

As you can see, next time it’s returning links to graylog-0....

graylog-0 and graylog-1 are pods runing “behind” graylog-web service:

$ kubectl get pods -l app.kubernetes.io/instance=graylog,app.kubernetes.io/name=graylog
NAME        READY   STATUS    RESTARTS   AGE
graylog-0   1/1     Running   0          59m
graylog-1   1/1     Running   0          57m
  1. Why it’s returning this so large link to internal pods?
  2. I think it should return self-links to ingressRoute graylog.localhost, shouldn’t it?

I’m not sure how this all is working in your abstracted setup.

But you need to configure the http_external_uri in Graylog proper - maybe some of the tools you have inbetween document how you can set that right.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.