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

ingress-controller/config: add support for direct response #897

Open
calebdoxsey opened this issue Feb 13, 2024 · 3 comments
Open

ingress-controller/config: add support for direct response #897

calebdoxsey opened this issue Feb 13, 2024 · 3 comments

Comments

@calebdoxsey
Copy link
Contributor

Direct responses are described in pomerium/pomerium#4954. We should support them in the ingress controller as well.

@calebdoxsey
Copy link
Contributor Author

@wasaga it appears that we don't currently support the redirect option, I'm guessing because its incompatible with an ingress rule. For the same reason, would the new direct response option also not be supported?

@wasaga
Copy link
Collaborator

wasaga commented Feb 27, 2024

I believe we may do that using i.e. ConfigMap or a Secret reference and Resource Backends

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: direct-response
  namespace: default
spec:
  ingressClassName: pomerium
  rules:
  - host: direct-response.localhost.pomerium.io
    http:
      paths:
      - backend:
          resource:
            kind: ConfigMap
            name: mydata
        path: /
        pathType: Exact
apiVersion: v1
kind: ConfigMap
metadata:
  name: mydata
  namespace: default
data:
  contentType: application/json
  code: "200"
  data: |
    {
      "key": "value"
    }

@calebdoxsey
Copy link
Contributor Author

I think this needs more detailed requirements. I'm not sure how the backend resource is intended to be used with an ingress rule. For example, what would be the format of the data in the config map or secret? The direct response itself:

{"status":200, "body": "TEST"}

Or is it something more nested?

{
  "response": {
    "status": 200,
    "body": "TEST"
  }
}

Maybe we should put this on hold till we have clearer needs from users.

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

No branches or pull requests

3 participants