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

Is there a way to add any rule in default section #624

Open
diwakar-s-maurya opened this issue Oct 14, 2017 · 1 comment
Open

Is there a way to add any rule in default section #624

diwakar-s-maurya opened this issue Oct 14, 2017 · 1 comment
Labels

Comments

@diwakar-s-maurya
Copy link

I want to send a unique string in header to backend for every request. The below configuration is works fine

apiVersion: voyager.appscode.com/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  namespace: default
spec:
  frontendRules:
  - port: 80  # Applies all the rule in frontend section for port 80
    rules:
    - unique-id-header X-Unique-ID
    - unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
    - log-format %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ %{+Q}r\ %ID
  rules:
  - host: foo.bar.com
    http:
      paths:
      - backend:
          serviceName: echoserver
          servicePort: '8080'

The rules unique-id-header, unique-id-format and log-format will apply only to one particular frontend.
Is there a way to move these rules in default section of haproxy configmap so that they get applied to every other frontend and I don't have to repeat the rules again for other frontends?
This supports only the option config of haproxy.

@tamalsaha
Copy link
Contributor

@diwakar-s-maurya , frontend rules applies any host that is using the corresponding port (eg 80).

Is there a way to move these rules in default section of haproxy configmap so that they get applied to every other frontend and I don't have to repeat the rules again for other frontends?

This is not possible today via annotations. But you can use custom templates to achieve this. Unless you are exposing many other ports from HAProxy, I would say just use the frontend rules.

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

No branches or pull requests

2 participants