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

Configurable default backend #18

Open
kjoller opened this issue Mar 13, 2019 · 3 comments
Open

Configurable default backend #18

kjoller opened this issue Mar 13, 2019 · 3 comments

Comments

@kjoller
Copy link

kjoller commented Mar 13, 2019

Hello, I am currently experimenting with Xposer running with Træfik as my ingress controller.

However, when I have multiple services defined with expose: "true", I have Traefik acting up, due to the default backend defined in the Xposer-generated ingress. I am flooded with these log messages:

time="2019-03-13T09:40:24Z" level=error msg="Error creating global backend for ingress default/example-apache: duplicate frontend: global-default-frontend"
time="2019-03-13T09:40:24Z" level=error msg="Error creating global backend for ingress default/example-apache: duplicate frontend: global-default-frontend"
time="2019-03-13T09:40:26Z" level=error msg="Error creating global backend for ingress default/example-nginx: duplicate frontend: global-default-frontend"
time="2019-03-13T09:40:26Z" level=error msg="Error creating global backend for ingress default/example-apache: duplicate frontend: global-default-frontend"

The advice in traefik/traefik#4266 is to remove the backend-section directly below spec: in the ingress, thereby changin: this:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  creationTimestamp: "2019-03-13T08:58:45Z"
  generation: 1
  name: example-apache
  namespace: default
  resourceVersion: "947618"
  selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/example-apache
  uid: 351ede0d-456e-11e9-8cd6-c84e578580e0
spec:
  backend:
    serviceName: example-apache
    servicePort: 80
  rules:
  - host: example-apache.default.mydomain.com
    http:
      paths:
      - backend:
          serviceName: example-apache
          servicePort: 80
        path: /
status:
  loadBalancer: {}

into this:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  creationTimestamp: "2019-03-13T08:58:45Z"
  generation: 1
  name: example-apache
  namespace: default
  resourceVersion: "947618"
  selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/example-apache
  uid: 351ede0d-456e-11e9-8cd6-c84e578580e0
spec:
  rules:
  - host: example-apache.default.mydomain.com
    http:
      paths:
      - backend:
          serviceName: example-apache
          servicePort: 80
        path: /
status:
  loadBalancer: {}

Is this possible to do in Xposer, or is there another solution to this problem (other than using nginx as ingress controller)?

@ahsan-storm
Copy link
Contributor

Hello @kjoller, right now we can not remove the backend section directly using Xposer, but it can be done. Do you plan to create a PR for it?

@kjoller
Copy link
Author

kjoller commented Mar 15, 2019

@ahsan-storm I would like to give it a try, although Go is not my expertise. I would think to add it in the config something like this:

domain: stakater.com
ingressURLTemplate: "{{.Service}}.{{.Namespace}}.{{.Domain}}"
ingressURLPath: /
ingressNameTemplate: "{{.Service}}"
tls: false
defaultBackend: false

Would that, in your opinion be the proper place for it?

I have currently created a private version with the backend section violently ripped out. It seems to work find with both nginx and traefik ingress controllers. I am not sure why it would be needed anywhere, but I am not going to claim deep knowledge in the field.

kjoller added a commit to kjoller/Xposer that referenced this issue Mar 15, 2019
kjoller added a commit to kjoller/Xposer that referenced this issue Mar 15, 2019
kjoller added a commit to kjoller/Xposer that referenced this issue Mar 15, 2019
@rasheedamir
Copy link
Member

@kjoller i see you made changes in your fork; i wonder if you would like to make a PR for this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants